# chinoarror/uni-study architecture

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

- Interactive diagram: https://gitdiagram.com/chinoarror/uni-study
- Repository: https://github.com/chinoarror/uni-study
- Video tour (about a minute): https://gitdiagram.com/chinoarror/uni-study/video

## Overview

Uni Study is a university study dashboard for managing schedules, courses, grades and GPA, with image/CSV import and review, settings, and a public landing page. The main user journey is to sign in, view or maintain study data, optionally import a file for recognition and confirmation, then review grades and GPA analytics. The tree has a single React entry point and a single Worker entry point; the README is empty and sampled source is partial, so internal screen wiring and some backend dispatch details are not expanded.

Main entry points: [`src/main.tsx`](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx) (Study app), [`worker/index.ts`](https://github.com/chinoarror/uni-study/blob/master/worker/index.ts) (Import handler), [`migrations/0001_initial.sql`](https://github.com/chinoarror/uni-study/blob/master/migrations/0001_initial.sql) (Database schema), [`migrations/0003_app_sessions.sql`](https://github.com/chinoarror/uni-study/blob/master/migrations/0003_app_sessions.sql) (Session schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Study dashboard"]
  node_app["Study app<br/>[main.tsx]"]
  node_landing["Landing page<br/>[main.tsx]"]
  node_schedule["Schedule<br/>[main.tsx]"]
  node_courses["Courses<br/>[main.tsx]"]
  node_grades["Grade records<br/>[main.tsx]"]
  node_analytics["GPA analytics<br/>[main.tsx]"]
  node_import_ui["Import review<br/>[main.tsx]"]
  node_settings["Settings<br/>[main.tsx]"]
end

subgraph group_backend["Worker services"]
  node_api["API and auth<br/>[index.ts]"]
end

subgraph group_imports["Import workflow"]
  node_import_handler["Import handler<br/>[index.ts]"]
  node_recognition["Recognition worker<br/>[index.ts]"]
  node_confirmation["Draft confirmation<br/>[index.ts]"]
  node_queue["Import queue"]
end

subgraph group_storage["Persistence"]
  node_db[("D1 database")]
  node_r2[("R2 files")]
  node_schema["Database schema<br/>[0001_initial.sql]"]
  node_sessions_schema["Session schema"]
end

node_student(("Student"))
node_auth_center["Auth center"]
node_ai["AI service"]

node_student -->|"uses"| node_app
node_student -->|"visits"| node_landing
node_app -->|"shows"| node_schedule
node_app -->|"shows"| node_courses
node_app -->|"shows"| node_grades
node_app -->|"shows"| node_analytics
node_app -->|"shows"| node_import_ui
node_app -->|"shows"| node_settings
node_app -->|"API requests"| node_api
node_api -.->|"verifies identity"| node_auth_center
node_api -->|"reads and writes"| node_db
node_import_handler -->|"records job"| node_db
node_import_handler -->|"stores original"| node_r2
node_import_handler -->|"enqueues image"| node_queue
node_queue -->|"dispatches job"| node_recognition
node_recognition -->|"recognizes content"| node_ai
node_recognition -->|"stores draft"| node_db
node_import_ui -->|"confirms draft"| node_confirmation
node_confirmation -->|"imports records"| node_db
node_confirmation -->|"deletes original"| node_r2
node_db -->|"uses schema"| node_schema
node_db -->|"uses schema"| node_sessions_schema

click node_app "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_landing "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_schedule "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_courses "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_grades "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_analytics "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_import_ui "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_settings "https://github.com/chinoarror/uni-study/blob/master/src/main.tsx"
click node_api "https://github.com/chinoarror/uni-study/blob/master/worker/index.ts"
click node_import_handler "https://github.com/chinoarror/uni-study/blob/master/worker/index.ts"
click node_recognition "https://github.com/chinoarror/uni-study/blob/master/worker/index.ts"
click node_confirmation "https://github.com/chinoarror/uni-study/blob/master/worker/index.ts"
click node_schema "https://github.com/chinoarror/uni-study/blob/master/migrations/0001_initial.sql"
click node_sessions_schema "https://github.com/chinoarror/uni-study/blob/master/migrations/0003_app_sessions.sql"

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_landing,node_schedule,node_courses,node_grades,node_analytics,node_import_ui,node_settings toneBlue
class node_api toneAmber
class node_import_handler,node_recognition,node_confirmation,node_queue toneMint
class node_db,node_r2,node_schema,node_sessions_schema toneRose
class node_student,node_auth_center,node_ai toneIndigo
```

## Components

### Study dashboard

- [Study app](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Landing page](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Schedule](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Courses](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Grade records](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [GPA analytics](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Import review](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`
- [Settings](https://github.com/chinoarror/uni-study/blob/master/src/main.tsx): `src/main.tsx`

### Worker services

- [API and auth](https://github.com/chinoarror/uni-study/blob/master/worker/index.ts): `worker/index.ts`

### Import workflow

- [Import handler](https://github.com/chinoarror/uni-study/blob/master/worker/index.ts): `worker/index.ts`
- [Recognition worker](https://github.com/chinoarror/uni-study/blob/master/worker/index.ts): `worker/index.ts`
- [Draft confirmation](https://github.com/chinoarror/uni-study/blob/master/worker/index.ts): `worker/index.ts`
- **Import queue**

### Persistence

- **D1 database**
- **R2 files**
- [Database schema](https://github.com/chinoarror/uni-study/blob/master/migrations/0001_initial.sql): `migrations/0001_initial.sql`
- [Session schema](https://github.com/chinoarror/uni-study/blob/master/migrations/0003_app_sessions.sql): `migrations/0003_app_sessions.sql`

### Other components

- **Student**
- **Auth center**
- **AI service**

## Connections

- Student → Study app: uses
- Student → Landing page: visits
- Study app → Schedule: shows
- Study app → Courses: shows
- Study app → Grade records: shows
- Study app → GPA analytics: shows
- Study app → Import review: shows
- Study app → Settings: shows
- Study app → API and auth: API requests
- API and auth → Auth center: verifies identity
- API and auth → D1 database: reads and writes
- Import handler → D1 database: records job
- Import handler → R2 files: stores original
- Import handler → Import queue: enqueues image
- Import queue → Recognition worker: dispatches job
- Recognition worker → AI service: recognizes content
- Recognition worker → D1 database: stores draft
- Import review → Draft confirmation: confirms draft
- Draft confirmation → D1 database: imports records
- Draft confirmation → R2 files: deletes original
- D1 database → Database schema: uses schema
- D1 database → Session schema: uses schema
