# topalmahmutali/passe-simple architecture

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

- Interactive diagram: https://gitdiagram.com/topalmahmutali/passe-simple
- Repository: https://github.com/topalmahmutali/passe-simple

## Overview

Passé Simple is a mobile history-learning app for short lessons, favorites, and mini-quizzes. A learner signs in, discovers chapters, opens a chapter’s lesson list, reads a lesson, and can favorite it or take its quiz; quiz results can update saved progress. The README also documents favorites, progress, account settings, and an optional local daily reminder. Sampled screens show direct Supabase queries and quiz logic; other feature relationships rely on README documentation, so unsampled implementation details are not inferred.

Main entry points: [`lib/supabase.ts`](https://github.com/topalmahmutali/passe-simple/blob/main/lib/supabase.ts) (Supabase client), [`app/(private)/chapter/[id].tsx`](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/chapter/%5Bid%5D.tsx) (Chapter lessons), [`app/(private)/lesson/[id].tsx`](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/lesson/%5Bid%5D.tsx) (Lesson reader), [`app/(private)/quiz/[lessonId].tsx`](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/quiz/%5BlessonId%5D.tsx) (Mini-quiz)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App and access"]
  node_root["Root navigation<br/>[_layout.tsx]"]
  node_auth["Sign in / sign up<br/>[index.tsx]"]
  node_session["Session context<br/>[auth-context.tsx]"]
  node_private["Private routes<br/>[_layout.tsx]"]
end

subgraph group_learning["Learning content"]
  node_discover["Discover chapters<br/>[index.tsx]"]
  node_chapter["Chapter lessons<br/>[&#91;id&#93;.tsx]"]
  node_lesson["Lesson reader<br/>[&#91;id&#93;.tsx]"]
end

subgraph group_study["Study and progress"]
  node_quiz["Mini-quiz<br/>[&#91;lessonId&#93;.tsx]"]
  node_quizlogic["Quiz scoring<br/>[quiz.ts]"]
  node_favorites["Favorites screen<br/>[favorites.tsx]"]
  node_progress["Progress screen<br/>[progress.tsx]"]
  node_account["Account settings<br/>[account.tsx]"]
end

subgraph group_services["Data and reminders"]
  node_client["Supabase client<br/>[supabase.ts]"]
  node_backend[("Supabase")]
  node_schema["Content and user schema<br/>[schema.sql]"]
  node_localstore[("Local preferences")]
  node_notifications["Local notifications"]
end

node_learner(("Learner"))

node_learner -->|"signs in"| node_auth
node_learner -->|"opens app"| node_discover
node_root -->|"provides session"| node_session
node_root -->|"guards routes"| node_private
node_auth -->|"authenticates"| node_client
node_session -->|"restores session"| node_client
node_client -->|"connects to"| node_backend
node_discover -->|"loads chapters"| node_client
node_discover -->|"opens chapter"| node_chapter
node_chapter -->|"loads lessons"| node_client
node_chapter -->|"opens lesson"| node_lesson
node_lesson -->|"loads lesson"| node_client
node_lesson -->|"starts quiz"| node_quiz
node_quiz -->|"loads questions"| node_client
node_quiz -->|"checks answers"| node_quizlogic
node_quiz -->|"saves score"| node_backend
node_learner -->|"views favorites"| node_favorites
node_favorites -->|"reads favorites"| node_backend
node_chapter -->|"updates favorites"| node_backend
node_lesson -->|"updates favorites"| node_backend
node_learner -->|"checks progress"| node_progress
node_progress -->|"reads progress"| node_backend
node_learner -->|"manages settings"| node_account
node_account -->|"stores reminder settings"| node_localstore
node_account -->|"schedules reminder"| node_notifications
node_schema -->|"defines tables"| node_backend

click node_root "https://github.com/topalmahmutali/passe-simple/blob/main/app/_layout.tsx"
click node_auth "https://github.com/topalmahmutali/passe-simple/blob/main/app/(public)/auth/index.tsx"
click node_session "https://github.com/topalmahmutali/passe-simple/blob/main/contexts/auth-context.tsx"
click node_private "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/_layout.tsx"
click node_discover "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/index.tsx"
click node_chapter "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/chapter/%5Bid%5D.tsx"
click node_lesson "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/lesson/%5Bid%5D.tsx"
click node_quiz "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/quiz/%5BlessonId%5D.tsx"
click node_quizlogic "https://github.com/topalmahmutali/passe-simple/blob/main/lib/quiz.ts"
click node_favorites "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/favorites.tsx"
click node_progress "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/progress.tsx"
click node_account "https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/account.tsx"
click node_client "https://github.com/topalmahmutali/passe-simple/blob/main/lib/supabase.ts"
click node_schema "https://github.com/topalmahmutali/passe-simple/blob/main/supabase/schema.sql"

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_root,node_auth,node_session,node_private toneBlue
class node_discover,node_chapter,node_lesson toneAmber
class node_quiz,node_quizlogic,node_favorites,node_progress,node_account toneMint
class node_client,node_backend,node_schema,node_localstore,node_notifications toneRose
class node_learner toneIndigo
```

## Components

### App and access

- [Root navigation](https://github.com/topalmahmutali/passe-simple/blob/main/app/_layout.tsx): `app/_layout.tsx`
- [Sign in / sign up](https://github.com/topalmahmutali/passe-simple/blob/main/app/(public)/auth/index.tsx): `app/(public)/auth/index.tsx`
- [Session context](https://github.com/topalmahmutali/passe-simple/blob/main/contexts/auth-context.tsx): `contexts/auth-context.tsx`
- [Private routes](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/_layout.tsx): `app/(private)/_layout.tsx`

### Learning content

- [Discover chapters](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/index.tsx): `app/(private)/(tabs)/index.tsx`
- [Chapter lessons](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/chapter/%5Bid%5D.tsx): `app/(private)/chapter/[id].tsx`
- [Lesson reader](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/lesson/%5Bid%5D.tsx): `app/(private)/lesson/[id].tsx`

### Study and progress

- [Mini-quiz](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/quiz/%5BlessonId%5D.tsx): `app/(private)/quiz/[lessonId].tsx`
- [Quiz scoring](https://github.com/topalmahmutali/passe-simple/blob/main/lib/quiz.ts): `lib/quiz.ts`
- [Favorites screen](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/favorites.tsx): `app/(private)/(tabs)/favorites.tsx`
- [Progress screen](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/progress.tsx): `app/(private)/(tabs)/progress.tsx`
- [Account settings](https://github.com/topalmahmutali/passe-simple/blob/main/app/(private)/(tabs)/account.tsx): `app/(private)/(tabs)/account.tsx`

### Data and reminders

- [Supabase client](https://github.com/topalmahmutali/passe-simple/blob/main/lib/supabase.ts): `lib/supabase.ts`
- **Supabase**
- [Content and user schema](https://github.com/topalmahmutali/passe-simple/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Local preferences**
- **Local notifications**

### Other components

- **Learner**

## Connections

- Learner → Sign in / sign up: signs in (evidence: `README.md`)
- Learner → Discover chapters: opens app (evidence: `README.md`)
- Root navigation → Session context: provides session (evidence: `app/_layout.tsx`)
- Root navigation → Private routes: guards routes (evidence: `app/_layout.tsx`)
- Sign in / sign up → Supabase client: authenticates (evidence: `app/(public)/auth/index.tsx`)
- Session context → Supabase client: restores session (evidence: `contexts/auth-context.tsx`)
- Supabase client → Supabase: connects to (evidence: `lib/supabase.ts`)
- Discover chapters → Supabase client: loads chapters (evidence: `app/(private)/(tabs)/index.tsx`)
- Discover chapters → Chapter lessons: opens chapter (evidence: `README.md`)
- Chapter lessons → Supabase client: loads lessons (evidence: `app/(private)/chapter/[id].tsx`)
- Chapter lessons → Lesson reader: opens lesson (evidence: `app/(private)/chapter/[id].tsx`)
- Lesson reader → Supabase client: loads lesson (evidence: `app/(private)/lesson/[id].tsx`)
- Lesson reader → Mini-quiz: starts quiz (evidence: `app/(private)/lesson/[id].tsx`)
- Mini-quiz → Supabase client: loads questions (evidence: `app/(private)/quiz/[lessonId].tsx`)
- Mini-quiz → Quiz scoring: checks answers (evidence: `app/(private)/quiz/[lessonId].tsx`)
- Mini-quiz → Supabase: saves score (evidence: `README.md`)
- Learner → Favorites screen: views favorites (evidence: `README.md`)
- Favorites screen → Supabase: reads favorites (evidence: `README.md`)
- Chapter lessons → Supabase: updates favorites (evidence: `app/(private)/chapter/[id].tsx`)
- Lesson reader → Supabase: updates favorites (evidence: `app/(private)/lesson/[id].tsx`)
- Learner → Progress screen: checks progress (evidence: `README.md`)
- Progress screen → Supabase: reads progress (evidence: `README.md`)
- Learner → Account settings: manages settings (evidence: `README.md`)
- Account settings → Local preferences: stores reminder settings (evidence: `README.md`)
- Account settings → Local notifications: schedules reminder (evidence: `README.md`)
- Content and user schema → Supabase: defines tables (evidence: `README.md`)
