# kajmus/zaquj.to architecture

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

- Interactive diagram: https://gitdiagram.com/kajmus/zaquj.to
- Repository: https://github.com/kajmus/zaquj.to

## Overview

ZaQuj.to is a learning app with a working flashcard path and a simple home/session flow; the home screen also advertises quizzes, which are disabled. The backend serves flashcards by listing, topic, or ID, retrieves question records, and maps them to response schemas. The frontend has routes for home, flashcards, and a demo page. The excerpts do not show the flashcard page’s network calls, so the frontend-to-backend connection is marked unverified; the README is empty.

Main entry points: [`frontend/src/app/App.tsx`](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/app/App.tsx) (App router), [`backend/app/api/v1/endpoints/flashcards.py`](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/flashcards.py) (Flashcard endpoints), [`backend/app/api/v1/api.py`](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/api.py) (API router), [`frontend/src/features/flashcards/FlashcardsPage.tsx`](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/FlashcardsPage.tsx) (Flashcards page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App router<br/>[App.tsx]"]
  node_home["Home and session<br/>[HomePage.tsx]"]
  node_flashcards_page["Flashcards page<br/>[FlashcardsPage.tsx]"]
  node_flashcard_view["Flashcard view<br/>[Flashcard.tsx]"]
  node_fit_text["Text fitting<br/>[fit-text.ts]"]
  node_session_store["Session storage<br/>[session.ts]"]
end

subgraph group_api["Backend API"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_api_router["API router<br/>[api.py]"]
  node_flashcard_endpoints["Flashcard endpoints<br/>[flashcards.py]"]
  node_question_endpoints["Question endpoints<br/>[questions.py]"]
  node_user_endpoints["User endpoints<br/>[users.py]"]
  node_db_dependencies["DB dependency<br/>[dependencies.py]"]
end

subgraph group_data["Questions and data"]
  node_flashcard_crud["Question retrieval<br/>[abcd_question.py]"]
  node_flashcard_service["Flashcard mapping"]
  node_flashcard_schema["Flashcard schemas<br/>[flashcards.py]"]
  node_question_model["ABCD question<br/>[abcd_question.py]"]
  node_topic_model["Topic model<br/>[topic.py]"]
  node_category_crud["Category access<br/>[category.py]"]
  node_category_model["Category model<br/>[category.py]"]
  node_user_crud["User access<br/>[user.py]"]
  node_user_model["User model<br/>[user.py]"]
  node_result_model["Question results<br/>[result.py]"]
  node_database["Database sessions<br/>[database.py]"]
end

subgraph group_demo["Demo state"]
  node_dummy_page["Dummy page<br/>[DummyPage.tsx]"]
  node_state_demo["State demo<br/>[StateDemo.tsx]"]
  node_counter_provider["Counter provider<br/>[CounterContext.tsx]"]
  node_counter_context["Counter context<br/>[counter-context.ts]"]
  node_counter_hook["Counter hook<br/>[use-counter.ts]"]
  node_cookies["Cookie helper<br/>[cookies.ts]"]
end

node_learner(("Learner"))
node_db_store[("SQL database")]

node_learner -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_flashcards_page
node_app -->|"routes to"| node_dummy_page
node_app -->|"wraps routes"| node_counter_provider
node_home -->|"reads and starts"| node_session_store
node_flashcards_page -->|"renders"| node_flashcard_view
node_flashcard_view -->|"uses"| node_fit_text
node_flashcards_page -.->|"requests cards"| node_flashcard_endpoints
node_api_app -->|"mounts"| node_api_router
node_api_router -->|"registers"| node_flashcard_endpoints
node_api_router -->|"registers"| node_question_endpoints
node_api_router -->|"registers"| node_user_endpoints
node_flashcard_endpoints -->|"injects session"| node_db_dependencies
node_db_dependencies -->|"gets session"| node_database
node_flashcard_endpoints -->|"retrieves questions"| node_flashcard_crud
node_flashcard_endpoints -->|"maps questions"| node_flashcard_service
node_flashcard_crud -->|"queries"| node_question_model
node_flashcard_service -->|"reads fields"| node_question_model
node_flashcard_service -->|"builds responses"| node_flashcard_schema
node_flashcard_schema -->|"types from"| node_question_model
node_database -->|"connects"| node_db_store
node_category_crud -->|"queries"| node_category_model
node_category_crud -->|"queries"| node_topic_model
node_user_crud -->|"queries"| node_user_model
node_dummy_page -->|"renders"| node_state_demo
node_state_demo -->|"uses"| node_counter_hook
node_state_demo -->|"uses"| node_cookies
node_counter_provider -->|"provides value"| node_counter_context
node_counter_hook -->|"reads"| node_counter_context

click node_app "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/app/App.tsx"
click node_home "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/home/HomePage.tsx"
click node_flashcards_page "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/FlashcardsPage.tsx"
click node_flashcard_view "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/Flashcard.tsx"
click node_fit_text "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/fit-text.ts"
click node_session_store "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/lib/session.ts"
click node_api_app "https://github.com/kajmus/zaquj.to/blob/main/backend/app/main.py"
click node_api_router "https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/api.py"
click node_flashcard_endpoints "https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/flashcards.py"
click node_question_endpoints "https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/questions.py"
click node_user_endpoints "https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/users.py"
click node_db_dependencies "https://github.com/kajmus/zaquj.to/blob/main/backend/app/dependencies.py"
click node_flashcard_crud "https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/abcd_question.py"
click node_flashcard_service "https://github.com/kajmus/zaquj.to/blob/main/backend/app/services/flashcard_service.py"
click node_flashcard_schema "https://github.com/kajmus/zaquj.to/blob/main/backend/app/schemas/flashcards.py"
click node_question_model "https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/abcd_question.py"
click node_topic_model "https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/topic.py"
click node_category_crud "https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/category.py"
click node_category_model "https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/category.py"
click node_user_crud "https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/user.py"
click node_user_model "https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/user.py"
click node_result_model "https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/result.py"
click node_database "https://github.com/kajmus/zaquj.to/blob/main/backend/app/core/database.py"
click node_dummy_page "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/dummy/DummyPage.tsx"
click node_state_demo "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/StateDemo.tsx"
click node_counter_provider "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/CounterContext.tsx"
click node_counter_context "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/counter-context.ts"
click node_counter_hook "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/use-counter.ts"
click node_cookies "https://github.com/kajmus/zaquj.to/blob/main/frontend/src/lib/cookies.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_home,node_flashcards_page,node_flashcard_view,node_fit_text,node_session_store toneBlue
class node_api_app,node_api_router,node_flashcard_endpoints,node_question_endpoints,node_user_endpoints,node_db_dependencies,node_db_store toneAmber
class node_flashcard_crud,node_flashcard_service,node_flashcard_schema,node_question_model,node_topic_model,node_category_crud,node_category_model,node_user_crud,node_user_model,node_result_model,node_database toneMint
class node_dummy_page,node_state_demo,node_counter_provider,node_counter_context,node_counter_hook,node_cookies toneRose
class node_learner toneIndigo
```

## Components

### Frontend

- [App router](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Home and session](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/home/HomePage.tsx): `frontend/src/features/home/HomePage.tsx`
- [Flashcards page](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/FlashcardsPage.tsx): `frontend/src/features/flashcards/FlashcardsPage.tsx`
- [Flashcard view](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/Flashcard.tsx): `frontend/src/features/flashcards/Flashcard.tsx`
- [Text fitting](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/flashcards/fit-text.ts): `frontend/src/features/flashcards/fit-text.ts`
- [Session storage](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/lib/session.ts): `frontend/src/lib/session.ts`

### Backend API

- [FastAPI app](https://github.com/kajmus/zaquj.to/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/api.py): `backend/app/api/v1/api.py`
- [Flashcard endpoints](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/flashcards.py): `backend/app/api/v1/endpoints/flashcards.py`
- [Question endpoints](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/questions.py): `backend/app/api/v1/endpoints/questions.py`
- [User endpoints](https://github.com/kajmus/zaquj.to/blob/main/backend/app/api/v1/endpoints/users.py): `backend/app/api/v1/endpoints/users.py`
- [DB dependency](https://github.com/kajmus/zaquj.to/blob/main/backend/app/dependencies.py): `backend/app/dependencies.py`

### Questions and data

- [Question retrieval](https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/abcd_question.py): `backend/app/crud/abcd_question.py`
- [Flashcard mapping](https://github.com/kajmus/zaquj.to/blob/main/backend/app/services/flashcard_service.py): `backend/app/services/flashcard_service.py`
- [Flashcard schemas](https://github.com/kajmus/zaquj.to/blob/main/backend/app/schemas/flashcards.py): `backend/app/schemas/flashcards.py`
- [ABCD question](https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/abcd_question.py): `backend/app/models/abcd_question.py`
- [Topic model](https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/topic.py): `backend/app/models/topic.py`
- [Category access](https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/category.py): `backend/app/crud/category.py`
- [Category model](https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/category.py): `backend/app/models/category.py`
- [User access](https://github.com/kajmus/zaquj.to/blob/main/backend/app/crud/user.py): `backend/app/crud/user.py`
- [User model](https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Question results](https://github.com/kajmus/zaquj.to/blob/main/backend/app/models/result.py): `backend/app/models/result.py`
- [Database sessions](https://github.com/kajmus/zaquj.to/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Demo state

- [Dummy page](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/dummy/DummyPage.tsx): `frontend/src/features/dummy/DummyPage.tsx`
- [State demo](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/StateDemo.tsx): `frontend/src/features/state-demo/StateDemo.tsx`
- [Counter provider](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/CounterContext.tsx): `frontend/src/features/state-demo/CounterContext.tsx`
- [Counter context](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/counter-context.ts): `frontend/src/features/state-demo/counter-context.ts`
- [Counter hook](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/features/state-demo/use-counter.ts): `frontend/src/features/state-demo/use-counter.ts`
- [Cookie helper](https://github.com/kajmus/zaquj.to/blob/main/frontend/src/lib/cookies.ts): `frontend/src/lib/cookies.ts`

### Other components

- **Learner**
- **SQL database**

## Connections

- Learner → App router: uses (evidence: `frontend/src/app/App.tsx`)
- App router → Home and session: routes to (evidence: `frontend/src/app/App.tsx`)
- App router → Flashcards page: routes to (evidence: `frontend/src/app/App.tsx`)
- App router → Dummy page: routes to (evidence: `frontend/src/app/App.tsx`)
- App router → Counter provider: wraps routes (evidence: `frontend/src/app/App.tsx`)
- Home and session → Session storage: reads and starts (evidence: `frontend/src/features/home/HomePage.tsx`)
- Flashcards page → Flashcard view: renders (evidence: `frontend/src/features/flashcards/FlashcardsPage.tsx`)
- Flashcard view → Text fitting: uses (evidence: `frontend/src/features/flashcards/Flashcard.tsx`)
- Flashcards page → Flashcard endpoints: requests cards
- FastAPI app → API router: mounts (evidence: `backend/app/main.py`)
- API router → Flashcard endpoints: registers (evidence: `backend/app/api/v1/api.py`)
- API router → Question endpoints: registers (evidence: `backend/app/api/v1/api.py`)
- API router → User endpoints: registers (evidence: `backend/app/api/v1/api.py`)
- Flashcard endpoints → DB dependency: injects session (evidence: `backend/app/api/v1/endpoints/flashcards.py`)
- DB dependency → Database sessions: gets session (evidence: `backend/app/dependencies.py`)
- Flashcard endpoints → Question retrieval: retrieves questions (evidence: `backend/app/api/v1/endpoints/flashcards.py`)
- Flashcard endpoints → Flashcard mapping: maps questions (evidence: `backend/app/api/v1/endpoints/flashcards.py`)
- Question retrieval → ABCD question: queries (evidence: `backend/app/crud/abcd_question.py`)
- Flashcard mapping → ABCD question: reads fields (evidence: `backend/app/services/flashcard_service.py`)
- Flashcard mapping → Flashcard schemas: builds responses (evidence: `backend/app/services/flashcard_service.py`)
- Flashcard schemas → ABCD question: types from (evidence: `backend/app/schemas/flashcards.py`)
- Database sessions → SQL database: connects (evidence: `backend/app/core/database.py`)
- Category access → Category model: queries (evidence: `backend/app/crud/category.py`)
- Category access → Topic model: queries (evidence: `backend/app/crud/category.py`)
- User access → User model: queries (evidence: `backend/app/crud/user.py`)
- Dummy page → State demo: renders (evidence: `frontend/src/features/dummy/DummyPage.tsx`)
- State demo → Counter hook: uses (evidence: `frontend/src/features/state-demo/StateDemo.tsx`)
- State demo → Cookie helper: uses (evidence: `frontend/src/features/state-demo/StateDemo.tsx`)
- Counter provider → Counter context: provides value (evidence: `frontend/src/features/state-demo/CounterContext.tsx`)
- Counter hook → Counter context: reads (evidence: `frontend/src/features/state-demo/use-counter.ts`)
