@deina-labs/deina-core
v1.1.9
Published
Shared dating archetype logic for Deina — used by mobile, web app and edge functions
Readme
@deina-labs/deina-core
Shared dating archetype logic, quiz data, onboarding content, and coaching characters for the Deina ecosystem. Used by the mobile app (React Native/Expo), web app, and Supabase edge functions.
Zero runtime dependencies. Pure TypeScript data + logic.
Installation
Option 1: npm (recommended)
yarn add @deina-labs/deina-coreOption 2: GitHub dependency
In your consuming project's package.json:
{
"dependencies": {
"@deina-labs/deina-core": "github:joynOS/deina-core"
}
}Then run:
yarn installOption 3: Local development (linking)
If you're working on deina-core alongside another project locally:
# In deina-core/
yarn install
yarn build
# In your consuming project/
yarn add link:../deina-coreOption 4: Supabase Edge Functions (Deno)
import { classifyArchetype, DATING_ARCHETYPES } from 'npm:@deina-labs/deina-core';For the npm: specifier to work, the package must be published to npm or use an import map pointing to the GitHub dependency.
Build
yarn install
yarn buildThis compiles src/ to dist/ with type declarations.
What's inside
| File | What it exports |
|------|----------------|
| types.ts | DatingArchetype, ArchetypeCoaching, UserPreferences interfaces |
| archetypes.ts | DATING_ARCHETYPES — the 6 archetype definitions |
| coaching.ts | ARCHETYPE_COACHING, buildArchetypeContext() — coaching directives per archetype |
| classify.ts | classifyArchetype() — weighted scoring across all 5 quiz sections |
| quiz-questions.ts | STANDARDS_QUALITIES, TIMELINE_QUESTIONS, MINDSET_QUESTIONS, ENFORCEMENT_QUESTIONS, TRADEOFF_QUESTIONS |
| fun-facts.ts | ONBOARDING_FUN_FACTS, SECTION_HINTS — transition screen content |
| onboarding-content.ts | DISCLAIMER_CONTENT, ABOUT_YOU_CONTENT, SECTION_INTROS (standards, timeline, mindset, tradeoffs, enforcement, players), ARCHETYPE_REVEAL_CONTENT, MEET_DEINA_CONTENT, CHOOSE_DEINA_CONTENT, ACCOUNT_CREATION_CONTENT |
| deinas.ts | DEINA_CHARACTERS, getDeinaById() — 7 coaching characters |
| archetype-card.ts | renderArchetypePage(), renderNotFoundPage() — HTML share card renderer |
Usage
Importing in React Native / Expo
import {
DATING_ARCHETYPES,
classifyArchetype,
STANDARDS_QUALITIES,
TIMELINE_QUESTIONS,
MINDSET_QUESTIONS,
ENFORCEMENT_QUESTIONS,
TRADEOFF_QUESTIONS,
} from '@deina-labs/deina-core';
// Classify a user's archetype from their quiz answers
const archetype = classifyArchetype({
standards: { physicalAttraction: 4, emotionalStability: 5, ... },
timelineAnswers: { progressionPace: 'Structured and steady', ... },
mindsetAnswers: { standardsConfidence: '4', ... },
enforcementAnswers: { cancelDowngrade: '1 time', ... },
tradeOffAnswers: { consistencyVsChemistry: 'Consistent effort even if chemistry builds slowly', ... },
});
console.log(archetype.name); // "The Strategic Dater"
console.log(archetype.signatureLine); // "You trust patterns more than promises."Using onboarding content
import {
DISCLAIMER_CONTENT,
SECTION_INTROS,
ABOUT_YOU_CONTENT,
} from '@deina-labs/deina-core';
// All screen copy is centralized — no hardcoded strings in your UI
<Text>{DISCLAIMER_CONTENT.heading}</Text>
<Text>{SECTION_INTROS.standards.body}</Text>Coaching context for AI prompts
import { buildArchetypeContext } from '@deina-labs/deina-core';
const context = buildArchetypeContext('the-strategic-dater');
// Returns a formatted string with traits, pitfalls, and coaching directive
// ready to inject into a system promptDeina characters
import { DEINA_CHARACTERS, getDeinaById } from '@deina-labs/deina-core';
const deina = getDeinaById('blonde');
console.log(deina.name); // "Chloe"
console.log(deina.tone); // "The Optimistic Strategist"
console.log(deina.systemPromptModifier); // system prompt personality modifierShare card HTML (edge functions)
import { renderArchetypePage, renderNotFoundPage } from '@deina-labs/deina-core';
// Returns a full HTML page string
const html = renderArchetypePage(archetype, 'Josephine');
const notFound = renderNotFoundPage();Architecture
Mobile App (Expo) ──┐
├──> @deina-labs/deina-core (this package)
Web App ──┤
│
Edge Functions ──┘All quiz logic, archetype data, coaching content, and onboarding copy lives here. Consumer apps only handle UI rendering and platform-specific concerns.
