# hjscodefield/cspreppro architecture

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

- Interactive diagram: https://gitdiagram.com/hjscodefield/cspreppro
- Repository: https://github.com/hjscodefield/cspreppro

## Overview

CS PrepPro is a web app for computer-science interview preparation. Users can explore the home page, study topic modules and take quizzes, or run a protected interview simulation with speech transcription and focus monitoring; the app also presents a dashboard. Authentication is client-side, using local storage. A submission API calculates simulated scores and feedback, but the sampled simulator excerpt does not show it being called. Supabase is mentioned only as a possible future persistence layer in the API. Edges below reflect sampled imports and calls; unsampled wiring is omitted.

Main entry points: [`src/components/ProtectedRoute.tsx`](https://github.com/hjscodefield/cspreppro/blob/main/src/components/ProtectedRoute.tsx) (Route Guard), [`src/components/AuthProvider.tsx`](https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthProvider.tsx) (Auth State), [`src/app/simulator/page.tsx`](https://github.com/hjscodefield/cspreppro/blob/main/src/app/simulator/page.tsx) (Interview Simulator), [`src/components/AuthModal.tsx`](https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthModal.tsx) (Sign-in Modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Preparation Product"]
  node_home["Home Page<br/>[page.tsx]"]
  node_study["Study Hub<br/>[page.tsx]"]
  node_dashboard["Progress Dashboard<br/>[page.tsx]"]
end

subgraph group_identity["Access and Identity"]
  node_auth_provider["Auth State<br/>[AuthProvider.tsx]"]
  node_auth_modal["Sign-in Modal<br/>[AuthModal.tsx]"]
  node_header["Navigation Header<br/>[Header.tsx]"]
  node_route_guard["Route Guard<br/>[ProtectedRoute.tsx]"]
end

subgraph group_interview["Interview Simulation"]
  node_simulator["Interview Simulator<br/>[page.tsx]"]
  node_proctoring["Focus and Media Tracking<br/>[useProctoring.ts]"]
  node_speech["Speech Transcription"]
end

subgraph group_submission["Submission Evaluation"]
  node_submit_api["Submission Scoring API<br/>[route.ts]"]
end

node_visitor(("Visitor"))

node_header -->|"reads auth state"| node_auth_provider
node_header -->|"renders"| node_auth_modal
node_auth_modal -->|"logs in"| node_auth_provider
node_route_guard -->|"checks session"| node_auth_provider
node_route_guard -->|"renders"| node_auth_modal
node_dashboard -->|"guards page"| node_route_guard
node_dashboard -->|"reads user"| node_auth_provider
node_study -->|"guards page"| node_route_guard
node_simulator -->|"guards page"| node_route_guard
node_simulator -->|"tracks focus"| node_proctoring
node_simulator -->|"uses transcription"| node_speech

click node_home "https://github.com/hjscodefield/cspreppro/blob/main/src/app/page.tsx"
click node_study "https://github.com/hjscodefield/cspreppro/blob/main/src/app/learning/page.tsx"
click node_dashboard "https://github.com/hjscodefield/cspreppro/blob/main/src/app/dashboard/page.tsx"
click node_auth_provider "https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthProvider.tsx"
click node_auth_modal "https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthModal.tsx"
click node_header "https://github.com/hjscodefield/cspreppro/blob/main/src/components/Header.tsx"
click node_route_guard "https://github.com/hjscodefield/cspreppro/blob/main/src/components/ProtectedRoute.tsx"
click node_simulator "https://github.com/hjscodefield/cspreppro/blob/main/src/app/simulator/page.tsx"
click node_proctoring "https://github.com/hjscodefield/cspreppro/blob/main/src/hooks/useProctoring.ts"
click node_speech "https://github.com/hjscodefield/cspreppro/blob/main/src/hooks/useSpeechRecognition.ts"
click node_submit_api "https://github.com/hjscodefield/cspreppro/blob/main/src/app/api/interview/submit/route.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_home,node_study,node_dashboard toneBlue
class node_auth_provider,node_auth_modal,node_header,node_route_guard toneAmber
class node_simulator,node_proctoring,node_speech toneMint
class node_submit_api toneRose
class node_visitor toneIndigo
```

## Components

### Preparation Product

- [Home Page](https://github.com/hjscodefield/cspreppro/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Study Hub](https://github.com/hjscodefield/cspreppro/blob/main/src/app/learning/page.tsx): `src/app/learning/page.tsx`
- [Progress Dashboard](https://github.com/hjscodefield/cspreppro/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`

### Access and Identity

- [Auth State](https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthProvider.tsx): `src/components/AuthProvider.tsx`
- [Sign-in Modal](https://github.com/hjscodefield/cspreppro/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Navigation Header](https://github.com/hjscodefield/cspreppro/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Route Guard](https://github.com/hjscodefield/cspreppro/blob/main/src/components/ProtectedRoute.tsx): `src/components/ProtectedRoute.tsx`

### Interview Simulation

- [Interview Simulator](https://github.com/hjscodefield/cspreppro/blob/main/src/app/simulator/page.tsx): `src/app/simulator/page.tsx`
- [Focus and Media Tracking](https://github.com/hjscodefield/cspreppro/blob/main/src/hooks/useProctoring.ts): `src/hooks/useProctoring.ts`
- [Speech Transcription](https://github.com/hjscodefield/cspreppro/blob/main/src/hooks/useSpeechRecognition.ts): `src/hooks/useSpeechRecognition.ts`

### Submission Evaluation

- [Submission Scoring API](https://github.com/hjscodefield/cspreppro/blob/main/src/app/api/interview/submit/route.ts): `src/app/api/interview/submit/route.ts`

### Other components

- **Visitor**

## Connections

- Navigation Header → Auth State: reads auth state (evidence: `src/components/Header.tsx`)
- Navigation Header → Sign-in Modal: renders (evidence: `src/components/Header.tsx`)
- Sign-in Modal → Auth State: logs in (evidence: `src/components/AuthModal.tsx`)
- Route Guard → Auth State: checks session (evidence: `src/components/ProtectedRoute.tsx`)
- Route Guard → Sign-in Modal: renders (evidence: `src/components/ProtectedRoute.tsx`)
- Progress Dashboard → Route Guard: guards page (evidence: `src/app/dashboard/page.tsx`)
- Progress Dashboard → Auth State: reads user (evidence: `src/app/dashboard/page.tsx`)
- Study Hub → Route Guard: guards page (evidence: `src/app/learning/page.tsx`)
- Interview Simulator → Route Guard: guards page (evidence: `src/app/simulator/page.tsx`)
- Interview Simulator → Focus and Media Tracking: tracks focus (evidence: `src/app/simulator/page.tsx`)
- Interview Simulator → Speech Transcription: uses transcription (evidence: `src/app/simulator/page.tsx`)
