# robe-izanagi/trackv2 architecture

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

- Interactive diagram: https://gitdiagram.com/robe-izanagi/trackv2
- Repository: https://github.com/robe-izanagi/trackv2

## Overview

TRACK is a university scheduling system with a role-aware user app and a separate admin console. Users authenticate, then manage calendars, events, tasks, venues, and in-app notifications; admins oversee onboarding, accounts, analytics, feedback, and audit activity. The Express API routes requests into domain controllers and services backed by MySQL. The README documents conflict prioritization, AI-assisted suggestions, and predictive analytics, but sampled excerpts do not establish all their internal call paths, so those links are marked unverified or omitted.

Main entry points: [`server/src/app.ts`](https://github.com/robe-izanagi/trackv2/blob/main/server/src/app.ts) (Express API), [`web-user/src/App.jsx`](https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/App.jsx) (User app routes), [`server/src/controllers/eventsController.js`](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/eventsController.js) (Event scheduling), [`server/src/models/index.js`](https://github.com/robe-izanagi/trackv2/blob/main/server/src/models/index.js) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_user_app["User application"]
  node_user_app["User app routes<br/>[App.jsx]"]
  node_user_auth["User authentication<br/>[AuthContext.jsx]"]
  node_calendar["Calendar and events<br/>[CalendarView.jsx]"]
  node_task_ui["Task management<br/>[Tasks.jsx]"]
end

subgraph group_admin_app["Admin console"]
  node_user_admin_api["Admin app routes<br/>[App.jsx]"]
  node_account_ui["Account codes<br/>[AccountCodes.jsx]"]
  node_admin_analytics_ui["Admin analytics<br/>[Analytics.jsx]"]
end

subgraph group_backend["Scheduling backend"]
  node_api["Express API<br/>[app.ts]"]
  node_event_domain["Event scheduling"]
  node_task_domain["Task workflows<br/>[tasksController.js]"]
  node_onboarding["Account onboarding"]
  node_conflicts["Conflict resolution<br/>[conflictService.js]"]
  node_venues["Venue allocation"]
  node_analytics["Analytics and forecasts<br/>[riskService.js]"]
  node_feedback["Feedback analysis"]
  node_notifications["Notifications"]
end

subgraph group_data_services["Data and services"]
  node_db[("MySQL database<br/>[database.js]")]
  node_models["Domain models<br/>[index.js]"]
  node_email["Email queue"]
end

node_users(("University users"))
node_admins(("Administrators"))

node_users -->|"use"| node_user_app
node_admins -->|"administer"| node_user_admin_api
node_user_app -->|"provides auth"| node_user_auth
node_user_app -->|"routes to"| node_calendar
node_user_app -->|"routes to"| node_task_ui
node_user_admin_api -->|"routes to"| node_account_ui
node_user_admin_api -->|"routes to"| node_admin_analytics_ui
node_api -->|"routes requests"| node_event_domain
node_api -->|"routes requests"| node_task_domain
node_api -->|"routes requests"| node_onboarding
node_event_domain -->|"checks conflicts"| node_conflicts
node_event_domain -->|"sends notifications"| node_notifications
node_task_domain -->|"sends notifications"| node_notifications
node_onboarding -->|"queues email"| node_email
node_event_domain -->|"reads and writes"| node_models
node_task_domain -->|"reads and writes"| node_models
node_onboarding -->|"reads and writes"| node_models
node_models -->|"uses connection"| node_db
node_user_app -.->|"calls API"| node_api
node_user_admin_api -.->|"calls API"| node_api
node_api -->|"routes requests"| node_venues
node_api -->|"routes requests"| node_analytics
node_api -->|"routes requests"| node_feedback
node_admins -.->|"review metrics"| node_analytics
node_event_domain -.->|"uses allocation"| node_venues
node_analytics -->|"reads data"| node_models

click node_user_app "https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/App.jsx"
click node_user_auth "https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/context/AuthContext.jsx"
click node_calendar "https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/pages/app/calendar/CalendarView.jsx"
click node_task_ui "https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/pages/app/tasks/Tasks.jsx"
click node_user_admin_api "https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/App.jsx"
click node_account_ui "https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/pages/AccountCodes.jsx"
click node_admin_analytics_ui "https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/pages/Analytics.jsx"
click node_api "https://github.com/robe-izanagi/trackv2/blob/main/server/src/app.ts"
click node_event_domain "https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/eventsController.js"
click node_task_domain "https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/tasksController.js"
click node_onboarding "https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/accountCodeRequestsController.js"
click node_conflicts "https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/conflictService.js"
click node_venues "https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/venuesController.js"
click node_analytics "https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/riskService.js"
click node_feedback "https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/feedbackController.js"
click node_notifications "https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/notificationService.js"
click node_db "https://github.com/robe-izanagi/trackv2/blob/main/server/src/config/database.js"
click node_models "https://github.com/robe-izanagi/trackv2/blob/main/server/src/models/index.js"
click node_email "https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/emailQueueProcessor.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_user_app,node_user_auth,node_calendar,node_task_ui,node_users toneBlue
class node_user_admin_api,node_account_ui,node_admin_analytics_ui toneAmber
class node_api,node_event_domain,node_task_domain,node_onboarding,node_conflicts,node_venues,node_analytics,node_feedback,node_notifications toneMint
class node_db,node_models,node_email toneRose
class node_admins toneIndigo
```

## Components

### User application

- [User app routes](https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/App.jsx): `web-user/src/App.jsx`
- [User authentication](https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/context/AuthContext.jsx): `web-user/src/context/AuthContext.jsx`
- [Calendar and events](https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/pages/app/calendar/CalendarView.jsx): `web-user/src/pages/app/calendar/CalendarView.jsx`
- [Task management](https://github.com/robe-izanagi/trackv2/blob/main/web-user/src/pages/app/tasks/Tasks.jsx): `web-user/src/pages/app/tasks/Tasks.jsx`

### Admin console

- [Admin app routes](https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/App.jsx): `web-admin/src/App.jsx`
- [Account codes](https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/pages/AccountCodes.jsx): `web-admin/src/pages/AccountCodes.jsx`
- [Admin analytics](https://github.com/robe-izanagi/trackv2/blob/main/web-admin/src/pages/Analytics.jsx): `web-admin/src/pages/Analytics.jsx`

### Scheduling backend

- [Express API](https://github.com/robe-izanagi/trackv2/blob/main/server/src/app.ts): `server/src/app.ts`
- [Event scheduling](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/eventsController.js): `server/src/controllers/eventsController.js`
- [Task workflows](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/tasksController.js): `server/src/controllers/tasksController.js`
- [Account onboarding](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/accountCodeRequestsController.js): `server/src/controllers/accountCodeRequestsController.js`
- [Conflict resolution](https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/conflictService.js): `server/src/services/conflictService.js`
- [Venue allocation](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/venuesController.js): `server/src/controllers/venuesController.js`
- [Analytics and forecasts](https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/riskService.js): `server/src/services/riskService.js`
- [Feedback analysis](https://github.com/robe-izanagi/trackv2/blob/main/server/src/controllers/feedbackController.js): `server/src/controllers/feedbackController.js`
- [Notifications](https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/notificationService.js): `server/src/services/notificationService.js`

### Data and services

- [MySQL database](https://github.com/robe-izanagi/trackv2/blob/main/server/src/config/database.js): `server/src/config/database.js`
- [Domain models](https://github.com/robe-izanagi/trackv2/blob/main/server/src/models/index.js): `server/src/models/index.js`
- [Email queue](https://github.com/robe-izanagi/trackv2/blob/main/server/src/services/emailQueueProcessor.js): `server/src/services/emailQueueProcessor.js`

### Other components

- **University users**
- **Administrators**

## Connections

- University users → User app routes: use
- Administrators → Admin app routes: administer
- User app routes → User authentication: provides auth (evidence: `web-user/src/App.jsx`)
- User app routes → Calendar and events: routes to (evidence: `web-user/src/App.jsx`)
- User app routes → Task management: routes to (evidence: `web-user/src/App.jsx`)
- Admin app routes → Account codes: routes to (evidence: `web-admin/src/App.jsx`)
- Admin app routes → Admin analytics: routes to (evidence: `web-admin/src/App.jsx`)
- Express API → Event scheduling: routes requests (evidence: `server/src/app.ts`)
- Express API → Task workflows: routes requests (evidence: `server/src/app.ts`)
- Express API → Account onboarding: routes requests (evidence: `server/src/app.ts`)
- Event scheduling → Conflict resolution: checks conflicts (evidence: `server/src/controllers/eventsController.js`)
- Event scheduling → Notifications: sends notifications (evidence: `server/src/controllers/eventsController.js`)
- Task workflows → Notifications: sends notifications (evidence: `server/src/controllers/tasksController.js`)
- Account onboarding → Email queue: queues email (evidence: `server/src/controllers/accountCodeRequestsController.js`)
- Event scheduling → Domain models: reads and writes (evidence: `server/src/controllers/eventsController.js`)
- Task workflows → Domain models: reads and writes (evidence: `server/src/controllers/tasksController.js`)
- Account onboarding → Domain models: reads and writes (evidence: `server/src/controllers/accountCodeRequestsController.js`)
- Domain models → MySQL database: uses connection (evidence: `server/src/models/index.js`)
- User app routes → Express API: calls API
- Admin app routes → Express API: calls API
- Express API → Venue allocation: routes requests (evidence: `server/src/app.ts`)
- Express API → Analytics and forecasts: routes requests (evidence: `server/src/app.ts`)
- Express API → Feedback analysis: routes requests (evidence: `server/src/app.ts`)
- Administrators → Analytics and forecasts: review metrics
- Event scheduling → Venue allocation: uses allocation
- Analytics and forecasts → Domain models: reads data (evidence: `server/src/services/riskService.js`)
