# enkheeboldu05/studyflow architecture

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

- Interactive diagram: https://gitdiagram.com/enkheeboldu05/studyflow
- Repository: https://github.com/enkheeboldu05/studyflow

## Overview

StudyFlow is a local-first personal study planner. A user signs in, captures tasks, organizes them into subjects and dates, reviews daily or weekly plans, and tracks study sessions and progress. The React app calls an Express JSON API; authenticated routes validate requests and use Prisma with a local SQLite database. The graph includes the documented settings, backup, and study-log capabilities; unsampled route implementations are represented by their tree paths, with links limited to documented or indexed relationships.

Main entry points: [`frontend/src/App.tsx`](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/App.tsx) (App shell), [`backend/src/app.ts`](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/app.ts) (Express API), [`backend/src/db.ts`](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/db.ts) (Prisma client), [`backend/src/routes/auth.ts`](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/auth.ts) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Planner interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_auth_ui["Sign-in screen<br/>[AuthScreen.tsx]"]
  node_task_ui["Task controls<br/>[QuickAdd.tsx]"]
  node_task_editor["Task editor"]
  node_task_card["Task card<br/>[TaskCard.tsx]"]
  node_today["Today plan<br/>[TodayPage.tsx]"]
  node_week["Week plan<br/>[WeekPage.tsx]"]
  node_calendar["Calendar plan<br/>[CalendarPage.tsx]"]
  node_inbox["Task inbox<br/>[InboxPage.tsx]"]
  node_studylog_ui["Study log<br/>[StudyLogPage.tsx]"]
  node_progress["Progress view<br/>[ProgressPage.tsx]"]
  node_settings_ui["Settings and data<br/>[SettingsPage.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_backend["API and domain"]
  node_express["Express API<br/>[app.ts]"]
  node_auth_routes["Authentication<br/>[auth.ts]"]
  node_session_auth["Session guard<br/>[auth.ts]"]
  node_task_routes["Task lifecycle<br/>[tasks.ts]"]
  node_subject_routes["Subjects<br/>[subjects.ts]"]
  node_overview_routes["Overview and settings<br/>[overview.ts]"]
  node_studylog_routes["Study log API<br/>[study-log.ts]"]
  node_validation["Request validation<br/>[schemas.ts]"]
  node_date_logic["Date and recurrence logic<br/>[dates.ts]"]
end

subgraph group_storage["Local persistence"]
  node_prisma["Prisma client<br/>[db.ts]"]
  node_sqlite[("SQLite database<br/>[schema.prisma]")]
end

node_user(("Planner user"))

node_user -->|"signs in"| node_auth_ui
node_auth_ui -->|"submits credentials"| node_api_client
node_app -->|"loads and updates"| node_api_client
node_app -->|"renders"| node_auth_ui
node_app -->|"renders"| node_today
node_app -->|"renders"| node_week
node_app -->|"renders"| node_calendar
node_app -->|"renders"| node_inbox
node_app -->|"renders"| node_studylog_ui
node_app -->|"renders"| node_progress
node_app -->|"renders"| node_settings_ui
node_inbox -->|"renders"| node_task_ui
node_today -->|"renders"| node_task_ui
node_today -->|"renders"| node_task_card
node_week -->|"renders"| node_task_card
node_task_editor -->|"sends task requests"| node_api_client
node_api_client -->|"sends JSON requests"| node_express
node_express -->|"routes auth"| node_auth_routes
node_express -->|"routes tasks"| node_task_routes
node_express -->|"routes subjects"| node_subject_routes
node_express -->|"routes overview"| node_overview_routes
node_express -->|"routes study log"| node_studylog_routes
node_express -->|"guards protected routes"| node_session_auth
node_auth_routes -->|"creates sessions"| node_session_auth
node_auth_routes -->|"validates credentials"| node_validation
node_task_routes -->|"validates task input"| node_validation
node_task_routes -->|"normalizes dates"| node_date_logic
node_auth_routes -->|"reads and writes"| node_prisma
node_session_auth -->|"checks sessions"| node_prisma
node_task_routes -->|"reads and writes"| node_prisma
node_subject_routes -->|"reads and writes"| node_prisma
node_overview_routes -->|"queries planner data"| node_prisma
node_studylog_routes -->|"reads and writes"| node_prisma
node_prisma -->|"persists data"| node_sqlite
node_user -->|"plans study"| node_app

click node_app "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/AuthScreen.tsx"
click node_task_ui "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/QuickAdd.tsx"
click node_task_editor "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/TaskEditorDialog.tsx"
click node_task_card "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/TaskCard.tsx"
click node_today "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/TodayPage.tsx"
click node_week "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/WeekPage.tsx"
click node_calendar "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/CalendarPage.tsx"
click node_inbox "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/InboxPage.tsx"
click node_studylog_ui "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/StudyLogPage.tsx"
click node_progress "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/ProgressPage.tsx"
click node_settings_ui "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/SettingsPage.tsx"
click node_api_client "https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/lib/api.ts"
click node_express "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/auth.ts"
click node_session_auth "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/middleware/auth.ts"
click node_task_routes "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/tasks.ts"
click node_subject_routes "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/subjects.ts"
click node_overview_routes "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/overview.ts"
click node_studylog_routes "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/study-log.ts"
click node_validation "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/lib/schemas.ts"
click node_date_logic "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/lib/dates.ts"
click node_prisma "https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/db.ts"
click node_sqlite "https://github.com/enkheeboldu05/studyflow/blob/main/backend/prisma/schema.prisma"

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_auth_ui,node_task_ui,node_task_editor,node_task_card,node_today,node_week,node_calendar,node_inbox,node_studylog_ui,node_progress,node_settings_ui,node_api_client,node_user toneBlue
class node_express,node_auth_routes,node_session_auth,node_task_routes,node_subject_routes,node_overview_routes,node_studylog_routes,node_validation,node_date_logic toneAmber
class node_prisma,node_sqlite toneMint
```

## Components

### Planner interface

- [App shell](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in screen](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/AuthScreen.tsx): `frontend/src/components/AuthScreen.tsx`
- [Task controls](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/QuickAdd.tsx): `frontend/src/components/QuickAdd.tsx`
- [Task editor](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/TaskEditorDialog.tsx): `frontend/src/components/TaskEditorDialog.tsx`
- [Task card](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/components/TaskCard.tsx): `frontend/src/components/TaskCard.tsx`
- [Today plan](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/TodayPage.tsx): `frontend/src/pages/TodayPage.tsx`
- [Week plan](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/WeekPage.tsx): `frontend/src/pages/WeekPage.tsx`
- [Calendar plan](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/CalendarPage.tsx): `frontend/src/pages/CalendarPage.tsx`
- [Task inbox](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/InboxPage.tsx): `frontend/src/pages/InboxPage.tsx`
- [Study log](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/StudyLogPage.tsx): `frontend/src/pages/StudyLogPage.tsx`
- [Progress view](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/ProgressPage.tsx): `frontend/src/pages/ProgressPage.tsx`
- [Settings and data](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/pages/SettingsPage.tsx): `frontend/src/pages/SettingsPage.tsx`
- [API client](https://github.com/enkheeboldu05/studyflow/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and domain

- [Express API](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [Session guard](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`
- [Task lifecycle](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/tasks.ts): `backend/src/routes/tasks.ts`
- [Subjects](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/subjects.ts): `backend/src/routes/subjects.ts`
- [Overview and settings](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/overview.ts): `backend/src/routes/overview.ts`
- [Study log API](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/routes/study-log.ts): `backend/src/routes/study-log.ts`
- [Request validation](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/lib/schemas.ts): `backend/src/lib/schemas.ts`
- [Date and recurrence logic](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/lib/dates.ts): `backend/src/lib/dates.ts`

### Local persistence

- [Prisma client](https://github.com/enkheeboldu05/studyflow/blob/main/backend/src/db.ts): `backend/src/db.ts`
- [SQLite database](https://github.com/enkheeboldu05/studyflow/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`

### Other components

- **Planner user**

## Connections

- Planner user → Sign-in screen: signs in (evidence: `frontend/src/components/AuthScreen.tsx`)
- Sign-in screen → API client: submits credentials (evidence: `frontend/src/components/AuthScreen.tsx`)
- App shell → API client: loads and updates (evidence: `frontend/src/App.tsx`)
- App shell → Sign-in screen: renders (evidence: `frontend/src/App.tsx`)
- App shell → Today plan: renders (evidence: `frontend/src/App.tsx`)
- App shell → Week plan: renders (evidence: `frontend/src/App.tsx`)
- App shell → Calendar plan: renders (evidence: `frontend/src/App.tsx`)
- App shell → Task inbox: renders (evidence: `frontend/src/App.tsx`)
- App shell → Study log: renders (evidence: `frontend/src/App.tsx`)
- App shell → Progress view: renders (evidence: `frontend/src/App.tsx`)
- App shell → Settings and data: renders (evidence: `frontend/src/App.tsx`)
- Task inbox → Task controls: renders (evidence: `frontend/src/pages/InboxPage.tsx`)
- Today plan → Task controls: renders (evidence: `frontend/src/pages/TodayPage.tsx`)
- Today plan → Task card: renders (evidence: `frontend/src/pages/TodayPage.tsx`)
- Week plan → Task card: renders (evidence: `frontend/src/pages/WeekPage.tsx`)
- Task editor → API client: sends task requests (evidence: `frontend/src/components/TaskEditorDialog.tsx`)
- API client → Express API: sends JSON requests (evidence: `README.md`)
- Express API → Authentication: routes auth (evidence: `backend/src/app.ts`)
- Express API → Task lifecycle: routes tasks (evidence: `backend/src/app.ts`)
- Express API → Subjects: routes subjects (evidence: `backend/src/app.ts`)
- Express API → Overview and settings: routes overview (evidence: `backend/src/app.ts`)
- Express API → Study log API: routes study log (evidence: `backend/src/app.ts`)
- Express API → Session guard: guards protected routes (evidence: `backend/src/app.ts`)
- Authentication → Session guard: creates sessions (evidence: `backend/src/routes/auth.ts`)
- Authentication → Request validation: validates credentials (evidence: `backend/src/routes/auth.ts`)
- Task lifecycle → Request validation: validates task input (evidence: `backend/src/routes/tasks.ts`)
- Task lifecycle → Date and recurrence logic: normalizes dates (evidence: `backend/src/routes/tasks.ts`)
- Authentication → Prisma client: reads and writes (evidence: `backend/src/routes/auth.ts`)
- Session guard → Prisma client: checks sessions (evidence: `backend/src/middleware/auth.ts`)
- Task lifecycle → Prisma client: reads and writes (evidence: `backend/src/routes/tasks.ts`)
- Subjects → Prisma client: reads and writes (evidence: `backend/src/routes/subjects.ts`)
- Overview and settings → Prisma client: queries planner data (evidence: `backend/src/routes/overview.ts`)
- Study log API → Prisma client: reads and writes (evidence: `backend/src/routes/study-log.ts`)
- Prisma client → SQLite database: persists data (evidence: `README.md`)
- Planner user → App shell: plans study (evidence: `README.md`)
