# lawaggg/quizary architecture

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

- Interactive diagram: https://gitdiagram.com/lawaggg/quizary
- Repository: https://github.com/lawaggg/quizary

## Overview

Quizary is a web-and-Android form and quiz platform. Creators build forms or quizzes, optionally generate drafts with AI, and publish them for respondents to complete; the backend handles submissions, grading, and results. The README documents this overall workflow and the main capabilities, while the excerpts confirm web routing, API clients, backend router registration, authentication, and persistence setup. Many feature implementations were not sampled, so their internal call relationships are not asserted here.

Main entry points: [`frontend/src/App.jsx`](https://github.com/lawaggg/quizary/blob/main/frontend/src/App.jsx) (Web routes), [`backend/app/main.py`](https://github.com/lawaggg/quizary/blob/main/backend/app/main.py) (API application), [`frontend/src/api/client.js`](https://github.com/lawaggg/quizary/blob/main/frontend/src/api/client.js) (Web API client), [`frontend/src/pages/public/AnswerQuiz.jsx`](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/public/AnswerQuiz.jsx) (Public quiz)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_web_routes["Web routes<br/>[App.jsx]"]
  node_form_builder["Form builder<br/>[FormEdit.jsx]"]
  node_question_builder["Question builder"]
  node_ai_drafts["AI drafts<br/>[AIGenerate.jsx]"]
  node_form_list["Form management<br/>[FormList.jsx]"]
  node_web_quiz["Public quiz<br/>[AnswerQuiz.jsx]"]
  node_results["Results and analytics<br/>[Results.jsx]"]
  node_web_api["Web API client<br/>[client.js]"]
end

subgraph group_mobile["Android app"]
  node_android_quiz["Android quiz<br/>[quiz.tsx]"]
  node_android_api["Android API client<br/>[api_service.ts]"]
end

subgraph group_api["API and domain"]
  node_api_app["API application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_form_routes["Form and question API"]
  node_submission_routes["Submission API<br/>[submissions.py]"]
  node_result_routes["Results API<br/>[results.py]"]
  node_ai_routes["AI generation<br/>[ai_generate.py]"]
  node_grading["Auto-grading<br/>[grading.py]"]
end

subgraph group_data["Persistence"]
  node_form_model["Form domain model<br/>[form.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

node_creator(("Form creator"))
node_respondent(("Respondent"))

node_creator -->|"uses"| node_web_routes
node_respondent -->|"answers"| node_web_quiz
node_respondent -->|"answers"| node_android_quiz
node_web_routes -->|"routes to"| node_form_list
node_web_routes -->|"routes to"| node_form_builder
node_web_routes -->|"routes to"| node_question_builder
node_web_routes -->|"routes to"| node_ai_drafts
node_web_routes -->|"routes to"| node_web_quiz
node_web_routes -->|"routes to"| node_results
node_form_list -.->|"requests data"| node_web_api
node_form_builder -.->|"requests data"| node_web_api
node_question_builder -.->|"requests data"| node_web_api
node_ai_drafts -.->|"requests drafts"| node_web_api
node_web_quiz -.->|"submits answers"| node_web_api
node_results -.->|"requests results"| node_web_api
node_android_quiz -.->|"requests data"| node_android_api
node_web_api -->|"calls REST API"| node_api_app
node_android_api -->|"calls REST API"| node_api_app
node_api_app -->|"registers router"| node_auth
node_api_app -->|"registers routers"| node_form_routes
node_api_app -->|"registers router"| node_submission_routes
node_api_app -->|"registers router"| node_result_routes
node_ai_routes -.->|"serves generation"| node_api_app
node_submission_routes -.->|"grades answers"| node_grading
node_form_model -->|"uses ORM base"| node_database

click node_web_routes "https://github.com/lawaggg/quizary/blob/main/frontend/src/App.jsx"
click node_form_builder "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/FormEdit.jsx"
click node_question_builder "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/QuestionBuilder.jsx"
click node_ai_drafts "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/AIGenerate.jsx"
click node_form_list "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/FormList.jsx"
click node_web_quiz "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/public/AnswerQuiz.jsx"
click node_results "https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/results/Results.jsx"
click node_web_api "https://github.com/lawaggg/quizary/blob/main/frontend/src/api/client.js"
click node_android_quiz "https://github.com/lawaggg/quizary/blob/main/android/src/app/quiz.tsx"
click node_android_api "https://github.com/lawaggg/quizary/blob/main/android/src/services/api_service.ts"
click node_api_app "https://github.com/lawaggg/quizary/blob/main/backend/app/main.py"
click node_auth "https://github.com/lawaggg/quizary/blob/main/backend/app/routers/auth.py"
click node_form_routes "https://github.com/lawaggg/quizary/tree/main/backend/app/routers"
click node_submission_routes "https://github.com/lawaggg/quizary/blob/main/backend/app/routers/submissions.py"
click node_result_routes "https://github.com/lawaggg/quizary/blob/main/backend/app/routers/results.py"
click node_ai_routes "https://github.com/lawaggg/quizary/blob/main/backend/app/services/ai_generate.py"
click node_grading "https://github.com/lawaggg/quizary/blob/main/backend/app/services/grading.py"
click node_form_model "https://github.com/lawaggg/quizary/blob/main/backend/app/models/form.py"
click node_database "https://github.com/lawaggg/quizary/blob/main/backend/app/database.py"

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_web_routes,node_form_builder,node_question_builder,node_ai_drafts,node_form_list,node_web_quiz,node_results,node_web_api toneBlue
class node_android_quiz,node_android_api toneAmber
class node_api_app,node_auth,node_form_routes,node_submission_routes,node_result_routes,node_ai_routes,node_grading toneMint
class node_form_model,node_database toneRose
class node_creator,node_respondent toneIndigo
```

## Components

### Web app

- [Web routes](https://github.com/lawaggg/quizary/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Form builder](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/FormEdit.jsx): `frontend/src/pages/forms/FormEdit.jsx`
- [Question builder](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/QuestionBuilder.jsx): `frontend/src/pages/forms/QuestionBuilder.jsx`
- [AI drafts](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/AIGenerate.jsx): `frontend/src/pages/forms/AIGenerate.jsx`
- [Form management](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/forms/FormList.jsx): `frontend/src/pages/forms/FormList.jsx`
- [Public quiz](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/public/AnswerQuiz.jsx): `frontend/src/pages/public/AnswerQuiz.jsx`
- [Results and analytics](https://github.com/lawaggg/quizary/blob/main/frontend/src/pages/results/Results.jsx): `frontend/src/pages/results/Results.jsx`
- [Web API client](https://github.com/lawaggg/quizary/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Android app

- [Android quiz](https://github.com/lawaggg/quizary/blob/main/android/src/app/quiz.tsx): `android/src/app/quiz.tsx`
- [Android API client](https://github.com/lawaggg/quizary/blob/main/android/src/services/api_service.ts): `android/src/services/api_service.ts`

### API and domain

- [API application](https://github.com/lawaggg/quizary/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/lawaggg/quizary/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Form and question API](https://github.com/lawaggg/quizary/tree/main/backend/app/routers): `backend/app/routers`
- [Submission API](https://github.com/lawaggg/quizary/blob/main/backend/app/routers/submissions.py): `backend/app/routers/submissions.py`
- [Results API](https://github.com/lawaggg/quizary/blob/main/backend/app/routers/results.py): `backend/app/routers/results.py`
- [AI generation](https://github.com/lawaggg/quizary/blob/main/backend/app/services/ai_generate.py): `backend/app/services/ai_generate.py`
- [Auto-grading](https://github.com/lawaggg/quizary/blob/main/backend/app/services/grading.py): `backend/app/services/grading.py`

### Persistence

- [Form domain model](https://github.com/lawaggg/quizary/blob/main/backend/app/models/form.py): `backend/app/models/form.py`
- [SQL database](https://github.com/lawaggg/quizary/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Form creator**
- **Respondent**

## Connections

- Form creator → Web routes: uses (evidence: `README.md`)
- Respondent → Public quiz: answers (evidence: `README.md`)
- Respondent → Android quiz: answers (evidence: `README.md`)
- Web routes → Form management: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Form builder: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Question builder: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → AI drafts: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Public quiz: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Results and analytics: routes to (evidence: `frontend/src/App.jsx`)
- Form management → Web API client: requests data
- Form builder → Web API client: requests data
- Question builder → Web API client: requests data
- AI drafts → Web API client: requests drafts
- Public quiz → Web API client: submits answers
- Results and analytics → Web API client: requests results
- Android quiz → Android API client: requests data
- Web API client → API application: calls REST API (evidence: `README.md`)
- Android API client → API application: calls REST API (evidence: `README.md`)
- API application → Authentication: registers router (evidence: `backend/app/main.py`)
- API application → Form and question API: registers routers (evidence: `backend/app/main.py`)
- API application → Submission API: registers router (evidence: `backend/app/main.py`)
- API application → Results API: registers router (evidence: `backend/app/main.py`)
- AI generation → API application: serves generation
- Submission API → Auto-grading: grades answers
- Form domain model → SQL database: uses ORM base (evidence: `backend/app/models/form.py`)
