# ken-muritu/rewind architecture

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

- Interactive diagram: https://gitdiagram.com/ken-muritu/rewind
- Repository: https://github.com/ken-muritu/rewind

## Overview

Rewind is a personal-growth web app whose main journey is guided reflection, a shareable Wrapped summary, and an AI-generated Blueprint with ongoing goals and supporting tools. The frontend uses a compatibility client to reach authenticated serverless APIs backed by Turso. The graph includes documented profile, streak, landing-page, and Blueprint capabilities; several frontend pages and integrations are represented from the README and source index rather than inspected implementation excerpts.

Main entry points: [`src/pages/Blueprint.tsx`](https://github.com/ken-muritu/rewind/blob/main/src/pages/Blueprint.tsx) (Blueprint Workspace), [`src/components/AnimatedRoutes.tsx`](https://github.com/ken-muritu/rewind/blob/main/src/components/AnimatedRoutes.tsx) (App Routes), [`src/lib/api-client.ts`](https://github.com/ken-muritu/rewind/blob/main/src/lib/api-client.ts) (API Compatibility Client), [`src/hooks/useBlueprint.ts`](https://github.com/ken-muritu/rewind/blob/main/src/hooks/useBlueprint.ts) (Blueprint State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["Reflection and Wrapped"]
  node_reflectpage["Reflection Journey<br/>[Reflect.tsx]"]
  node_questions["Question Set<br/>[questions.ts]"]
  node_reflectionstate["Reflection State<br/>[useReflection.ts]"]
  node_wrappedpage["Wrapped Viewer<br/>[Wrapped.tsx]"]
  node_wrappedcards["Summary Cards<br/>[WrappedCard.tsx]"]
  node_cardexport["Card Export<br/>[cardExport.ts]"]
end

subgraph group_blueprint["Blueprint and Goals"]
  node_blueprintpage["Blueprint Workspace<br/>[Blueprint.tsx]"]
  node_blueprintstate["Blueprint State<br/>[useBlueprint.ts]"]
  node_blueprintcontent["Plan Content"]
  node_goals["Goal Management<br/>[BlueprintGoals.tsx]"]
  node_notes["Blueprint Notes<br/>[BlueprintNotes.tsx]"]
  node_reminders["Reminder Settings"]
  node_history["Blueprint History"]
  node_compare["Blueprint Compare"]
  node_emailview["Email Blueprint<br/>[EmailBlueprint.tsx]"]
  node_share["Share Blueprint<br/>[ShareBlueprint.tsx]"]
end

subgraph group_account["Account and Experience"]
  node_routes["App Routes<br/>[AnimatedRoutes.tsx]"]
  node_landing["Landing Page<br/>[Index.tsx]"]
  node_authpage["Sign In / Up<br/>[Auth.tsx]"]
  node_dashboard["Profile Dashboard<br/>[Dashboard.tsx]"]
  node_profile["Profile Settings"]
  node_streak["Streak Tracking<br/>[useStreak.ts]"]
end

subgraph group_backend["API and Persistence"]
  node_client["API Compatibility Client<br/>[api-client.ts]"]
  node_supabasealias["Client Alias<br/>[client.ts]"]
  node_authapi["Auth API<br/>[login.ts]"]
  node_dataapi["User Data API<br/>[&#91;table&#93;.ts]"]
  node_generateapi["Blueprint Generator API"]
  node_emailapi["Blueprint Email API"]
  node_apiauth["Token and Password Auth<br/>[auth.ts]"]
  node_dbclient["Database Connector<br/>[db.ts]"]
  node_turso[("Turso Database")]
end

node_visitor(("Visitor"))
node_ai{{"Lovable AI Gateway"}}
node_resend{{"Resend Email"}}

node_visitor -->|"opens app"| node_routes
node_routes -->|"routes to"| node_landing
node_routes -->|"routes to"| node_authpage
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_reflectpage
node_routes -->|"routes to"| node_wrappedpage
node_routes -->|"routes to"| node_blueprintpage
node_authpage -->|"authenticates via"| node_supabasealias
node_supabasealias -->|"re-exports"| node_client
node_client -->|"requests auth"| node_authapi
node_client -->|"requests data"| node_dataapi
node_dashboard -.->|"offers settings"| node_profile
node_dashboard -.->|"tracks streak"| node_streak
node_reflectpage -.->|"uses reflection state"| node_reflectionstate
node_reflectionstate -->|"loads questions"| node_questions
node_reflectionstate -->|"persists answers"| node_client
node_reflectpage -.->|"continues journey"| node_wrappedpage
node_wrappedpage -.->|"shows cards"| node_wrappedcards
node_wrappedpage -.->|"exports images"| node_cardexport
node_blueprintpage -->|"uses blueprint state"| node_blueprintstate
node_blueprintstate -->|"loads and saves"| node_client
node_blueprintstate -->|"uses question data"| node_questions
node_blueprintstate -->|"requests generation"| node_generateapi
node_blueprintstate -.->|"provides plan"| node_blueprintcontent
node_blueprintpage -->|"renders goals"| node_goals
node_blueprintpage -->|"renders notes"| node_notes
node_blueprintpage -->|"renders reminders"| node_reminders
node_blueprintpage -->|"renders history"| node_history
node_blueprintpage -->|"renders comparisons"| node_compare
node_blueprintpage -->|"renders email tool"| node_emailview
node_blueprintpage -->|"renders sharing"| node_share
node_emailview -.->|"invokes email API"| node_client
node_client -->|"requests email"| node_emailapi
node_authapi -->|"uses token auth"| node_apiauth
node_dataapi -->|"requires user"| node_apiauth
node_generateapi -->|"requires user"| node_apiauth
node_emailapi -->|"requires user"| node_apiauth
node_authapi -->|"reads and writes"| node_dbclient
node_dataapi -->|"queries rows"| node_dbclient
node_emailapi -->|"loads blueprint"| node_dbclient
node_dbclient -.->|"connects"| node_turso
node_generateapi -.->|"generates plan"| node_ai
node_emailapi -.->|"sends email"| node_resend

click node_routes "https://github.com/ken-muritu/rewind/blob/main/src/components/AnimatedRoutes.tsx"
click node_landing "https://github.com/ken-muritu/rewind/blob/main/src/pages/Index.tsx"
click node_authpage "https://github.com/ken-muritu/rewind/blob/main/src/pages/Auth.tsx"
click node_dashboard "https://github.com/ken-muritu/rewind/blob/main/src/pages/Dashboard.tsx"
click node_profile "https://github.com/ken-muritu/rewind/blob/main/src/components/dashboard/ProfileSettings.tsx"
click node_streak "https://github.com/ken-muritu/rewind/blob/main/src/hooks/useStreak.ts"
click node_reflectpage "https://github.com/ken-muritu/rewind/blob/main/src/pages/Reflect.tsx"
click node_questions "https://github.com/ken-muritu/rewind/blob/main/src/data/questions.ts"
click node_reflectionstate "https://github.com/ken-muritu/rewind/blob/main/src/hooks/useReflection.ts"
click node_wrappedpage "https://github.com/ken-muritu/rewind/blob/main/src/pages/Wrapped.tsx"
click node_wrappedcards "https://github.com/ken-muritu/rewind/blob/main/src/components/wrapped/WrappedCard.tsx"
click node_cardexport "https://github.com/ken-muritu/rewind/blob/main/src/lib/cardExport.ts"
click node_blueprintpage "https://github.com/ken-muritu/rewind/blob/main/src/pages/Blueprint.tsx"
click node_blueprintstate "https://github.com/ken-muritu/rewind/blob/main/src/hooks/useBlueprint.ts"
click node_blueprintcontent "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintContent.tsx"
click node_goals "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintGoals.tsx"
click node_notes "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintNotes.tsx"
click node_reminders "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintReminders.tsx"
click node_history "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintHistory.tsx"
click node_compare "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintCompare.tsx"
click node_emailview "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/EmailBlueprint.tsx"
click node_share "https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/ShareBlueprint.tsx"
click node_client "https://github.com/ken-muritu/rewind/blob/main/src/lib/api-client.ts"
click node_supabasealias "https://github.com/ken-muritu/rewind/blob/main/src/integrations/supabase/client.ts"
click node_authapi "https://github.com/ken-muritu/rewind/blob/main/api/auth/login.ts"
click node_dataapi "https://github.com/ken-muritu/rewind/blob/main/api/data/%5Btable%5D.ts"
click node_generateapi "https://github.com/ken-muritu/rewind/blob/main/api/generate-blueprint.ts"
click node_emailapi "https://github.com/ken-muritu/rewind/blob/main/api/send-blueprint-email.ts"
click node_apiauth "https://github.com/ken-muritu/rewind/blob/main/api/lib/auth.ts"
click node_dbclient "https://github.com/ken-muritu/rewind/blob/main/api/lib/db.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_reflectpage,node_questions,node_reflectionstate,node_wrappedpage,node_wrappedcards,node_cardexport toneBlue
class node_blueprintpage,node_blueprintstate,node_blueprintcontent,node_goals,node_notes,node_reminders,node_history,node_compare,node_emailview,node_share toneAmber
class node_routes,node_landing,node_authpage,node_dashboard,node_profile,node_streak toneMint
class node_client,node_supabasealias,node_authapi,node_dataapi,node_generateapi,node_emailapi,node_apiauth,node_dbclient,node_turso toneRose
class node_visitor,node_ai,node_resend toneIndigo
```

## Components

### Reflection and Wrapped

- [Reflection Journey](https://github.com/ken-muritu/rewind/blob/main/src/pages/Reflect.tsx): `src/pages/Reflect.tsx`
- [Question Set](https://github.com/ken-muritu/rewind/blob/main/src/data/questions.ts): `src/data/questions.ts`
- [Reflection State](https://github.com/ken-muritu/rewind/blob/main/src/hooks/useReflection.ts): `src/hooks/useReflection.ts`
- [Wrapped Viewer](https://github.com/ken-muritu/rewind/blob/main/src/pages/Wrapped.tsx): `src/pages/Wrapped.tsx`
- [Summary Cards](https://github.com/ken-muritu/rewind/blob/main/src/components/wrapped/WrappedCard.tsx): `src/components/wrapped/WrappedCard.tsx`
- [Card Export](https://github.com/ken-muritu/rewind/blob/main/src/lib/cardExport.ts): `src/lib/cardExport.ts`

### Blueprint and Goals

- [Blueprint Workspace](https://github.com/ken-muritu/rewind/blob/main/src/pages/Blueprint.tsx): `src/pages/Blueprint.tsx`
- [Blueprint State](https://github.com/ken-muritu/rewind/blob/main/src/hooks/useBlueprint.ts): `src/hooks/useBlueprint.ts`
- [Plan Content](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintContent.tsx): `src/components/blueprint/BlueprintContent.tsx`
- [Goal Management](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintGoals.tsx): `src/components/blueprint/BlueprintGoals.tsx`
- [Blueprint Notes](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintNotes.tsx): `src/components/blueprint/BlueprintNotes.tsx`
- [Reminder Settings](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintReminders.tsx): `src/components/blueprint/BlueprintReminders.tsx`
- [Blueprint History](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintHistory.tsx): `src/components/blueprint/BlueprintHistory.tsx`
- [Blueprint Compare](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/BlueprintCompare.tsx): `src/components/blueprint/BlueprintCompare.tsx`
- [Email Blueprint](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/EmailBlueprint.tsx): `src/components/blueprint/EmailBlueprint.tsx`
- [Share Blueprint](https://github.com/ken-muritu/rewind/blob/main/src/components/blueprint/ShareBlueprint.tsx): `src/components/blueprint/ShareBlueprint.tsx`

### Account and Experience

- [App Routes](https://github.com/ken-muritu/rewind/blob/main/src/components/AnimatedRoutes.tsx): `src/components/AnimatedRoutes.tsx`
- [Landing Page](https://github.com/ken-muritu/rewind/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Sign In / Up](https://github.com/ken-muritu/rewind/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Profile Dashboard](https://github.com/ken-muritu/rewind/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Profile Settings](https://github.com/ken-muritu/rewind/blob/main/src/components/dashboard/ProfileSettings.tsx): `src/components/dashboard/ProfileSettings.tsx`
- [Streak Tracking](https://github.com/ken-muritu/rewind/blob/main/src/hooks/useStreak.ts): `src/hooks/useStreak.ts`

### API and Persistence

- [API Compatibility Client](https://github.com/ken-muritu/rewind/blob/main/src/lib/api-client.ts): `src/lib/api-client.ts`
- [Client Alias](https://github.com/ken-muritu/rewind/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Auth API](https://github.com/ken-muritu/rewind/blob/main/api/auth/login.ts): `api/auth/login.ts`
- [User Data API](https://github.com/ken-muritu/rewind/blob/main/api/data/%5Btable%5D.ts): `api/data/[table].ts`
- [Blueprint Generator API](https://github.com/ken-muritu/rewind/blob/main/api/generate-blueprint.ts): `api/generate-blueprint.ts`
- [Blueprint Email API](https://github.com/ken-muritu/rewind/blob/main/api/send-blueprint-email.ts): `api/send-blueprint-email.ts`
- [Token and Password Auth](https://github.com/ken-muritu/rewind/blob/main/api/lib/auth.ts): `api/lib/auth.ts`
- [Database Connector](https://github.com/ken-muritu/rewind/blob/main/api/lib/db.ts): `api/lib/db.ts`
- **Turso Database**

### Other components

- **Visitor**
- **Lovable AI Gateway**
- **Resend Email**

## Connections

- Visitor → App Routes: opens app (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Landing Page: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Sign In / Up: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Profile Dashboard: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Reflection Journey: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Wrapped Viewer: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- App Routes → Blueprint Workspace: routes to (evidence: `src/components/AnimatedRoutes.tsx`)
- Sign In / Up → Client Alias: authenticates via (evidence: `src/pages/Auth.tsx`)
- Client Alias → API Compatibility Client: re-exports (evidence: `src/integrations/supabase/client.ts`)
- API Compatibility Client → Auth API: requests auth (evidence: `src/lib/api-client.ts`)
- API Compatibility Client → User Data API: requests data (evidence: `src/lib/api-client.ts`)
- Profile Dashboard → Profile Settings: offers settings
- Profile Dashboard → Streak Tracking: tracks streak
- Reflection Journey → Reflection State: uses reflection state
- Reflection State → Question Set: loads questions (evidence: `src/hooks/useReflection.ts`)
- Reflection State → API Compatibility Client: persists answers (evidence: `src/hooks/useReflection.ts`)
- Reflection Journey → Wrapped Viewer: continues journey (evidence: `README.md`)
- Wrapped Viewer → Summary Cards: shows cards (evidence: `README.md`)
- Wrapped Viewer → Card Export: exports images (evidence: `README.md`)
- Blueprint Workspace → Blueprint State: uses blueprint state (evidence: `src/pages/Blueprint.tsx`)
- Blueprint State → API Compatibility Client: loads and saves (evidence: `src/hooks/useBlueprint.ts`)
- Blueprint State → Question Set: uses question data (evidence: `src/hooks/useBlueprint.ts`)
- Blueprint State → Blueprint Generator API: requests generation (evidence: `README.md`)
- Blueprint State → Plan Content: provides plan
- Blueprint Workspace → Goal Management: renders goals (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Blueprint Notes: renders notes (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Reminder Settings: renders reminders (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Blueprint History: renders history (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Blueprint Compare: renders comparisons (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Email Blueprint: renders email tool (evidence: `src/pages/Blueprint.tsx`)
- Blueprint Workspace → Share Blueprint: renders sharing (evidence: `src/pages/Blueprint.tsx`)
- Email Blueprint → API Compatibility Client: invokes email API
- API Compatibility Client → Blueprint Email API: requests email (evidence: `src/lib/api-client.ts`)
- Auth API → Token and Password Auth: uses token auth
- User Data API → Token and Password Auth: requires user (evidence: `api/data/[table].ts`)
- Blueprint Generator API → Token and Password Auth: requires user (evidence: `api/generate-blueprint.ts`)
- Blueprint Email API → Token and Password Auth: requires user (evidence: `api/send-blueprint-email.ts`)
- Auth API → Database Connector: reads and writes
- User Data API → Database Connector: queries rows (evidence: `api/data/[table].ts`)
- Blueprint Email API → Database Connector: loads blueprint (evidence: `api/send-blueprint-email.ts`)
- Database Connector → Turso Database: connects
- Blueprint Generator API → Lovable AI Gateway: generates plan (evidence: `README.md`)
- Blueprint Email API → Resend Email: sends email (evidence: `README.md`)
