# christina1507/prepforge architecture

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

- Interactive diagram: https://gitdiagram.com/christina1507/prepforge
- Repository: https://github.com/christina1507/prepforge

## Overview

PrepForge is a student interview-preparation app. Students sign in, choose preparation tools, and use them to track practice, applications, and study progress; the dashboard and AI study coach support planning and review. The frontend calls a server API, which handles authentication and feature data using SQLite and can request generated study plans. The README is empty, so capabilities are inferred from the navigation and component names. Some view-to-route mappings and backend feature implementations were not shown; uncertain links are omitted.

Main entry points: [`src/services/api.ts`](https://github.com/christina1507/prepforge/blob/main/src/services/api.ts) (API client), [`src/App.tsx`](https://github.com/christina1507/prepforge/blob/main/src/App.tsx) (App shell), [`server/routes/api.ts`](https://github.com/christina1507/prepforge/blob/main/server/routes/api.ts) (API routes), [`server.ts`](https://github.com/christina1507/prepforge/blob/main/server.ts) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Student app"]
  node_app["App shell<br/>[App.tsx]"]
  node_authui["Sign-in UI<br/>[AuthModal.tsx]"]
  node_authctx["Session state<br/>[AuthContext.tsx]"]
  node_nav["Navigation<br/>[Sidebar.tsx]"]
end

subgraph group_prep["Preparation tools"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_dsa["DSA practice"]
  node_corecs["Core CS<br/>[CoreCSView.tsx]"]
  node_aptitude["Aptitude practice<br/>[AptitudeView.tsx]"]
  node_sql["SQL practice"]
  node_interview["Interview prep"]
  node_resources["Resource library"]
  node_mistakes["Mistake book"]
end

subgraph group_growth["Planning and growth"]
  node_today["Daily preparation<br/>[TodayPrepView.tsx]"]
  node_revision["Revision queue"]
  node_habits["Habit tracking"]
  node_analytics["Analytics<br/>[AnalyticsView.tsx]"]
  node_companies["Company tracking"]
  node_projects["Project tracking"]
  node_aicoach["AI study coach<br/>[AICoachView.tsx]"]
end

subgraph group_backend["Server and persistence"]
  node_api["API client<br/>[api.ts]"]
  node_server["HTTP server<br/>[server.ts]"]
  node_routes["API routes<br/>[api.ts]"]
  node_auth["Auth middleware<br/>[auth.ts]"]
  node_gemini["Study-plan generation<br/>[gemini.ts]"]
  node_db["Database access<br/>[db.ts]"]
  node_sqlite[("SQLite database<br/>[prepforge.sqlite]")]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"renders"| node_nav
node_app -->|"provides session"| node_authctx
node_app -->|"selects view"| node_dashboard
node_app -->|"selects view"| node_dsa
node_app -->|"selects view"| node_corecs
node_app -->|"selects view"| node_aptitude
node_app -->|"selects view"| node_sql
node_app -->|"renders"| node_authui
node_authui -->|"calls sign-in"| node_authctx
node_authctx -->|"requests session"| node_api
node_server -->|"initializes"| node_db
node_server -->|"seeds demo user"| node_auth
node_server -->|"mounts API"| node_routes
node_routes -->|"reads and writes"| node_db
node_routes -->|"uses token generation"| node_auth
node_routes -->|"generates plans"| node_gemini
node_db -->|"persists data"| node_sqlite
node_dashboard -->|"fetches data"| node_api
node_dsa -->|"fetches data"| node_api
node_corecs -->|"fetches data"| node_api
node_aptitude -->|"fetches data"| node_api
node_sql -->|"fetches data"| node_api
node_interview -->|"fetches data"| node_api
node_resources -->|"fetches data"| node_api
node_mistakes -->|"fetches data"| node_api
node_today -->|"fetches data"| node_api
node_revision -->|"fetches data"| node_api
node_habits -->|"fetches data"| node_api
node_analytics -->|"fetches data"| node_api
node_companies -->|"fetches data"| node_api
node_projects -->|"fetches data"| node_api
node_aicoach -->|"fetches data"| node_api

click node_app "https://github.com/christina1507/prepforge/blob/main/src/App.tsx"
click node_authui "https://github.com/christina1507/prepforge/blob/main/src/components/auth/AuthModal.tsx"
click node_authctx "https://github.com/christina1507/prepforge/blob/main/src/context/AuthContext.tsx"
click node_nav "https://github.com/christina1507/prepforge/blob/main/src/components/layout/Sidebar.tsx"
click node_dashboard "https://github.com/christina1507/prepforge/blob/main/src/components/dashboard/DashboardView.tsx"
click node_dsa "https://github.com/christina1507/prepforge/blob/main/src/components/dsa/DSADashboardView.tsx"
click node_corecs "https://github.com/christina1507/prepforge/blob/main/src/components/corecs/CoreCSView.tsx"
click node_aptitude "https://github.com/christina1507/prepforge/blob/main/src/components/aptitude/AptitudeView.tsx"
click node_sql "https://github.com/christina1507/prepforge/blob/main/src/components/sql/SQLPracticeView.tsx"
click node_interview "https://github.com/christina1507/prepforge/blob/main/src/components/interview/InterviewPrepView.tsx"
click node_resources "https://github.com/christina1507/prepforge/blob/main/src/components/resources/ResourceLibraryView.tsx"
click node_mistakes "https://github.com/christina1507/prepforge/blob/main/src/components/mistakes/MistakeBookView.tsx"
click node_today "https://github.com/christina1507/prepforge/blob/main/src/components/today/TodayPrepView.tsx"
click node_revision "https://github.com/christina1507/prepforge/blob/main/src/components/revision/RevisionQueueView.tsx"
click node_habits "https://github.com/christina1507/prepforge/blob/main/src/components/habits/HabitTrackerView.tsx"
click node_analytics "https://github.com/christina1507/prepforge/blob/main/src/components/analytics/AnalyticsView.tsx"
click node_companies "https://github.com/christina1507/prepforge/blob/main/src/components/companies/CompanyTrackerView.tsx"
click node_projects "https://github.com/christina1507/prepforge/blob/main/src/components/projects/ProjectTrackerView.tsx"
click node_aicoach "https://github.com/christina1507/prepforge/blob/main/src/components/aicoach/AICoachView.tsx"
click node_api "https://github.com/christina1507/prepforge/blob/main/src/services/api.ts"
click node_server "https://github.com/christina1507/prepforge/blob/main/server.ts"
click node_routes "https://github.com/christina1507/prepforge/blob/main/server/routes/api.ts"
click node_auth "https://github.com/christina1507/prepforge/blob/main/server/auth.ts"
click node_gemini "https://github.com/christina1507/prepforge/blob/main/server/gemini.ts"
click node_db "https://github.com/christina1507/prepforge/blob/main/server/db.ts"
click node_sqlite "https://github.com/christina1507/prepforge/blob/main/data/prepforge.sqlite"

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_app,node_authui,node_authctx,node_nav toneBlue
class node_dashboard,node_dsa,node_corecs,node_aptitude,node_sql,node_interview,node_resources,node_mistakes toneAmber
class node_today,node_revision,node_habits,node_analytics,node_companies,node_projects,node_aicoach toneMint
class node_api,node_server,node_routes,node_auth,node_gemini,node_db,node_sqlite toneRose
class node_student toneIndigo
```

## Components

### Student app

- [App shell](https://github.com/christina1507/prepforge/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in UI](https://github.com/christina1507/prepforge/blob/main/src/components/auth/AuthModal.tsx): `src/components/auth/AuthModal.tsx`
- [Session state](https://github.com/christina1507/prepforge/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Navigation](https://github.com/christina1507/prepforge/blob/main/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`

### Preparation tools

- [Dashboard](https://github.com/christina1507/prepforge/blob/main/src/components/dashboard/DashboardView.tsx): `src/components/dashboard/DashboardView.tsx`
- [DSA practice](https://github.com/christina1507/prepforge/blob/main/src/components/dsa/DSADashboardView.tsx): `src/components/dsa/DSADashboardView.tsx`
- [Core CS](https://github.com/christina1507/prepforge/blob/main/src/components/corecs/CoreCSView.tsx): `src/components/corecs/CoreCSView.tsx`
- [Aptitude practice](https://github.com/christina1507/prepforge/blob/main/src/components/aptitude/AptitudeView.tsx): `src/components/aptitude/AptitudeView.tsx`
- [SQL practice](https://github.com/christina1507/prepforge/blob/main/src/components/sql/SQLPracticeView.tsx): `src/components/sql/SQLPracticeView.tsx`
- [Interview prep](https://github.com/christina1507/prepforge/blob/main/src/components/interview/InterviewPrepView.tsx): `src/components/interview/InterviewPrepView.tsx`
- [Resource library](https://github.com/christina1507/prepforge/blob/main/src/components/resources/ResourceLibraryView.tsx): `src/components/resources/ResourceLibraryView.tsx`
- [Mistake book](https://github.com/christina1507/prepforge/blob/main/src/components/mistakes/MistakeBookView.tsx): `src/components/mistakes/MistakeBookView.tsx`

### Planning and growth

- [Daily preparation](https://github.com/christina1507/prepforge/blob/main/src/components/today/TodayPrepView.tsx): `src/components/today/TodayPrepView.tsx`
- [Revision queue](https://github.com/christina1507/prepforge/blob/main/src/components/revision/RevisionQueueView.tsx): `src/components/revision/RevisionQueueView.tsx`
- [Habit tracking](https://github.com/christina1507/prepforge/blob/main/src/components/habits/HabitTrackerView.tsx): `src/components/habits/HabitTrackerView.tsx`
- [Analytics](https://github.com/christina1507/prepforge/blob/main/src/components/analytics/AnalyticsView.tsx): `src/components/analytics/AnalyticsView.tsx`
- [Company tracking](https://github.com/christina1507/prepforge/blob/main/src/components/companies/CompanyTrackerView.tsx): `src/components/companies/CompanyTrackerView.tsx`
- [Project tracking](https://github.com/christina1507/prepforge/blob/main/src/components/projects/ProjectTrackerView.tsx): `src/components/projects/ProjectTrackerView.tsx`
- [AI study coach](https://github.com/christina1507/prepforge/blob/main/src/components/aicoach/AICoachView.tsx): `src/components/aicoach/AICoachView.tsx`

### Server and persistence

- [API client](https://github.com/christina1507/prepforge/blob/main/src/services/api.ts): `src/services/api.ts`
- [HTTP server](https://github.com/christina1507/prepforge/blob/main/server.ts): `server.ts`
- [API routes](https://github.com/christina1507/prepforge/blob/main/server/routes/api.ts): `server/routes/api.ts`
- [Auth middleware](https://github.com/christina1507/prepforge/blob/main/server/auth.ts): `server/auth.ts`
- [Study-plan generation](https://github.com/christina1507/prepforge/blob/main/server/gemini.ts): `server/gemini.ts`
- [Database access](https://github.com/christina1507/prepforge/blob/main/server/db.ts): `server/db.ts`
- [SQLite database](https://github.com/christina1507/prepforge/blob/main/data/prepforge.sqlite): `data/prepforge.sqlite`

### Other components

- **Student**

## Connections

- Student → App shell: uses
- App shell → Navigation: renders (evidence: `src/App.tsx`)
- App shell → Session state: provides session (evidence: `src/App.tsx`)
- App shell → Dashboard: selects view (evidence: `src/App.tsx`)
- App shell → DSA practice: selects view (evidence: `src/App.tsx`)
- App shell → Core CS: selects view (evidence: `src/App.tsx`)
- App shell → Aptitude practice: selects view (evidence: `src/App.tsx`)
- App shell → SQL practice: selects view (evidence: `src/App.tsx`)
- App shell → Sign-in UI: renders (evidence: `src/App.tsx`)
- Sign-in UI → Session state: calls sign-in (evidence: `src/components/auth/AuthModal.tsx`)
- Session state → API client: requests session (evidence: `src/context/AuthContext.tsx`)
- HTTP server → Database access: initializes (evidence: `server.ts`)
- HTTP server → Auth middleware: seeds demo user (evidence: `server.ts`)
- HTTP server → API routes: mounts API (evidence: `server.ts`)
- API routes → Database access: reads and writes (evidence: `server/routes/api.ts`)
- API routes → Auth middleware: uses token generation (evidence: `server/routes/api.ts`)
- API routes → Study-plan generation: generates plans (evidence: `server/routes/api.ts`)
- Database access → SQLite database: persists data (evidence: `server/db.ts`)
- Dashboard → API client: fetches data (evidence: `src/components/dashboard/DashboardView.tsx`)
- DSA practice → API client: fetches data (evidence: `src/components/dsa/DSADashboardView.tsx`)
- Core CS → API client: fetches data (evidence: `src/components/corecs/CoreCSView.tsx`)
- Aptitude practice → API client: fetches data (evidence: `src/components/aptitude/AptitudeView.tsx`)
- SQL practice → API client: fetches data (evidence: `src/components/sql/SQLPracticeView.tsx`)
- Interview prep → API client: fetches data (evidence: `src/components/interview/InterviewPrepView.tsx`)
- Resource library → API client: fetches data (evidence: `src/components/resources/ResourceLibraryView.tsx`)
- Mistake book → API client: fetches data (evidence: `src/components/mistakes/MistakeBookView.tsx`)
- Daily preparation → API client: fetches data (evidence: `src/components/today/TodayPrepView.tsx`)
- Revision queue → API client: fetches data (evidence: `src/components/revision/RevisionQueueView.tsx`)
- Habit tracking → API client: fetches data (evidence: `src/components/habits/HabitTrackerView.tsx`)
- Analytics → API client: fetches data (evidence: `src/components/analytics/AnalyticsView.tsx`)
- Company tracking → API client: fetches data (evidence: `src/components/companies/CompanyTrackerView.tsx`)
- Project tracking → API client: fetches data (evidence: `src/components/projects/ProjectTrackerView.tsx`)
- AI study coach → API client: fetches data (evidence: `src/components/aicoach/AICoachView.tsx`)
