# johanderick562008/freeboard architecture

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

- Interactive diagram: https://gitdiagram.com/johanderick562008/freeboard
- Repository: https://github.com/johanderick562008/freeboard

## Overview

FreeBoard is a student timetable and connection platform. Students use the web frontend to authenticate, manage profiles and connections, edit timetables, and check live availability or compare schedules. The documented frontend-to-API relationship and Google OAuth and MySQL integrations are shown; the excerpts also establish backend routing, session validation, and database access. Frontend internals and some backend behavior were not sampled, so their internal call paths are left unspecified.

Main entry points: [`backend/app/database.py`](https://github.com/johanderick562008/freeboard/blob/main/backend/app/database.py) (Database sessions), [`backend/app/security.py`](https://github.com/johanderick562008/freeboard/blob/main/backend/app/security.py) (Session security), [`backend/app/main.py`](https://github.com/johanderick562008/freeboard/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/models.py`](https://github.com/johanderick562008/freeboard/blob/main/backend/app/models.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["FreeBoard frontend<br/>[index.html]"]
  node_frontend_app["App interface<br/>[app.js]"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_api["API features"]
  node_auth["Google sign-in<br/>[auth.py]"]
  node_users["Profiles and connections<br/>[users.py]"]
  node_timetable["Timetable management<br/>[timetable.py]"]
  node_schedule["Availability and compare<br/>[schedule.py]"]
  node_periods["Period settings<br/>[settings.py]"]
end

subgraph group_core["Backend core"]
  node_entry["FastAPI app<br/>[main.py]"]
  node_security["Session security<br/>[security.py]"]
  node_schemas["Request and response models<br/>[schemas.py]"]
  node_models["Domain models<br/>[models.py]"]
end

subgraph group_state["Persistent state"]
  node_database["Database sessions<br/>[database.py]"]
  node_mysql[("MySQL database")]
end

node_student(("Student"))
node_google["Google OAuth"]

node_student -->|"uses"| node_frontend
node_frontend -->|"HTTP API"| node_entry
node_entry -->|"registers"| node_auth
node_entry -->|"registers"| node_users
node_entry -->|"registers"| node_timetable
node_entry -->|"registers"| node_schedule
node_entry -->|"registers"| node_periods
node_auth -->|"authenticates with"| node_google
node_auth -->|"creates session"| node_security
node_auth -->|"gets session"| node_database
node_auth -->|"queries users"| node_models
node_users -->|"validates session"| node_security
node_users -->|"queries and updates"| node_database
node_users -->|"uses"| node_models
node_users -->|"validates and formats"| node_schemas
node_timetable -->|"validates session"| node_security
node_timetable -->|"queries and updates"| node_database
node_timetable -->|"uses"| node_models
node_timetable -->|"validates input"| node_schemas
node_schedule -->|"validates session"| node_security
node_schedule -->|"queries"| node_database
node_schedule -->|"reads schedules"| node_models
node_periods -->|"validates session"| node_security
node_periods -->|"reads and writes"| node_database
node_security -->|"gets session"| node_database
node_security -->|"loads user"| node_models
node_models -->|"uses base"| node_database
node_database -->|"connects to"| node_mysql

click node_frontend "https://github.com/johanderick562008/freeboard/blob/main/frontend/index.html"
click node_frontend_app "https://github.com/johanderick562008/freeboard/blob/main/frontend/js/app.js"
click node_frontend_api "https://github.com/johanderick562008/freeboard/blob/main/frontend/js/api.js"
click node_entry "https://github.com/johanderick562008/freeboard/blob/main/backend/app/main.py"
click node_auth "https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/auth.py"
click node_users "https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/users.py"
click node_timetable "https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/timetable.py"
click node_schedule "https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/schedule.py"
click node_periods "https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/settings.py"
click node_security "https://github.com/johanderick562008/freeboard/blob/main/backend/app/security.py"
click node_schemas "https://github.com/johanderick562008/freeboard/blob/main/backend/app/schemas.py"
click node_models "https://github.com/johanderick562008/freeboard/blob/main/backend/app/models.py"
click node_database "https://github.com/johanderick562008/freeboard/blob/main/backend/app/database.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_frontend,node_frontend_app,node_frontend_api toneBlue
class node_auth,node_users,node_timetable,node_schedule,node_periods toneAmber
class node_entry,node_security,node_schemas,node_models toneMint
class node_database,node_mysql toneRose
class node_student,node_google toneIndigo
```

## Components

### Web client

- [FreeBoard frontend](https://github.com/johanderick562008/freeboard/blob/main/frontend/index.html): `frontend/index.html`
- [App interface](https://github.com/johanderick562008/freeboard/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [API client](https://github.com/johanderick562008/freeboard/blob/main/frontend/js/api.js): `frontend/js/api.js`

### API features

- [Google sign-in](https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Profiles and connections](https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/users.py): `backend/app/routers/users.py`
- [Timetable management](https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/timetable.py): `backend/app/routers/timetable.py`
- [Availability and compare](https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/schedule.py): `backend/app/routers/schedule.py`
- [Period settings](https://github.com/johanderick562008/freeboard/blob/main/backend/app/routers/settings.py): `backend/app/routers/settings.py`

### Backend core

- [FastAPI app](https://github.com/johanderick562008/freeboard/blob/main/backend/app/main.py): `backend/app/main.py`
- [Session security](https://github.com/johanderick562008/freeboard/blob/main/backend/app/security.py): `backend/app/security.py`
- [Request and response models](https://github.com/johanderick562008/freeboard/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Domain models](https://github.com/johanderick562008/freeboard/blob/main/backend/app/models.py): `backend/app/models.py`

### Persistent state

- [Database sessions](https://github.com/johanderick562008/freeboard/blob/main/backend/app/database.py): `backend/app/database.py`
- **MySQL database**

### Other components

- **Student**
- **Google OAuth**

## Connections

- Student → FreeBoard frontend: uses (evidence: `README.md`)
- FreeBoard frontend → FastAPI app: HTTP API (evidence: `README.md`)
- FastAPI app → Google sign-in: registers (evidence: `backend/app/main.py`)
- FastAPI app → Profiles and connections: registers (evidence: `backend/app/main.py`)
- FastAPI app → Timetable management: registers (evidence: `backend/app/main.py`)
- FastAPI app → Availability and compare: registers (evidence: `backend/app/main.py`)
- FastAPI app → Period settings: registers (evidence: `backend/app/main.py`)
- Google sign-in → Google OAuth: authenticates with (evidence: `README.md`)
- Google sign-in → Session security: creates session (evidence: `backend/app/routers/auth.py`)
- Google sign-in → Database sessions: gets session (evidence: `backend/app/routers/auth.py`)
- Google sign-in → Domain models: queries users (evidence: `backend/app/routers/auth.py`)
- Profiles and connections → Session security: validates session (evidence: `backend/app/routers/users.py`)
- Profiles and connections → Database sessions: queries and updates (evidence: `backend/app/routers/users.py`)
- Profiles and connections → Domain models: uses (evidence: `backend/app/routers/users.py`)
- Profiles and connections → Request and response models: validates and formats (evidence: `backend/app/routers/users.py`)
- Timetable management → Session security: validates session (evidence: `backend/app/routers/timetable.py`)
- Timetable management → Database sessions: queries and updates (evidence: `backend/app/routers/timetable.py`)
- Timetable management → Domain models: uses (evidence: `backend/app/routers/timetable.py`)
- Timetable management → Request and response models: validates input (evidence: `backend/app/routers/timetable.py`)
- Availability and compare → Session security: validates session (evidence: `backend/app/routers/schedule.py`)
- Availability and compare → Database sessions: queries (evidence: `backend/app/routers/schedule.py`)
- Availability and compare → Domain models: reads schedules (evidence: `backend/app/routers/schedule.py`)
- Period settings → Session security: validates session (evidence: `backend/app/routers/settings.py`)
- Period settings → Database sessions: reads and writes (evidence: `backend/app/routers/settings.py`)
- Session security → Database sessions: gets session (evidence: `backend/app/security.py`)
- Session security → Domain models: loads user (evidence: `backend/app/security.py`)
- Domain models → Database sessions: uses base (evidence: `backend/app/models.py`)
- Database sessions → MySQL database: connects to (evidence: `README.md`)
