# mahendra-go/exam-desk architecture

> Architecture diagram of the GitHub repository mahendra-go/exam-desk, 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/mahendra-go/exam-desk
- Repository: https://github.com/mahendra-go/exam-desk

## Overview

This is a browser-based exam authoring and practice application, with authenticated cloud saving and shared exams. The main workflow runs through the application controller: create or join an exam, preview or take it, submit answers, and view results; creators can also share exams and review submissions. Firebase services support authentication and persistence. The source index establishes component wiring and selected service calls, but server.ts and several UI components were not excerpted, so some runtime relationships are omitted or marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/mahendra-go/exam-desk/blob/main/src/App.tsx) (Workflow controller), [`src/services/examFirestore.ts`](https://github.com/mahendra-go/exam-desk/blob/main/src/services/examFirestore.ts) (Exam persistence service), [`src/components/AuthGate.tsx`](https://github.com/mahendra-go/exam-desk/blob/main/src/components/AuthGate.tsx) (Sign-in gate), [`src/components/ExamCreator.tsx`](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamCreator.tsx) (Exam creator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Exam workflow"]
  node_app["Workflow controller<br/>[App.tsx]"]
  node_creator["Exam creator<br/>[ExamCreator.tsx]"]
  node_preview["Exam preview<br/>[ExamPreview.tsx]"]
  node_player["Exam player<br/>[ExamPlayer.tsx]"]
  node_results["Exam results<br/>[ExamResults.tsx]"]
  node_types["Exam domain types<br/>[exam.ts]"]
end

subgraph group_sharing["Sharing and review"]
  node_join["Join exam<br/>[JoinTestModal.tsx]"]
  node_share["Share exam<br/>[ShareTestModal.tsx]"]
  node_dashboard["Submission dashboard"]
  node_saved["Saved exams"]
end

subgraph group_platform["Application platform"]
  node_authgate["Sign-in gate<br/>[AuthGate.tsx]"]
  node_header["Application header<br/>[Header.tsx]"]
  node_identity["Google identity"]
  node_api["Application server<br/>[server.ts]"]
end

subgraph group_persistence["Cloud persistence"]
  node_firestore_service["Exam persistence service<br/>[examFirestore.ts]"]
  node_firebase["Firebase configuration<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
end

node_user(("Learner or creator"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_authgate
node_authgate -->|"uses auth"| node_firebase
node_authgate -->|"signs in"| node_identity
node_app -->|"renders"| node_creator
node_app -->|"renders"| node_preview
node_app -->|"renders"| node_player
node_app -->|"renders"| node_results
node_app -->|"renders"| node_header
node_app -->|"renders"| node_join
node_app -->|"renders"| node_share
node_app -->|"renders"| node_saved
node_app -->|"renders"| node_dashboard
node_creator -->|"uses types"| node_types
node_app -->|"saves exams and results"| node_firestore_service
node_firestore_service -->|"uses configuration"| node_firebase
node_firestore_service -->|"reads and writes"| node_firestore
node_dashboard -->|"loads submissions"| node_firestore_service
node_join -->|"looks up exams"| node_firestore_service
node_share -->|"publishes exams"| node_firestore_service
node_app -.->|"requests evaluation"| node_api

click node_app "https://github.com/mahendra-go/exam-desk/blob/main/src/App.tsx"
click node_creator "https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamCreator.tsx"
click node_preview "https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamPreview.tsx"
click node_player "https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamPlayer.tsx"
click node_results "https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamResults.tsx"
click node_types "https://github.com/mahendra-go/exam-desk/blob/main/src/types/exam.ts"
click node_authgate "https://github.com/mahendra-go/exam-desk/blob/main/src/components/AuthGate.tsx"
click node_header "https://github.com/mahendra-go/exam-desk/blob/main/src/components/Header.tsx"
click node_join "https://github.com/mahendra-go/exam-desk/blob/main/src/components/JoinTestModal.tsx"
click node_share "https://github.com/mahendra-go/exam-desk/blob/main/src/components/ShareTestModal.tsx"
click node_dashboard "https://github.com/mahendra-go/exam-desk/blob/main/src/components/SubmissionsDashboard.tsx"
click node_saved "https://github.com/mahendra-go/exam-desk/blob/main/src/components/SavedExamsModal.tsx"
click node_firestore_service "https://github.com/mahendra-go/exam-desk/blob/main/src/services/examFirestore.ts"
click node_firebase "https://github.com/mahendra-go/exam-desk/blob/main/src/firebase.ts"
click node_api "https://github.com/mahendra-go/exam-desk/blob/main/server.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_app,node_creator,node_preview,node_player,node_results,node_types toneBlue
class node_join,node_share,node_dashboard,node_saved toneAmber
class node_authgate,node_header,node_identity,node_api toneMint
class node_firestore_service,node_firebase,node_firestore toneRose
class node_user toneIndigo
```

## Components

### Exam workflow

- [Workflow controller](https://github.com/mahendra-go/exam-desk/blob/main/src/App.tsx): `src/App.tsx`
- [Exam creator](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamCreator.tsx): `src/components/ExamCreator.tsx`
- [Exam preview](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamPreview.tsx): `src/components/ExamPreview.tsx`
- [Exam player](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamPlayer.tsx): `src/components/ExamPlayer.tsx`
- [Exam results](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ExamResults.tsx): `src/components/ExamResults.tsx`
- [Exam domain types](https://github.com/mahendra-go/exam-desk/blob/main/src/types/exam.ts): `src/types/exam.ts`

### Sharing and review

- [Join exam](https://github.com/mahendra-go/exam-desk/blob/main/src/components/JoinTestModal.tsx): `src/components/JoinTestModal.tsx`
- [Share exam](https://github.com/mahendra-go/exam-desk/blob/main/src/components/ShareTestModal.tsx): `src/components/ShareTestModal.tsx`
- [Submission dashboard](https://github.com/mahendra-go/exam-desk/blob/main/src/components/SubmissionsDashboard.tsx): `src/components/SubmissionsDashboard.tsx`
- [Saved exams](https://github.com/mahendra-go/exam-desk/blob/main/src/components/SavedExamsModal.tsx): `src/components/SavedExamsModal.tsx`

### Application platform

- [Sign-in gate](https://github.com/mahendra-go/exam-desk/blob/main/src/components/AuthGate.tsx): `src/components/AuthGate.tsx`
- [Application header](https://github.com/mahendra-go/exam-desk/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- **Google identity**
- [Application server](https://github.com/mahendra-go/exam-desk/blob/main/server.ts): `server.ts`

### Cloud persistence

- [Exam persistence service](https://github.com/mahendra-go/exam-desk/blob/main/src/services/examFirestore.ts): `src/services/examFirestore.ts`
- [Firebase configuration](https://github.com/mahendra-go/exam-desk/blob/main/src/firebase.ts): `src/firebase.ts`
- **Firestore**

### Other components

- **Learner or creator**

## Connections

- Learner or creator → Workflow controller: uses
- Workflow controller → Sign-in gate: renders (evidence: `src/App.tsx`)
- Sign-in gate → Firebase configuration: uses auth (evidence: `src/components/AuthGate.tsx`)
- Sign-in gate → Google identity: signs in (evidence: `src/components/AuthGate.tsx`)
- Workflow controller → Exam creator: renders (evidence: `src/App.tsx`)
- Workflow controller → Exam preview: renders (evidence: `src/App.tsx`)
- Workflow controller → Exam player: renders (evidence: `src/App.tsx`)
- Workflow controller → Exam results: renders (evidence: `src/App.tsx`)
- Workflow controller → Application header: renders (evidence: `src/App.tsx`)
- Workflow controller → Join exam: renders (evidence: `src/App.tsx`)
- Workflow controller → Share exam: renders (evidence: `src/App.tsx`)
- Workflow controller → Saved exams: renders (evidence: `src/App.tsx`)
- Workflow controller → Submission dashboard: renders (evidence: `src/App.tsx`)
- Exam creator → Exam domain types: uses types (evidence: `src/components/ExamCreator.tsx`)
- Workflow controller → Exam persistence service: saves exams and results (evidence: `src/App.tsx`)
- Exam persistence service → Firebase configuration: uses configuration (evidence: `src/services/examFirestore.ts`)
- Exam persistence service → Firestore: reads and writes (evidence: `src/services/examFirestore.ts`)
- Submission dashboard → Exam persistence service: loads submissions (evidence: `src/components/SubmissionsDashboard.tsx`)
- Join exam → Exam persistence service: looks up exams (evidence: `src/components/JoinTestModal.tsx`)
- Share exam → Exam persistence service: publishes exams (evidence: `src/components/ShareTestModal.tsx`)
- Workflow controller → Application server: requests evaluation
