# zerappare/assignment-hub architecture

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

- Interactive diagram: https://gitdiagram.com/zerappare/assignment-hub
- Repository: https://github.com/zerappare/assignment-hub

## Overview

Assignment Hub consolidates student assignments from Google Classroom and Microsoft Teams into a dashboard for tracking, scheduling, and reminders, with a separate admin console. Students sign in through OAuth, view or sync assignments, manage personal status and schedule settings, and receive configured email reminders; administrators inspect users, errors, health, and business metrics. The graph preserves the documented product areas, but several route implementations were not excerpted, so their internal calls are not asserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/App.jsx) (React app), [`backend/src/db.js`](https://github.com/zerappare/assignment-hub/blob/main/backend/src/db.js) (MySQL database), [`backend/src/services/oauthSession.js`](https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/oauthSession.js) (OAuth session), [`frontend/src/useAssignments.js`](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/useAssignments.js) (Assignment state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student_ui["Student experience"]
  node_web_app["React app<br/>[App.jsx]"]
  node_login["Login page<br/>[LoginPage.jsx]"]
  node_dashboard["Dashboard<br/>[HomePage.jsx]"]
  node_assignment_pages["Assignment views"]
  node_assignment_state["Assignment state<br/>[useAssignments.js]"]
  node_task_rules["Task rules<br/>[tasks.js]"]
  node_classroom_stream["Classroom stream<br/>[StreamPage.jsx]"]
  node_schedule_ui["Schedule views<br/>[Schedule.jsx]"]
  node_settings_ui["Settings<br/>[SettingsPage.jsx]"]
  node_notification_settings["Reminder settings"]
end

subgraph group_backend["Application backend"]
  node_api_server["Express API<br/>[server.js]"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_oauth_session["OAuth session<br/>[oauthSession.js]"]
  node_auth_guard["Account authorization<br/>[auth.js]"]
  node_assignment_api["Assignment API<br/>[assignments.js]"]
  node_classroom_api["Classroom sync API<br/>[classroom.js]"]
  node_schedule_api["Schedule API<br/>[schedules.js]"]
  node_notification_api["Notification API<br/>[notifications.js]"]
  node_reminder_sender["Reminder sender"]
  node_database[("MySQL database<br/>[db.js]")]
  node_analytics_service["Analytics service<br/>[analytics.js]"]
end

subgraph group_integrations["External services"]
  node_oauth_providers["Google and Microsoft"]
  node_classroom_service["Classroom and Teams"]
  node_mail_service["SMTP email"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin console"]
  node_admin_api["Admin API<br/>[admin.js]"]
  node_business_api["Business analytics API<br/>[adminBusiness.js]"]
end

node_student(("Student"))
node_admin_user(("Administrator"))

node_student -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_login
node_web_app -->|"routes to"| node_dashboard
node_web_app -->|"routes to"| node_assignment_pages
node_web_app -->|"routes to"| node_classroom_stream
node_web_app -->|"routes to"| node_schedule_ui
node_web_app -->|"routes to"| node_settings_ui
node_login -->|"requests login"| node_api_server
node_login -->|"authenticates with"| node_oauth_providers
node_api_server -->|"mounts"| node_auth_routes
node_auth_routes -->|"uses"| node_oauth_session
node_oauth_session -->|"exchanges credentials"| node_oauth_providers
node_oauth_session -->|"reads and writes"| node_database
node_dashboard -->|"loads state"| node_assignment_state
node_assignment_pages -->|"shares state"| node_assignment_state
node_assignment_state -->|"normalizes tasks"| node_task_rules
node_assignment_state -->|"requests assignments"| node_assignment_api
node_dashboard -->|"requests sync"| node_classroom_api
node_classroom_api -.->|"syncs coursework"| node_classroom_service
node_assignment_api -.->|"reads and writes"| node_database
node_schedule_ui -.->|"requests schedule"| node_schedule_api
node_schedule_api -->|"reads and writes"| node_database
node_settings_ui -->|"renders"| node_notification_settings
node_notification_settings -->|"saves preferences"| node_notification_api
node_api_server -->|"starts sender"| node_reminder_sender
node_reminder_sender -->|"reads reminders"| node_database
node_reminder_sender -->|"sends email"| node_mail_service
node_admin_user -->|"uses"| node_admin_ui
node_web_app -->|"routes to"| node_admin_ui
node_admin_ui -.->|"requests admin data"| node_admin_api
node_admin_ui -->|"requests business metrics"| node_business_api
node_admin_api -->|"reads and writes"| node_database
node_business_api -.->|"queries metrics"| node_database
node_oauth_session -->|"tracks sign-in"| node_analytics_service
node_notification_api -.->|"stores preferences"| node_database

click node_web_app "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/LoginPage.jsx"
click node_dashboard "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/HomePage.jsx"
click node_assignment_pages "https://github.com/zerappare/assignment-hub/tree/main/frontend/src/pages"
click node_assignment_state "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/useAssignments.js"
click node_task_rules "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/tasks.js"
click node_classroom_stream "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/StreamPage.jsx"
click node_schedule_ui "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/Schedule.jsx"
click node_settings_ui "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/SettingsPage.jsx"
click node_notification_settings "https://github.com/zerappare/assignment-hub/blob/main/frontend/src/components/NotificationSettings.jsx"
click node_api_server "https://github.com/zerappare/assignment-hub/blob/main/backend/server.js"
click node_auth_routes "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/auth.js"
click node_oauth_session "https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/oauthSession.js"
click node_auth_guard "https://github.com/zerappare/assignment-hub/blob/main/backend/src/middleware/auth.js"
click node_assignment_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/assignments.js"
click node_classroom_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/classroom.js"
click node_schedule_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/schedules.js"
click node_notification_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/notifications.js"
click node_reminder_sender "https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/notificationSender.js"
click node_database "https://github.com/zerappare/assignment-hub/blob/main/backend/src/db.js"
click node_admin_ui "https://github.com/zerappare/assignment-hub/tree/main/frontend/src/pages/admin"
click node_admin_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/admin.js"
click node_business_api "https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/adminBusiness.js"
click node_analytics_service "https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/analytics.js"

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_web_app,node_login,node_dashboard,node_assignment_pages,node_assignment_state,node_task_rules,node_classroom_stream,node_schedule_ui,node_settings_ui,node_notification_settings toneBlue
class node_api_server,node_auth_routes,node_oauth_session,node_auth_guard,node_assignment_api,node_classroom_api,node_schedule_api,node_notification_api,node_reminder_sender,node_database,node_analytics_service toneAmber
class node_oauth_providers,node_classroom_service,node_mail_service toneMint
class node_admin_ui,node_admin_api,node_business_api toneRose
class node_student,node_admin_user toneIndigo
```

## Components

### Student experience

- [React app](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login page](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`
- [Dashboard](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Assignment views](https://github.com/zerappare/assignment-hub/tree/main/frontend/src/pages): `frontend/src/pages`
- [Assignment state](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/useAssignments.js): `frontend/src/useAssignments.js`
- [Task rules](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/tasks.js): `frontend/src/tasks.js`
- [Classroom stream](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/StreamPage.jsx): `frontend/src/pages/StreamPage.jsx`
- [Schedule views](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/Schedule.jsx): `frontend/src/pages/Schedule.jsx`
- [Settings](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/pages/SettingsPage.jsx): `frontend/src/pages/SettingsPage.jsx`
- [Reminder settings](https://github.com/zerappare/assignment-hub/blob/main/frontend/src/components/NotificationSettings.jsx): `frontend/src/components/NotificationSettings.jsx`

### Application backend

- [Express API](https://github.com/zerappare/assignment-hub/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [OAuth session](https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/oauthSession.js): `backend/src/services/oauthSession.js`
- [Account authorization](https://github.com/zerappare/assignment-hub/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Assignment API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/assignments.js): `backend/src/routes/assignments.js`
- [Classroom sync API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/classroom.js): `backend/src/routes/classroom.js`
- [Schedule API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/schedules.js): `backend/src/routes/schedules.js`
- [Notification API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/notifications.js): `backend/src/routes/notifications.js`
- [Reminder sender](https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/notificationSender.js): `backend/src/services/notificationSender.js`
- [MySQL database](https://github.com/zerappare/assignment-hub/blob/main/backend/src/db.js): `backend/src/db.js`
- [Analytics service](https://github.com/zerappare/assignment-hub/blob/main/backend/src/services/analytics.js): `backend/src/services/analytics.js`

### External services

- **Google and Microsoft**
- **Classroom and Teams**
- **SMTP email**

### Administration

- [Admin console](https://github.com/zerappare/assignment-hub/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Admin API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/admin.js): `backend/src/routes/admin.js`
- [Business analytics API](https://github.com/zerappare/assignment-hub/blob/main/backend/src/routes/adminBusiness.js): `backend/src/routes/adminBusiness.js`

### Other components

- **Student**
- **Administrator**

## Connections

- Student → React app: uses (evidence: `README.md`)
- React app → Login page: routes to (evidence: `frontend/src/App.jsx`)
- React app → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React app → Assignment views: routes to (evidence: `frontend/src/App.jsx`)
- React app → Classroom stream: routes to (evidence: `frontend/src/App.jsx`)
- React app → Schedule views: routes to (evidence: `frontend/src/App.jsx`)
- React app → Settings: routes to (evidence: `frontend/src/App.jsx`)
- Login page → Express API: requests login (evidence: `README.md`)
- Login page → Google and Microsoft: authenticates with (evidence: `README.md`)
- Express API → Authentication routes: mounts (evidence: `backend/server.js`)
- Authentication routes → OAuth session: uses (evidence: `backend/src/routes/auth.js`)
- OAuth session → Google and Microsoft: exchanges credentials
- OAuth session → MySQL database: reads and writes (evidence: `backend/src/services/oauthSession.js`)
- Dashboard → Assignment state: loads state (evidence: `frontend/src/pages/HomePage.jsx`)
- Assignment views → Assignment state: shares state (evidence: `frontend/src/pages/StreamPage.jsx`)
- Assignment state → Task rules: normalizes tasks (evidence: `frontend/src/useAssignments.js`)
- Assignment state → Assignment API: requests assignments (evidence: `README.md`)
- Dashboard → Classroom sync API: requests sync (evidence: `README.md`)
- Classroom sync API → Classroom and Teams: syncs coursework
- Assignment API → MySQL database: reads and writes
- Schedule views → Schedule API: requests schedule
- Schedule API → MySQL database: reads and writes (evidence: `backend/src/routes/schedules.js`)
- Settings → Reminder settings: renders (evidence: `frontend/src/pages/SettingsPage.jsx`)
- Reminder settings → Notification API: saves preferences (evidence: `README.md`)
- Express API → Reminder sender: starts sender (evidence: `backend/server.js`)
- Reminder sender → MySQL database: reads reminders (evidence: `backend/src/services/notificationSender.js`)
- Reminder sender → SMTP email: sends email (evidence: `backend/src/services/notificationSender.js`)
- Administrator → Admin console: uses (evidence: `README.md`)
- React app → Admin console: routes to (evidence: `frontend/src/App.jsx`)
- Admin console → Admin API: requests admin data
- Admin console → Business analytics API: requests business metrics (evidence: `frontend/src/pages/admin/AdminBusinessPage.jsx`)
- Admin API → MySQL database: reads and writes (evidence: `backend/src/routes/admin.js`)
- Business analytics API → MySQL database: queries metrics
- OAuth session → Analytics service: tracks sign-in (evidence: `backend/src/services/oauthSession.js`)
- Notification API → MySQL database: stores preferences
