# oolemonteaoo/tcd-student-planner architecture

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

- Interactive diagram: https://gitdiagram.com/oolemonteaoo/tcd-student-planner
- Repository: https://github.com/oolemonteaoo/tcd-student-planner

## Overview

TCD Student Planner lets students register or log in, then manage courses, assignments, notes, and grades through a React interface backed by a FastAPI API and PostgreSQL. The dashboard presents course and assignment overviews, while grade summaries calculate weighted averages and remaining weight. The graph includes the documented responsive, routed interface and persistent theme preference. Some backend router and frontend page implementations are unsampled; their capabilities are retained, but uncertain connections are omitted or marked unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/App.tsx) (SPA routes), [`backend/app/main.py`](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/main.py) (FastAPI application), [`backend/app/routers/dependencies.py`](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/dependencies.py) (Auth dependency), [`backend/app/database/session.py`](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/database/session.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Student interface"]
  node_app["SPA routes<br/>[App.tsx]"]
  node_auth_ui["Auth context<br/>[auth.tsx]"]
  node_login["Login and register<br/>[Login.tsx]"]
  node_layout["Protected layout<br/>[Layout.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_courses_ui["Course management<br/>[Courses.tsx]"]
  node_assignments_ui["Assignment management<br/>[Assignments.tsx]"]
  node_notes_ui["Notes and search<br/>[Notes.tsx]"]
  node_grades_ui["Grade tracking<br/>[Grades.tsx]"]
  node_theme["Theme preference<br/>[theme.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_auth_router["Authentication routes<br/>[auth.py]"]
  node_user_routes["Profile route<br/>[users.py]"]
  node_course_routes["Course routes<br/>[courses.py]"]
  node_assignment_routes["Assignment routes<br/>[assignments.py]"]
  node_notes_routes["Notes routes<br/>[notes.py]"]
  node_grade_routes["Grade routes<br/>[grades.py]"]
  node_auth_service["Password and tokens<br/>[auth.py]"]
  node_identity["Auth dependency<br/>[dependencies.py]"]
end

subgraph group_data["Domain data"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_postgres[("PostgreSQL")]
  node_user_model["User model<br/>[user.py]"]
  node_course_model["Course model<br/>[course.py]"]
  node_assignment_model["Assignment model<br/>[assignment.py]"]
  node_note_model["Note model<br/>[note.py]"]
  node_grade_model["Grade model<br/>[grade.py]"]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"protects routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_courses_ui
node_app -->|"routes to"| node_assignments_ui
node_app -->|"routes to"| node_notes_ui
node_app -->|"routes to"| node_grades_ui
node_auth_ui -.->|"serves"| node_login
node_login -.->|"authenticates"| node_auth_ui
node_layout -->|"uses"| node_theme
node_dashboard -->|"requests data"| node_api_client
node_courses_ui -->|"requests data"| node_api_client
node_assignments_ui -->|"requests data"| node_api_client
node_notes_ui -->|"requests data"| node_api_client
node_grades_ui -->|"requests data"| node_api_client
node_api_client -->|"sends API requests"| node_fastapi
node_fastapi -->|"registers"| node_auth_router
node_fastapi -->|"registers"| node_user_routes
node_fastapi -->|"registers"| node_course_routes
node_fastapi -->|"registers"| node_assignment_routes
node_fastapi -->|"registers"| node_notes_routes
node_fastapi -->|"registers"| node_grade_routes
node_auth_router -->|"uses"| node_auth_service
node_auth_router -->|"opens session"| node_db_session
node_identity -->|"opens session"| node_db_session
node_identity -->|"loads user"| node_user_model
node_course_routes -->|"queries"| node_db_session
node_assignment_routes -->|"queries"| node_db_session
node_notes_routes -->|"queries"| node_db_session
node_grade_routes -->|"queries"| node_db_session
node_grade_routes -->|"authenticates via"| node_identity
node_assignment_routes -->|"authenticates via"| node_identity
node_course_routes -->|"authenticates via"| node_identity
node_notes_routes -->|"authenticates via"| node_identity
node_user_routes -->|"authenticates via"| node_identity
node_auth_router -->|"reads and writes"| node_user_model
node_course_routes -->|"reads and writes"| node_course_model
node_assignment_routes -->|"reads and writes"| node_assignment_model
node_notes_routes -->|"reads and writes"| node_note_model
node_grade_routes -->|"reads and writes"| node_grade_model
node_grade_routes -->|"checks ownership"| node_course_model
node_db_session -->|"connects to"| node_postgres

click node_app "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/App.tsx"
click node_auth_ui "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/auth.tsx"
click node_login "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Login.tsx"
click node_layout "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/components/Layout.tsx"
click node_dashboard "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Dashboard.tsx"
click node_courses_ui "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Courses.tsx"
click node_assignments_ui "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Assignments.tsx"
click node_notes_ui "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Notes.tsx"
click node_grades_ui "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Grades.tsx"
click node_theme "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/theme.tsx"
click node_api_client "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/api.ts"
click node_fastapi "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/main.py"
click node_auth_router "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/auth.py"
click node_user_routes "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/users.py"
click node_course_routes "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/courses.py"
click node_assignment_routes "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/assignments.py"
click node_notes_routes "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/notes.py"
click node_grade_routes "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/grades.py"
click node_auth_service "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/services/auth.py"
click node_identity "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/dependencies.py"
click node_db_session "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/database/session.py"
click node_user_model "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/user.py"
click node_course_model "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/course.py"
click node_assignment_model "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/assignment.py"
click node_note_model "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/note.py"
click node_grade_model "https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/grade.py"

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_login,node_layout,node_dashboard,node_courses_ui,node_assignments_ui,node_notes_ui,node_grades_ui,node_theme,node_api_client toneBlue
class node_fastapi,node_auth_router,node_user_routes,node_course_routes,node_assignment_routes,node_notes_routes,node_grade_routes,node_auth_service,node_identity toneAmber
class node_db_session,node_postgres,node_user_model,node_course_model,node_assignment_model,node_note_model,node_grade_model toneMint
class node_student toneIndigo
```

## Components

### Student interface

- [SPA routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth context](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/auth.tsx): `frontend/src/auth.tsx`
- [Login and register](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Protected layout](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/components/Layout.tsx): `frontend/src/components/Layout.tsx`
- [Dashboard](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Course management](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Courses.tsx): `frontend/src/pages/Courses.tsx`
- [Assignment management](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Assignments.tsx): `frontend/src/pages/Assignments.tsx`
- [Notes and search](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Notes.tsx): `frontend/src/pages/Notes.tsx`
- [Grade tracking](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/pages/Grades.tsx): `frontend/src/pages/Grades.tsx`
- [Theme preference](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/theme.tsx): `frontend/src/theme.tsx`
- [API client](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/frontend/src/api.ts): `frontend/src/api.ts`

### API and identity

- [FastAPI application](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Profile route](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/users.py): `backend/app/routers/users.py`
- [Course routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/courses.py): `backend/app/routers/courses.py`
- [Assignment routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/assignments.py): `backend/app/routers/assignments.py`
- [Notes routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/notes.py): `backend/app/routers/notes.py`
- [Grade routes](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/grades.py): `backend/app/routers/grades.py`
- [Password and tokens](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/services/auth.py): `backend/app/services/auth.py`
- [Auth dependency](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/routers/dependencies.py): `backend/app/routers/dependencies.py`

### Domain data

- [Database sessions](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/database/session.py): `backend/app/database/session.py`
- **PostgreSQL**
- [User model](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/user.py): `backend/app/models/user.py`
- [Course model](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/course.py): `backend/app/models/course.py`
- [Assignment model](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/assignment.py): `backend/app/models/assignment.py`
- [Note model](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/note.py): `backend/app/models/note.py`
- [Grade model](https://github.com/oolemonteaoo/tcd-student-planner/blob/develop/backend/app/models/grade.py): `backend/app/models/grade.py`

### Other components

- **Student**

## Connections

- Student → SPA routes: uses (evidence: `README.md`)
- SPA routes → Login and register: routes to (evidence: `frontend/src/App.tsx`)
- SPA routes → Protected layout: protects routes (evidence: `frontend/src/App.tsx`)
- SPA routes → Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- SPA routes → Course management: routes to (evidence: `frontend/src/App.tsx`)
- SPA routes → Assignment management: routes to (evidence: `frontend/src/App.tsx`)
- SPA routes → Notes and search: routes to (evidence: `frontend/src/App.tsx`)
- SPA routes → Grade tracking: routes to (evidence: `frontend/src/App.tsx`)
- Auth context → Login and register: serves (evidence: `frontend/src/pages/Login.tsx`)
- Login and register → Auth context: authenticates (evidence: `frontend/src/pages/Login.tsx`)
- Protected layout → Theme preference: uses (evidence: `frontend/src/components/Layout.tsx`)
- Dashboard → API client: requests data (evidence: `frontend/src/pages/Dashboard.tsx`)
- Course management → API client: requests data (evidence: `frontend/src/pages/Courses.tsx`)
- Assignment management → API client: requests data (evidence: `frontend/src/pages/Assignments.tsx`)
- Notes and search → API client: requests data (evidence: `frontend/src/pages/Notes.tsx`)
- Grade tracking → API client: requests data (evidence: `frontend/src/pages/Grades.tsx`)
- API client → FastAPI application: sends API requests (evidence: `README.md`)
- FastAPI application → Authentication routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Profile route: registers (evidence: `backend/app/main.py`)
- FastAPI application → Course routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Assignment routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Notes routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Grade routes: registers (evidence: `backend/app/main.py`)
- Authentication routes → Password and tokens: uses (evidence: `backend/app/routers/auth.py`)
- Authentication routes → Database sessions: opens session (evidence: `backend/app/routers/auth.py`)
- Auth dependency → Database sessions: opens session (evidence: `backend/app/routers/dependencies.py`)
- Auth dependency → User model: loads user (evidence: `backend/app/routers/dependencies.py`)
- Course routes → Database sessions: queries (evidence: `backend/app/routers/courses.py`)
- Assignment routes → Database sessions: queries (evidence: `backend/app/routers/assignments.py`)
- Notes routes → Database sessions: queries (evidence: `backend/app/routers/notes.py`)
- Grade routes → Database sessions: queries (evidence: `backend/app/routers/grades.py`)
- Grade routes → Auth dependency: authenticates via (evidence: `backend/app/routers/grades.py`)
- Assignment routes → Auth dependency: authenticates via (evidence: `backend/app/routers/assignments.py`)
- Course routes → Auth dependency: authenticates via (evidence: `backend/app/routers/courses.py`)
- Notes routes → Auth dependency: authenticates via (evidence: `backend/app/routers/notes.py`)
- Profile route → Auth dependency: authenticates via (evidence: `backend/app/routers/users.py`)
- Authentication routes → User model: reads and writes (evidence: `backend/app/routers/auth.py`)
- Course routes → Course model: reads and writes (evidence: `backend/app/routers/courses.py`)
- Assignment routes → Assignment model: reads and writes (evidence: `backend/app/routers/assignments.py`)
- Notes routes → Note model: reads and writes (evidence: `backend/app/routers/notes.py`)
- Grade routes → Grade model: reads and writes (evidence: `backend/app/routers/grades.py`)
- Grade routes → Course model: checks ownership (evidence: `backend/app/routers/grades.py`)
- Database sessions → PostgreSQL: connects to (evidence: `README.md`)
