# aryamaandash/track-my-studying architecture

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

- Interactive diagram: https://gitdiagram.com/aryamaandash/track-my-studying
- Repository: https://github.com/aryamaandash/track-my-studying
- Video tour (about a minute): https://gitdiagram.com/aryamaandash/track-my-studying/video

## Overview

Track My Studying is a personal study-journal web app. A user registers or signs in, records study sessions, then reviews progress in the dashboard; they can revise or remove entries and keep weekly reflections. The graph separates account access, study-record workflows, progress views, and shared infrastructure. PostgreSQL persistence, Redis-backed rate limiting, and the sampled session-data and authentication code are supported by the README and excerpts; several page/component connections are inferred from their product roles, so uncertain wiring is omitted.

Main entry points: [`app/actions.ts`](https://github.com/aryamaandash/track-my-studying/blob/main/app/actions.ts) (Study actions), [`auth.ts`](https://github.com/aryamaandash/track-my-studying/blob/main/auth.ts) (Auth services), [`lib/prisma.ts`](https://github.com/aryamaandash/track-my-studying/blob/main/lib/prisma.ts) (Prisma client), [`app/dashboard/page.tsx`](https://github.com/aryamaandash/track-my-studying/blob/main/app/dashboard/page.tsx) (Study dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_login["Login page<br/>[page.tsx]"]
  node_register["Register page<br/>[page.tsx]"]
  node_authroute["Auth endpoint<br/>[route.ts]"]
  node_auth["Auth services<br/>[auth.ts]"]
  node_settings["Account settings<br/>[page.tsx]"]
end

subgraph group_journal["Study journal"]
  node_dashboard["Study dashboard<br/>[page.tsx]"]
  node_entryform["Session entry form<br/>[StudyEntryForm.tsx]"]
  node_actions["Study actions<br/>[actions.ts]"]
  node_history["Session history<br/>[page.tsx]"]
  node_edit["Edit session"]
  node_remove["Remove session"]
  node_reflectionpage["Weekly reflections<br/>[page.tsx]"]
  node_reflectionform["Reflection form"]
  node_reflectionactions["Reflection actions<br/>[actions.ts]"]
end

subgraph group_progress["Progress views"]
  node_calendar["Study calendar<br/>[StudyCalendar.tsx]"]
  node_calendarapi["Calendar endpoint<br/>[route.ts]"]
  node_charts["Study charts<br/>[StudyCharts.tsx]"]
  node_chartapi["Chart endpoint<br/>[route.ts]"]
  node_cache["Study data cache<br/>[study-cache.ts]"]
  node_sessiondata["Session aggregation"]
end

subgraph group_infrastructure["Shared infrastructure"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_postgres[("PostgreSQL")]
  node_ratelimit["Rate limiting<br/>[rate-limit.ts]"]
  node_redis[("Upstash Redis")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_login
node_visitor -->|"opens"| node_register
node_login -->|"submits credentials"| node_authroute
node_register -->|"creates account"| node_actions
node_authroute -->|"dispatches"| node_auth
node_auth -->|"reads account"| node_prisma
node_auth -->|"checks attempts"| node_ratelimit
node_visitor -->|"opens signed-in view"| node_dashboard
node_dashboard -->|"checks session"| node_auth
node_dashboard -->|"presents entry"| node_entryform
node_entryform -->|"submits session"| node_actions
node_edit -->|"updates session"| node_actions
node_remove -->|"deletes session"| node_actions
node_history -->|"checks session"| node_auth
node_history -->|"reads history"| node_prisma
node_actions -->|"checks session"| node_auth
node_actions -->|"checks writes"| node_ratelimit
node_actions -->|"writes records"| node_prisma
node_actions -->|"invalidates study data"| node_cache
node_visitor -->|"opens reflections"| node_reflectionpage
node_reflectionpage -->|"checks session"| node_auth
node_reflectionpage -->|"reads reflections"| node_prisma
node_reflectionpage -->|"presents entries"| node_reflectionform
node_reflectionform -->|"submits reflection"| node_reflectionactions
node_reflectionactions -->|"persists reflection"| node_prisma
node_dashboard -->|"shows calendar"| node_calendar
node_calendar -->|"requests month data"| node_calendarapi
node_calendarapi -->|"checks session"| node_auth
node_calendarapi -->|"gets calendar data"| node_cache
node_dashboard -->|"shows progress"| node_charts
node_charts -->|"requests timeframe data"| node_chartapi
node_chartapi -->|"checks session"| node_auth
node_chartapi -->|"gets chart data"| node_cache
node_cache -->|"loads aggregates"| node_sessiondata
node_sessiondata -->|"queries sessions"| node_prisma
node_prisma -->|"reads and writes"| node_postgres
node_ratelimit -.->|"checks counters"| node_redis
node_settings -->|"requests account changes"| node_actions

click node_login "https://github.com/aryamaandash/track-my-studying/blob/main/app/login/page.tsx"
click node_register "https://github.com/aryamaandash/track-my-studying/blob/main/app/register/page.tsx"
click node_authroute "https://github.com/aryamaandash/track-my-studying/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth "https://github.com/aryamaandash/track-my-studying/blob/main/auth.ts"
click node_settings "https://github.com/aryamaandash/track-my-studying/blob/main/app/settings/page.tsx"
click node_dashboard "https://github.com/aryamaandash/track-my-studying/blob/main/app/dashboard/page.tsx"
click node_entryform "https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyEntryForm.tsx"
click node_actions "https://github.com/aryamaandash/track-my-studying/blob/main/app/actions.ts"
click node_history "https://github.com/aryamaandash/track-my-studying/blob/main/app/remove-hours/page.tsx"
click node_edit "https://github.com/aryamaandash/track-my-studying/blob/main/components/EditStudySessionButton.tsx"
click node_remove "https://github.com/aryamaandash/track-my-studying/blob/main/components/RemoveStudySessionButton.tsx"
click node_reflectionpage "https://github.com/aryamaandash/track-my-studying/blob/main/app/weekly-reflection/page.tsx"
click node_reflectionform "https://github.com/aryamaandash/track-my-studying/blob/main/components/WeeklyReflectionForm.tsx"
click node_reflectionactions "https://github.com/aryamaandash/track-my-studying/blob/main/app/weekly-reflection/actions.ts"
click node_calendar "https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyCalendar.tsx"
click node_calendarapi "https://github.com/aryamaandash/track-my-studying/blob/main/app/api/study-sessions/calendar/route.ts"
click node_charts "https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyCharts.tsx"
click node_chartapi "https://github.com/aryamaandash/track-my-studying/blob/main/app/api/study-sessions/chart/route.ts"
click node_cache "https://github.com/aryamaandash/track-my-studying/blob/main/lib/study-cache.ts"
click node_sessiondata "https://github.com/aryamaandash/track-my-studying/blob/main/lib/study-session-data.ts"
click node_prisma "https://github.com/aryamaandash/track-my-studying/blob/main/lib/prisma.ts"
click node_ratelimit "https://github.com/aryamaandash/track-my-studying/blob/main/lib/rate-limit.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_login,node_register,node_authroute,node_auth,node_settings toneBlue
class node_dashboard,node_entryform,node_actions,node_history,node_edit,node_remove,node_reflectionpage,node_reflectionform,node_reflectionactions toneAmber
class node_calendar,node_calendarapi,node_charts,node_chartapi,node_cache,node_sessiondata toneMint
class node_prisma,node_postgres,node_ratelimit,node_redis toneRose
class node_visitor toneIndigo
```

## Components

### Accounts

- [Login page](https://github.com/aryamaandash/track-my-studying/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Register page](https://github.com/aryamaandash/track-my-studying/blob/main/app/register/page.tsx): `app/register/page.tsx`
- [Auth endpoint](https://github.com/aryamaandash/track-my-studying/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [Auth services](https://github.com/aryamaandash/track-my-studying/blob/main/auth.ts): `auth.ts`
- [Account settings](https://github.com/aryamaandash/track-my-studying/blob/main/app/settings/page.tsx): `app/settings/page.tsx`

### Study journal

- [Study dashboard](https://github.com/aryamaandash/track-my-studying/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Session entry form](https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyEntryForm.tsx): `components/StudyEntryForm.tsx`
- [Study actions](https://github.com/aryamaandash/track-my-studying/blob/main/app/actions.ts): `app/actions.ts`
- [Session history](https://github.com/aryamaandash/track-my-studying/blob/main/app/remove-hours/page.tsx): `app/remove-hours/page.tsx`
- [Edit session](https://github.com/aryamaandash/track-my-studying/blob/main/components/EditStudySessionButton.tsx): `components/EditStudySessionButton.tsx`
- [Remove session](https://github.com/aryamaandash/track-my-studying/blob/main/components/RemoveStudySessionButton.tsx): `components/RemoveStudySessionButton.tsx`
- [Weekly reflections](https://github.com/aryamaandash/track-my-studying/blob/main/app/weekly-reflection/page.tsx): `app/weekly-reflection/page.tsx`
- [Reflection form](https://github.com/aryamaandash/track-my-studying/blob/main/components/WeeklyReflectionForm.tsx): `components/WeeklyReflectionForm.tsx`
- [Reflection actions](https://github.com/aryamaandash/track-my-studying/blob/main/app/weekly-reflection/actions.ts): `app/weekly-reflection/actions.ts`

### Progress views

- [Study calendar](https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyCalendar.tsx): `components/StudyCalendar.tsx`
- [Calendar endpoint](https://github.com/aryamaandash/track-my-studying/blob/main/app/api/study-sessions/calendar/route.ts): `app/api/study-sessions/calendar/route.ts`
- [Study charts](https://github.com/aryamaandash/track-my-studying/blob/main/components/StudyCharts.tsx): `components/StudyCharts.tsx`
- [Chart endpoint](https://github.com/aryamaandash/track-my-studying/blob/main/app/api/study-sessions/chart/route.ts): `app/api/study-sessions/chart/route.ts`
- [Study data cache](https://github.com/aryamaandash/track-my-studying/blob/main/lib/study-cache.ts): `lib/study-cache.ts`
- [Session aggregation](https://github.com/aryamaandash/track-my-studying/blob/main/lib/study-session-data.ts): `lib/study-session-data.ts`

### Shared infrastructure

- [Prisma client](https://github.com/aryamaandash/track-my-studying/blob/main/lib/prisma.ts): `lib/prisma.ts`
- **PostgreSQL**
- [Rate limiting](https://github.com/aryamaandash/track-my-studying/blob/main/lib/rate-limit.ts): `lib/rate-limit.ts`
- **Upstash Redis**

### Other components

- **Visitor**

## Connections

- Visitor → Login page: opens
- Visitor → Register page: opens
- Login page → Auth endpoint: submits credentials
- Register page → Study actions: creates account
- Auth endpoint → Auth services: dispatches
- Auth services → Prisma client: reads account
- Auth services → Rate limiting: checks attempts
- Visitor → Study dashboard: opens signed-in view
- Study dashboard → Auth services: checks session
- Study dashboard → Session entry form: presents entry
- Session entry form → Study actions: submits session
- Edit session → Study actions: updates session
- Remove session → Study actions: deletes session
- Session history → Auth services: checks session
- Session history → Prisma client: reads history
- Study actions → Auth services: checks session
- Study actions → Rate limiting: checks writes
- Study actions → Prisma client: writes records
- Study actions → Study data cache: invalidates study data
- Visitor → Weekly reflections: opens reflections
- Weekly reflections → Auth services: checks session
- Weekly reflections → Prisma client: reads reflections
- Weekly reflections → Reflection form: presents entries
- Reflection form → Reflection actions: submits reflection
- Reflection actions → Prisma client: persists reflection
- Study dashboard → Study calendar: shows calendar
- Study calendar → Calendar endpoint: requests month data
- Calendar endpoint → Auth services: checks session
- Calendar endpoint → Study data cache: gets calendar data
- Study dashboard → Study charts: shows progress
- Study charts → Chart endpoint: requests timeframe data
- Chart endpoint → Auth services: checks session
- Chart endpoint → Study data cache: gets chart data
- Study data cache → Session aggregation: loads aggregates
- Session aggregation → Prisma client: queries sessions
- Prisma client → PostgreSQL: reads and writes
- Rate limiting → Upstash Redis: checks counters
- Account settings → Study actions: requests account changes
