# mayormankind/rehevo architecture

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

- Interactive diagram: https://gitdiagram.com/mayormankind/rehevo
- Repository: https://github.com/mayormankind/rehevo

## Overview

Rehevo is a private AI rehearsal product for preparing high-stakes conversations. Its main user journey moves from choosing and configuring a scenario to practicing spoken or typed turns, receiving AI pushback, then reviewing moments and drilling weak areas across attempts. The graph also preserves account setup, session history, reports, and settings as distinct product capabilities. Source excerpts show the AI engines and some storage access, but not every page’s runtime wiring; uncertain connections are omitted or marked dashed.

Main entry points: [`src/components/rehevo/rehearsal-room-client.tsx`](https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/rehearsal-room-client.tsx) (Rehearsal room), [`src/lib/ai/openai-engine.ts`](https://github.com/mayormankind/rehevo/blob/main/src/lib/ai/openai-engine.ts) (AI generation and evaluation), [`src/app/(marketing)/page.tsx`](https://github.com/mayormankind/rehevo/blob/main/src/app/(marketing)/page.tsx) (Product entry), [`src/app/(app)/dashboard/page.tsx`](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/dashboard/page.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Product experience"]
  node_marketing["Product entry<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_scenario_catalog["Scenario catalog<br/>[page.tsx]"]
  node_scenario_setup["Scenario setup<br/>[page.tsx]"]
  node_scenario_definitions["Scenario definitions<br/>[scenarios.ts]"]
end

subgraph group_practice["Rehearsal and improvement"]
  node_rehearsal_room["Rehearsal room"]
  node_session_history["Sessions and attempts<br/>[page.tsx]"]
  node_review["Reflection and moments"]
  node_drill["Targeted practice<br/>[drill-client.tsx]"]
  node_reports["Reports<br/>[page.tsx]"]
end

subgraph group_platform["AI and persistence"]
  node_turn_api["AI turn endpoint<br/>[route.ts]"]
  node_ai_engine["AI generation and evaluation<br/>[openai-engine.ts]"]
  node_mock_engine["Mock responses and evaluation<br/>[mock-engine.ts]"]
  node_session_store[("Session and profile storage<br/>[server.ts]")]
  node_browser_store[("Browser-side storage access<br/>[client.ts]")]
end

subgraph group_account["Identity and settings"]
  node_auth["Sign in and signup"]
  node_settings["Account preferences"]
end

node_user(("Participant"))
node_supabase[("Supabase")]
node_openai(("OpenAI"))

node_user -->|"visits"| node_marketing
node_marketing -->|"starts account"| node_auth
node_user -->|"prepares"| node_dashboard
node_dashboard -->|"reads data"| node_session_store
node_user -->|"chooses scenario"| node_scenario_catalog
node_scenario_catalog -.->|"uses scenarios"| node_scenario_definitions
node_user -->|"sets context"| node_scenario_setup
node_scenario_setup -.->|"begins practice"| node_rehearsal_room
node_rehearsal_room -->|"loads scenario"| node_scenario_definitions
node_rehearsal_room -.->|"updates session"| node_browser_store
node_rehearsal_room -.->|"requests AI turn"| node_turn_api
node_turn_api -->|"generates and evaluates"| node_ai_engine
node_ai_engine -->|"requests completions"| node_openai
node_ai_engine -->|"falls back to"| node_mock_engine
node_rehearsal_room -->|"gets fallback turns"| node_mock_engine
node_user -->|"reviews attempts"| node_session_history
node_user -->|"reflects on moments"| node_review
node_review -.->|"repeats weak moments"| node_drill
node_user -->|"views progress"| node_reports
node_user -->|"manages preferences"| node_settings
node_browser_store -.->|"connects to"| node_supabase
node_session_store -.->|"connects to"| node_supabase

click node_marketing "https://github.com/mayormankind/rehevo/blob/main/src/app/(marketing)/page.tsx"
click node_auth "https://github.com/mayormankind/rehevo/tree/main/src/app/(auth)"
click node_dashboard "https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/dashboard/page.tsx"
click node_scenario_catalog "https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/scenarios/page.tsx"
click node_scenario_setup "https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/scenarios/%5Bid%5D/setup/page.tsx"
click node_scenario_definitions "https://github.com/mayormankind/rehevo/blob/main/src/lib/constants/scenarios.ts"
click node_rehearsal_room "https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/rehearsal-room-client.tsx"
click node_turn_api "https://github.com/mayormankind/rehevo/blob/main/src/app/api/ai/turn/route.ts"
click node_ai_engine "https://github.com/mayormankind/rehevo/blob/main/src/lib/ai/openai-engine.ts"
click node_mock_engine "https://github.com/mayormankind/rehevo/blob/main/src/lib/ai/mock-engine.ts"
click node_session_store "https://github.com/mayormankind/rehevo/blob/main/src/lib/supabase/server.ts"
click node_browser_store "https://github.com/mayormankind/rehevo/blob/main/src/lib/supabase/client.ts"
click node_session_history "https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/sessions/page.tsx"
click node_review "https://github.com/mayormankind/rehevo/blob/main/src/components/product/reflection-client.tsx"
click node_drill "https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/drill-client.tsx"
click node_reports "https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/reports/%5Bid%5D/page.tsx"
click node_settings "https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/settings-page-client.tsx"

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_marketing,node_dashboard,node_scenario_catalog,node_scenario_setup,node_scenario_definitions toneBlue
class node_rehearsal_room,node_session_history,node_review,node_drill,node_reports,node_supabase toneAmber
class node_turn_api,node_ai_engine,node_mock_engine,node_session_store,node_browser_store toneMint
class node_auth,node_settings toneRose
class node_user,node_openai toneIndigo
```

## Components

### Product experience

- [Product entry](https://github.com/mayormankind/rehevo/blob/main/src/app/(marketing)/page.tsx): `src/app/(marketing)/page.tsx`
- [Dashboard](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/dashboard/page.tsx): `src/app/(app)/dashboard/page.tsx`
- [Scenario catalog](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/scenarios/page.tsx): `src/app/(app)/scenarios/page.tsx`
- [Scenario setup](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/scenarios/%5Bid%5D/setup/page.tsx): `src/app/(app)/scenarios/[id]/setup/page.tsx`
- [Scenario definitions](https://github.com/mayormankind/rehevo/blob/main/src/lib/constants/scenarios.ts): `src/lib/constants/scenarios.ts`

### Rehearsal and improvement

- [Rehearsal room](https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/rehearsal-room-client.tsx): `src/components/rehevo/rehearsal-room-client.tsx`
- [Sessions and attempts](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/sessions/page.tsx): `src/app/(app)/sessions/page.tsx`
- [Reflection and moments](https://github.com/mayormankind/rehevo/blob/main/src/components/product/reflection-client.tsx): `src/components/product/reflection-client.tsx`
- [Targeted practice](https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/drill-client.tsx): `src/components/rehevo/drill-client.tsx`
- [Reports](https://github.com/mayormankind/rehevo/blob/main/src/app/(app)/reports/%5Bid%5D/page.tsx): `src/app/(app)/reports/[id]/page.tsx`

### AI and persistence

- [AI turn endpoint](https://github.com/mayormankind/rehevo/blob/main/src/app/api/ai/turn/route.ts): `src/app/api/ai/turn/route.ts`
- [AI generation and evaluation](https://github.com/mayormankind/rehevo/blob/main/src/lib/ai/openai-engine.ts): `src/lib/ai/openai-engine.ts`
- [Mock responses and evaluation](https://github.com/mayormankind/rehevo/blob/main/src/lib/ai/mock-engine.ts): `src/lib/ai/mock-engine.ts`
- [Session and profile storage](https://github.com/mayormankind/rehevo/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Browser-side storage access](https://github.com/mayormankind/rehevo/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`

### Identity and settings

- [Sign in and signup](https://github.com/mayormankind/rehevo/tree/main/src/app/(auth)): `src/app/(auth)`
- [Account preferences](https://github.com/mayormankind/rehevo/blob/main/src/components/rehevo/settings-page-client.tsx): `src/components/rehevo/settings-page-client.tsx`

### Other components

- **Participant**
- **Supabase**
- **OpenAI**

## Connections

- Participant → Product entry: visits (evidence: `README.md`)
- Product entry → Sign in and signup: starts account (evidence: `src/app/(marketing)/page.tsx`)
- Participant → Dashboard: prepares (evidence: `README.md`)
- Dashboard → Session and profile storage: reads data (evidence: `src/app/(app)/dashboard/page.tsx`)
- Participant → Scenario catalog: chooses scenario (evidence: `README.md`)
- Scenario catalog → Scenario definitions: uses scenarios
- Participant → Scenario setup: sets context (evidence: `README.md`)
- Scenario setup → Rehearsal room: begins practice
- Rehearsal room → Scenario definitions: loads scenario (evidence: `src/components/rehevo/rehearsal-room-client.tsx`)
- Rehearsal room → Browser-side storage access: updates session (evidence: `src/components/rehevo/rehearsal-room-client.tsx`)
- Rehearsal room → AI turn endpoint: requests AI turn
- AI turn endpoint → AI generation and evaluation: generates and evaluates (evidence: `src/app/api/ai/turn/route.ts`)
- AI generation and evaluation → OpenAI: requests completions (evidence: `src/lib/ai/openai-engine.ts`)
- AI generation and evaluation → Mock responses and evaluation: falls back to (evidence: `src/lib/ai/openai-engine.ts`)
- Rehearsal room → Mock responses and evaluation: gets fallback turns (evidence: `src/components/rehevo/rehearsal-room-client.tsx`)
- Participant → Sessions and attempts: reviews attempts (evidence: `README.md`)
- Participant → Reflection and moments: reflects on moments (evidence: `README.md`)
- Reflection and moments → Targeted practice: repeats weak moments
- Participant → Reports: views progress (evidence: `README.md`)
- Participant → Account preferences: manages preferences (evidence: `src/components/rehevo/settings-page-client.tsx`)
- Browser-side storage access → Supabase: connects to
- Session and profile storage → Supabase: connects to
