# devjsonpan/study-tracker architecture

> Architecture diagram of the GitHub repository devjsonpan/study-tracker, 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/devjsonpan/study-tracker
- Repository: https://github.com/devjsonpan/study-tracker

## Overview

LockNIn is a study and productivity tracker. Students use its React pages to record study and break time, manage homework and events, review calendar and progress analytics, and connect with study groups. The frontend calls a Flask application, which the README identifies as using SQLAlchemy and SQLite. Authentication, profiles, importing, and group chat are additional product branches. Backend routes and persistence details are not excerpted, so backend links are limited to documented technology and frontend HTTP calls; unsampled feature links are documented in the README.

Main entry points: [`app.py`](https://github.com/devjsonpan/study-tracker/blob/main/app.py) (Flask application), [`frontend/src/pages/Study.tsx`](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Study.tsx) (Study workspace), [`frontend/src/pages/Chat.tsx`](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Chat.tsx) (Group chat), [`frontend/src/components/Layout.tsx`](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/components/Layout.tsx) (Protected layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_router["Route application<br/>[main.tsx]"]
  node_layout["Protected layout<br/>[Layout.tsx]"]
end

subgraph group_study["Study workflow"]
  node_study_page["Study workspace<br/>[Study.tsx]"]
  node_pomodoro["Pomodoro timer<br/>[PomoPanel.tsx]"]
  node_sessions_api["Study sessions API<br/>[sessions.ts]"]
  node_breaks_api["Breaks API<br/>[breaks.ts]"]
  node_notes_api["Study notes API<br/>[notes.ts]"]
end

subgraph group_planning["Planning and progress"]
  node_homework_page["Homework tracker<br/>[Homework.tsx]"]
  node_homework_api["Homework API<br/>[homework.ts]"]
  node_events_page["Event planner<br/>[Events.tsx]"]
  node_events_api["Events API<br/>[events.ts]"]
  node_overview["Calendar and analytics<br/>[Overview.tsx]"]
  node_calendar_api["Calendar API<br/>[calendar.ts]"]
  node_summary_api["Summary API<br/>[summary.ts]"]
  node_home["Home dashboard<br/>[Home.tsx]"]
  node_import_page["Schedule import<br/>[Import.tsx]"]
  node_parse_api["Import parsing API<br/>[parse.ts]"]
end

subgraph group_social["Identity and social"]
  node_auth_pages["Sign-in and registration<br/>[Login.tsx]"]
  node_auth_api["Authentication API<br/>[auth.ts]"]
  node_profile_page["Profile management<br/>[Profile.tsx]"]
  node_profile_api["Profile API<br/>[profile.ts]"]
  node_groups_api["Study groups API<br/>[groups.ts]"]
  node_chat_page["Group chat<br/>[Chat.tsx]"]
  node_chat_api["Chat API<br/>[chat.ts]"]
  node_socket["Realtime socket<br/>[socket.ts]"]
end

node_student(("Student"))
node_flask["Flask application<br/>[app.py]"]
node_database[("SQLite database")]

node_student -->|"uses"| node_router
node_router -->|"wraps protected routes"| node_layout
node_layout -->|"checks session"| node_auth_api
node_layout -->|"requests identity"| node_flask
node_study_page -->|"saves sessions"| node_sessions_api
node_study_page -->|"logs breaks"| node_breaks_api
node_study_page -->|"loads notes"| node_notes_api
node_study_page -->|"renders timer"| node_pomodoro
node_pomodoro -->|"saves sessions"| node_sessions_api
node_pomodoro -->|"logs breaks"| node_breaks_api
node_sessions_api -->|"HTTP requests"| node_flask
node_breaks_api -->|"HTTP requests"| node_flask
node_notes_api -->|"HTTP requests"| node_flask
node_homework_page -->|"manages tasks"| node_homework_api
node_homework_api -->|"HTTP requests"| node_flask
node_events_page -->|"manages events"| node_events_api
node_events_api -->|"HTTP requests"| node_flask
node_overview -->|"loads calendar"| node_calendar_api
node_overview -->|"loads analytics"| node_summary_api
node_calendar_api -->|"HTTP requests"| node_flask
node_summary_api -->|"HTTP requests"| node_flask
node_home -->|"loads tasks"| node_homework_api
node_home -->|"loads events"| node_events_api
node_import_page -->|"parses import"| node_parse_api
node_parse_api -->|"HTTP requests"| node_flask
node_auth_pages -->|"authenticates"| node_auth_api
node_auth_api -->|"HTTP requests"| node_flask
node_profile_page -->|"updates profile"| node_profile_api
node_profile_api -->|"HTTP requests"| node_flask
node_chat_page -->|"sends messages"| node_chat_api
node_chat_page -->|"uses groups"| node_groups_api
node_chat_page -->|"uses realtime"| node_socket
node_chat_api -->|"HTTP requests"| node_flask
node_groups_api -->|"HTTP requests"| node_flask
node_flask -->|"persists records"| node_database

click node_router "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/main.tsx"
click node_layout "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/components/Layout.tsx"
click node_flask "https://github.com/devjsonpan/study-tracker/blob/main/app.py"
click node_study_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Study.tsx"
click node_pomodoro "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/components/PomoPanel.tsx"
click node_sessions_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/sessions.ts"
click node_breaks_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/breaks.ts"
click node_notes_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/notes.ts"
click node_homework_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Homework.tsx"
click node_homework_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/homework.ts"
click node_events_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Events.tsx"
click node_events_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/events.ts"
click node_overview "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Overview.tsx"
click node_calendar_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/calendar.ts"
click node_summary_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/summary.ts"
click node_home "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Home.tsx"
click node_import_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Import.tsx"
click node_parse_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/parse.ts"
click node_auth_pages "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Login.tsx"
click node_auth_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/auth.ts"
click node_profile_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Profile.tsx"
click node_profile_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/profile.ts"
click node_groups_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/groups.ts"
click node_chat_page "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Chat.tsx"
click node_chat_api "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/chat.ts"
click node_socket "https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/lib/socket.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_router,node_layout toneBlue
class node_study_page,node_pomodoro,node_sessions_api,node_breaks_api,node_notes_api,node_database toneAmber
class node_homework_page,node_homework_api,node_events_page,node_events_api,node_overview,node_calendar_api,node_summary_api,node_home,node_import_page,node_parse_api toneMint
class node_auth_pages,node_auth_api,node_profile_page,node_profile_api,node_groups_api,node_chat_page,node_chat_api,node_socket toneRose
class node_student toneIndigo
class node_flask toneTeal
```

## Components

### Web experience

- [Route application](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Protected layout](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/components/Layout.tsx): `frontend/src/components/Layout.tsx`

### Study workflow

- [Study workspace](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Study.tsx): `frontend/src/pages/Study.tsx`
- [Pomodoro timer](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/components/PomoPanel.tsx): `frontend/src/components/PomoPanel.tsx`
- [Study sessions API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/sessions.ts): `frontend/src/api/sessions.ts`
- [Breaks API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/breaks.ts): `frontend/src/api/breaks.ts`
- [Study notes API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/notes.ts): `frontend/src/api/notes.ts`

### Planning and progress

- [Homework tracker](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Homework.tsx): `frontend/src/pages/Homework.tsx`
- [Homework API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/homework.ts): `frontend/src/api/homework.ts`
- [Event planner](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Events.tsx): `frontend/src/pages/Events.tsx`
- [Events API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/events.ts): `frontend/src/api/events.ts`
- [Calendar and analytics](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Overview.tsx): `frontend/src/pages/Overview.tsx`
- [Calendar API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/calendar.ts): `frontend/src/api/calendar.ts`
- [Summary API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/summary.ts): `frontend/src/api/summary.ts`
- [Home dashboard](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`
- [Schedule import](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Import.tsx): `frontend/src/pages/Import.tsx`
- [Import parsing API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/parse.ts): `frontend/src/api/parse.ts`

### Identity and social

- [Sign-in and registration](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Authentication API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/auth.ts): `frontend/src/api/auth.ts`
- [Profile management](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Profile.tsx): `frontend/src/pages/Profile.tsx`
- [Profile API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/profile.ts): `frontend/src/api/profile.ts`
- [Study groups API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/groups.ts): `frontend/src/api/groups.ts`
- [Group chat](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/pages/Chat.tsx): `frontend/src/pages/Chat.tsx`
- [Chat API](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/api/chat.ts): `frontend/src/api/chat.ts`
- [Realtime socket](https://github.com/devjsonpan/study-tracker/blob/main/frontend/src/lib/socket.ts): `frontend/src/lib/socket.ts`

### Other components

- **Student**
- [Flask application](https://github.com/devjsonpan/study-tracker/blob/main/app.py): `app.py`
- **SQLite database**

## Connections

- Student → Route application: uses (evidence: `frontend/src/main.tsx`)
- Route application → Protected layout: wraps protected routes (evidence: `frontend/src/main.tsx`)
- Protected layout → Authentication API: checks session (evidence: `frontend/src/components/Layout.tsx`)
- Protected layout → Flask application: requests identity
- Study workspace → Study sessions API: saves sessions (evidence: `frontend/src/pages/Study.tsx`)
- Study workspace → Breaks API: logs breaks (evidence: `frontend/src/pages/Study.tsx`)
- Study workspace → Study notes API: loads notes (evidence: `frontend/src/pages/Study.tsx`)
- Study workspace → Pomodoro timer: renders timer (evidence: `frontend/src/pages/Study.tsx`)
- Pomodoro timer → Study sessions API: saves sessions (evidence: `frontend/src/components/PomoPanel.tsx`)
- Pomodoro timer → Breaks API: logs breaks (evidence: `frontend/src/components/PomoPanel.tsx`)
- Study sessions API → Flask application: HTTP requests (evidence: `frontend/src/api/sessions.ts`)
- Breaks API → Flask application: HTTP requests (evidence: `frontend/src/api/breaks.ts`)
- Study notes API → Flask application: HTTP requests (evidence: `frontend/src/api/notes.ts`)
- Homework tracker → Homework API: manages tasks (evidence: `frontend/src/pages/Homework.tsx`)
- Homework API → Flask application: HTTP requests (evidence: `frontend/src/api/homework.ts`)
- Event planner → Events API: manages events (evidence: `frontend/src/pages/Events.tsx`)
- Events API → Flask application: HTTP requests (evidence: `frontend/src/api/events.ts`)
- Calendar and analytics → Calendar API: loads calendar (evidence: `frontend/src/pages/Overview.tsx`)
- Calendar and analytics → Summary API: loads analytics (evidence: `frontend/src/pages/Overview.tsx`)
- Calendar API → Flask application: HTTP requests (evidence: `frontend/src/api/calendar.ts`)
- Summary API → Flask application: HTTP requests (evidence: `frontend/src/api/summary.ts`)
- Home dashboard → Homework API: loads tasks (evidence: `frontend/src/pages/Home.tsx`)
- Home dashboard → Events API: loads events (evidence: `frontend/src/pages/Home.tsx`)
- Schedule import → Import parsing API: parses import (evidence: `frontend/src/pages/Import.tsx`)
- Import parsing API → Flask application: HTTP requests (evidence: `frontend/src/api/parse.ts`)
- Sign-in and registration → Authentication API: authenticates (evidence: `frontend/src/pages/Login.tsx`)
- Authentication API → Flask application: HTTP requests (evidence: `frontend/src/api/auth.ts`)
- Profile management → Profile API: updates profile (evidence: `frontend/src/pages/Profile.tsx`)
- Profile API → Flask application: HTTP requests (evidence: `frontend/src/api/profile.ts`)
- Group chat → Chat API: sends messages (evidence: `frontend/src/pages/Chat.tsx`)
- Group chat → Study groups API: uses groups (evidence: `frontend/src/pages/Chat.tsx`)
- Group chat → Realtime socket: uses realtime (evidence: `frontend/src/pages/Chat.tsx`)
- Chat API → Flask application: HTTP requests (evidence: `frontend/src/api/chat.ts`)
- Study groups API → Flask application: HTTP requests (evidence: `frontend/src/api/groups.ts`)
- Flask application → SQLite database: persists records (evidence: `README.md`)
