# omanixin-web/findmydate architecture

> Architecture diagram of the GitHub repository omanixin-web/findmydate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omanixin-web/findmydate
- Repository: https://github.com/omanixin-web/findmydate

## Overview

FindMyDate is a matchmaking service: applicants complete a multi-step profile, the service validates and stores submissions, matching generates candidate pairs, and staff review and manage them in a private portal. The README also documents dashboard analytics, participant search and detail views, CSV export, and demo seeding. The graph includes the main domain stages and storage/auth layers; edges use documented or excerpted relationships, while unsampled page and route behavior is represented only where the README supports it.

Main entry points: [`lib/store.ts`](https://github.com/omanixin-web/findmydate/blob/main/lib/store.ts) (JSON file store), [`lib/questions.ts`](https://github.com/omanixin-web/findmydate/blob/main/lib/questions.ts) (Profile questions), [`app/admin/page.tsx`](https://github.com/omanixin-web/findmydate/blob/main/app/admin/page.tsx) (Dashboard), [`components/ApplyForm.tsx`](https://github.com/omanixin-web/findmydate/blob/main/components/ApplyForm.tsx) (Application form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_applicant["Applicant experience"]
  node_site["Public site<br/>[page.tsx]"]
  node_application["Application form<br/>[ApplyForm.tsx]"]
  node_submission["Submission endpoint<br/>[route.ts]"]
end

subgraph group_domain["Profile and matching"]
  node_schema["Profile questions<br/>[questions.ts]"]
  node_matching["Pairing algorithm<br/>[matching.ts]"]
end

subgraph group_admin["Staff operations"]
  node_login["Admin sign-in<br/>[LoginForm.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_participant_views["Participant views"]
  node_match_views["Match review<br/>[page.tsx]"]
  node_match_actions["Match actions<br/>[Actions.tsx]"]
  node_match_route["Match status endpoint<br/>[route.ts]"]
  node_matching_route["Run matching endpoint<br/>[route.ts]"]
  node_export["CSV export<br/>[route.ts]"]
  node_seed["Demo participant seeding<br/>[route.ts]"]
end

subgraph group_infra["Access and persistence"]
  node_auth["Session authentication<br/>[auth.ts]"]
  node_middleware["Admin access gate<br/>[middleware.ts]"]
  node_login_route["Login endpoint<br/>[route.ts]"]
  node_store[("JSON file store<br/>[store.ts]")]
end

node_applicant(("Applicant"))
node_admin(("Staff"))

node_applicant -->|"visits"| node_site
node_site -->|"opens form"| node_application
node_application -->|"uses fields"| node_schema
node_application -.->|"submits answers"| node_submission
node_submission -->|"validates with"| node_schema
node_submission -->|"writes participant"| node_store
node_admin -->|"signs in"| node_login
node_login -.->|"posts credentials"| node_login_route
node_login_route -->|"creates session"| node_auth
node_middleware -->|"verifies session"| node_auth
node_admin -->|"reviews metrics"| node_dashboard
node_dashboard -->|"reads records"| node_store
node_admin -->|"reviews profiles"| node_participant_views
node_participant_views -->|"reads participants"| node_store
node_admin -->|"reviews pairs"| node_match_views
node_match_views -->|"reads matches"| node_store
node_match_views -->|"renders controls"| node_match_actions
node_match_actions -->|"updates status"| node_match_route
node_match_route -->|"mutates match"| node_store
node_dashboard -->|"runs matching"| node_matching_route
node_matching_route -->|"generates pairs"| node_matching
node_matching_route -->|"reads and saves"| node_store
node_matching -->|"uses profile fields"| node_schema
node_matching -->|"reads match data"| node_store
node_admin -->|"exports records"| node_export
node_export -->|"reads participants"| node_store
node_export -->|"uses field list"| node_schema
node_dashboard -->|"adds demo people"| node_seed
node_seed -->|"writes participants"| node_store
node_seed -->|"uses profile fields"| node_schema

click node_site "https://github.com/omanixin-web/findmydate/blob/main/app/(site)/page.tsx"
click node_application "https://github.com/omanixin-web/findmydate/blob/main/components/ApplyForm.tsx"
click node_submission "https://github.com/omanixin-web/findmydate/blob/main/app/api/apply/route.ts"
click node_schema "https://github.com/omanixin-web/findmydate/blob/main/lib/questions.ts"
click node_matching "https://github.com/omanixin-web/findmydate/blob/main/lib/matching.ts"
click node_login "https://github.com/omanixin-web/findmydate/blob/main/components/admin/LoginForm.tsx"
click node_dashboard "https://github.com/omanixin-web/findmydate/blob/main/app/admin/page.tsx"
click node_participant_views "https://github.com/omanixin-web/findmydate/tree/main/app/admin/participants"
click node_match_views "https://github.com/omanixin-web/findmydate/blob/main/app/admin/matches/page.tsx"
click node_match_actions "https://github.com/omanixin-web/findmydate/blob/main/components/admin/Actions.tsx"
click node_match_route "https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/matches/%5Bid%5D/route.ts"
click node_matching_route "https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/matches/run/route.ts"
click node_export "https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/export/route.ts"
click node_seed "https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/seed/route.ts"
click node_auth "https://github.com/omanixin-web/findmydate/blob/main/lib/auth.ts"
click node_middleware "https://github.com/omanixin-web/findmydate/blob/main/middleware.ts"
click node_login_route "https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/login/route.ts"
click node_store "https://github.com/omanixin-web/findmydate/blob/main/lib/store.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site,node_application,node_submission toneBlue
class node_schema,node_matching toneAmber
class node_login,node_dashboard,node_participant_views,node_match_views,node_match_actions,node_match_route,node_matching_route,node_export,node_seed toneMint
class node_auth,node_middleware,node_login_route,node_store toneRose
class node_applicant,node_admin toneIndigo
```

## Components

### Applicant experience

- [Public site](https://github.com/omanixin-web/findmydate/blob/main/app/(site)/page.tsx): `app/(site)/page.tsx`
- [Application form](https://github.com/omanixin-web/findmydate/blob/main/components/ApplyForm.tsx): `components/ApplyForm.tsx`
- [Submission endpoint](https://github.com/omanixin-web/findmydate/blob/main/app/api/apply/route.ts): `app/api/apply/route.ts`

### Profile and matching

- [Profile questions](https://github.com/omanixin-web/findmydate/blob/main/lib/questions.ts): `lib/questions.ts`
- [Pairing algorithm](https://github.com/omanixin-web/findmydate/blob/main/lib/matching.ts): `lib/matching.ts`

### Staff operations

- [Admin sign-in](https://github.com/omanixin-web/findmydate/blob/main/components/admin/LoginForm.tsx): `components/admin/LoginForm.tsx`
- [Dashboard](https://github.com/omanixin-web/findmydate/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Participant views](https://github.com/omanixin-web/findmydate/tree/main/app/admin/participants): `app/admin/participants`
- [Match review](https://github.com/omanixin-web/findmydate/blob/main/app/admin/matches/page.tsx): `app/admin/matches/page.tsx`
- [Match actions](https://github.com/omanixin-web/findmydate/blob/main/components/admin/Actions.tsx): `components/admin/Actions.tsx`
- [Match status endpoint](https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/matches/%5Bid%5D/route.ts): `app/api/admin/matches/[id]/route.ts`
- [Run matching endpoint](https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/matches/run/route.ts): `app/api/admin/matches/run/route.ts`
- [CSV export](https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/export/route.ts): `app/api/admin/export/route.ts`
- [Demo participant seeding](https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/seed/route.ts): `app/api/admin/seed/route.ts`

### Access and persistence

- [Session authentication](https://github.com/omanixin-web/findmydate/blob/main/lib/auth.ts): `lib/auth.ts`
- [Admin access gate](https://github.com/omanixin-web/findmydate/blob/main/middleware.ts): `middleware.ts`
- [Login endpoint](https://github.com/omanixin-web/findmydate/blob/main/app/api/admin/login/route.ts): `app/api/admin/login/route.ts`
- [JSON file store](https://github.com/omanixin-web/findmydate/blob/main/lib/store.ts): `lib/store.ts`

### Other components

- **Applicant**
- **Staff**

## Connections

- Applicant → Public site: visits (evidence: `README.md`)
- Public site → Application form: opens form
- Application form → Profile questions: uses fields (evidence: `components/ApplyForm.tsx`)
- Application form → Submission endpoint: submits answers
- Submission endpoint → Profile questions: validates with (evidence: `app/api/apply/route.ts`)
- Submission endpoint → JSON file store: writes participant (evidence: `app/api/apply/route.ts`)
- Staff → Admin sign-in: signs in (evidence: `README.md`)
- Admin sign-in → Login endpoint: posts credentials
- Login endpoint → Session authentication: creates session (evidence: `app/api/admin/login/route.ts`)
- Admin access gate → Session authentication: verifies session (evidence: `middleware.ts`)
- Staff → Dashboard: reviews metrics (evidence: `README.md`)
- Dashboard → JSON file store: reads records (evidence: `app/admin/page.tsx`)
- Staff → Participant views: reviews profiles (evidence: `README.md`)
- Participant views → JSON file store: reads participants (evidence: `app/admin/participants/page.tsx`)
- Staff → Match review: reviews pairs (evidence: `README.md`)
- Match review → JSON file store: reads matches (evidence: `app/admin/matches/page.tsx`)
- Match review → Match actions: renders controls (evidence: `app/admin/matches/page.tsx`)
- Match actions → Match status endpoint: updates status (evidence: `components/admin/Actions.tsx`)
- Match status endpoint → JSON file store: mutates match (evidence: `app/api/admin/matches/[id]/route.ts`)
- Dashboard → Run matching endpoint: runs matching
- Run matching endpoint → Pairing algorithm: generates pairs (evidence: `app/api/admin/matches/run/route.ts`)
- Run matching endpoint → JSON file store: reads and saves (evidence: `app/api/admin/matches/run/route.ts`)
- Pairing algorithm → Profile questions: uses profile fields (evidence: `lib/matching.ts`)
- Pairing algorithm → JSON file store: reads match data (evidence: `lib/matching.ts`)
- Staff → CSV export: exports records (evidence: `README.md`)
- CSV export → JSON file store: reads participants (evidence: `app/api/admin/export/route.ts`)
- CSV export → Profile questions: uses field list (evidence: `app/api/admin/export/route.ts`)
- Dashboard → Demo participant seeding: adds demo people
- Demo participant seeding → JSON file store: writes participants (evidence: `app/api/admin/seed/route.ts`)
- Demo participant seeding → Profile questions: uses profile fields (evidence: `app/api/admin/seed/route.ts`)
