# chen-yihua/auto-scheduling-system architecture

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

- Interactive diagram: https://gitdiagram.com/chen-yihua/auto-scheduling-system
- Repository: https://github.com/chen-yihua/auto-scheduling-system

## Overview

Auto Scheduling System brings manually entered tasks and GitHub, Jira, and Moodle work into one dashboard, estimates missing task priority and duration with AI, and suggests calendar-based schedules. Users connect external accounts, review synced items and Google Calendar availability, then use rule-based scheduling suggestions. The graph also includes the separate GitHub PR-summary webhook. Edges are limited to relationships visible in excerpts, SOURCE INDEX references, or README statements; several frontend and domain implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`Backend/main.py`](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/main.py) (FastAPI app), [`Backend/crud/oauth.py`](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/oauth.py) (Calendar tokens), [`Backend/db/mongodb.py`](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/db/mongodb.py) (MongoDB), [`Backend/routers/manualTask.py`](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/manualTask.py) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Dashboard<br/>[index.vue]"]
  node_taskform["Task form<br/>[TaskForm.vue]"]
  node_frontend_composables["Data composables"]
  node_calendar_embed["Calendar embed"]
end

subgraph group_api["API routes"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_task_routes["Task routes<br/>[manualTask.py]"]
  node_github_routes["GitHub routes<br/>[github.py]"]
  node_jira_routes["Jira routes<br/>[jira.py]"]
  node_moodle_routes["Moodle routes<br/>[moodle.py]"]
  node_account_routes["Account routes<br/>[linkedAccount.py]"]
  node_oauth_routes["Calendar OAuth routes<br/>[oauth.py]"]
  node_schedule_routes["Schedule routes<br/>[schedule.py]"]
  node_webhook_route["PR webhook<br/>[webhook.py]"]
end

subgraph group_domain["Task and schedule logic"]
  node_manual_tasks["Manual tasks<br/>[manualTask.py]"]
  node_schedulable_items["Schedulable items"]
  node_schedule_logic["Schedule logic<br/>[schedule.py]"]
  node_task_inference["Task inference<br/>[task_inference.py]"]
  node_external_sync["External sync<br/>[external_sync.py]"]
  node_github_crud["GitHub sync<br/>[github.py]"]
  node_account_crud["Account links<br/>[linkedAccount.py]"]
  node_calendar_oauth["Calendar tokens<br/>[oauth.py]"]
end

subgraph group_integrations["External integrations"]
  node_calendar_service["Calendar operations<br/>[google_calendar.py]"]
  node_github["GitHub"]
  node_jira["Jira"]
  node_moodle["Moodle"]
  node_google_calendar["Google Calendar"]
  node_gemini["Gemini"]
  node_discord["Discord"]
end

subgraph group_infrastructure["Security and storage"]
  node_mongodb[("MongoDB<br/>[mongodb.py]")]
  node_security["Clerk JWT auth<br/>[security.py]"]
  node_cache["Short-term cache<br/>[cache.py]"]
  node_redis[("Redis")]
  node_rate_limit["Rate limiting<br/>[rate_limit.py]"]
end

node_user(("User"))

node_user -->|"views"| node_dashboard
node_dashboard -->|"renders"| node_taskform
node_dashboard -->|"loads dashboard data"| node_frontend_composables
node_dashboard -->|"renders"| node_calendar_embed
node_taskform -.->|"manages task form"| node_frontend_composables
node_frontend_composables -.->|"calls API"| node_api_app
node_api_app -->|"registers"| node_task_routes
node_api_app -->|"registers"| node_github_routes
node_api_app -->|"registers"| node_jira_routes
node_api_app -->|"registers"| node_moodle_routes
node_api_app -->|"registers"| node_account_routes
node_api_app -->|"registers"| node_oauth_routes
node_api_app -->|"registers"| node_schedule_routes
node_api_app -->|"registers"| node_webhook_route
node_task_routes -->|"calls"| node_manual_tasks
node_task_routes -->|"infers fields"| node_task_inference
node_task_routes -->|"authenticates"| node_security
node_task_routes -->|"limits requests"| node_rate_limit
node_github_routes -->|"calls"| node_github_crud
node_jira_routes -.->|"syncs items"| node_external_sync
node_moodle_routes -.->|"syncs items"| node_external_sync
node_account_routes -->|"calls"| node_account_crud
node_oauth_routes -->|"calls"| node_calendar_oauth
node_schedule_routes -->|"gets availability"| node_calendar_oauth
node_schedule_routes -->|"calls"| node_schedule_logic
node_schedule_routes -->|"gets tasks"| node_schedulable_items
node_github_crud -->|"syncs items"| node_external_sync
node_github_crud -->|"reads and writes"| node_mongodb
node_schedulable_items -->|"reads tasks"| node_manual_tasks
node_schedulable_items -->|"reads and writes"| node_mongodb
node_manual_tasks -.->|"reads and writes"| node_mongodb
node_account_crud -.->|"stores credentials"| node_mongodb
node_calendar_oauth -->|"stores tokens"| node_mongodb
node_calendar_oauth -->|"caches free slots"| node_cache
node_cache -.->|"uses if configured"| node_redis
node_calendar_oauth -->|"fetches and creates events"| node_calendar_service
node_oauth_routes -->|"fetches calendars and events"| node_calendar_service
node_calendar_service -->|"requests calendar data"| node_google_calendar
node_github_crud -->|"fetches issues and PRs"| node_github
node_external_sync -->|"fetches issues"| node_jira
node_external_sync -->|"fetches assignments"| node_moodle
node_task_inference -->|"estimates fields"| node_gemini
node_webhook_route -->|"handles PR events"| node_github
node_webhook_route -->|"summarizes PR"| node_gemini
node_webhook_route -->|"posts summary"| node_discord
node_schedule_logic -.->|"uses free slots"| node_calendar_oauth
node_schedule_logic -->|"suggests calendar slots"| node_google_calendar
node_api_app -->|"ensures indexes"| node_mongodb

click node_dashboard "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/index.vue"
click node_taskform "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/TaskForm.vue"
click node_frontend_composables "https://github.com/chen-yihua/auto-scheduling-system/tree/main/Frontend/composables"
click node_calendar_embed "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/GoogleCalendarEmbed.vue"
click node_api_app "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/main.py"
click node_task_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/manualTask.py"
click node_github_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/github.py"
click node_jira_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/jira.py"
click node_moodle_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/moodle.py"
click node_account_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/linkedAccount.py"
click node_oauth_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/oauth.py"
click node_schedule_routes "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/schedule.py"
click node_webhook_route "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/webhook.py"
click node_manual_tasks "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/manualTask.py"
click node_schedulable_items "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/schedulable_items.py"
click node_schedule_logic "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/schedule.py"
click node_task_inference "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/task_inference.py"
click node_external_sync "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/external_sync.py"
click node_github_crud "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/github.py"
click node_account_crud "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/linkedAccount.py"
click node_calendar_oauth "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/oauth.py"
click node_calendar_service "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/services/google_calendar.py"
click node_mongodb "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/db/mongodb.py"
click node_security "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/db/security.py"
click node_cache "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/cache.py"
click node_rate_limit "https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/rate_limit.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_dashboard,node_taskform,node_frontend_composables,node_calendar_embed,node_user toneBlue
class node_api_app,node_task_routes,node_github_routes,node_jira_routes,node_moodle_routes,node_account_routes,node_oauth_routes,node_schedule_routes,node_webhook_route toneAmber
class node_manual_tasks,node_schedulable_items,node_schedule_logic,node_task_inference,node_external_sync,node_github_crud,node_account_crud,node_calendar_oauth toneMint
class node_calendar_service,node_github,node_jira,node_moodle,node_google_calendar,node_gemini,node_discord toneRose
class node_mongodb,node_security,node_cache,node_redis,node_rate_limit toneIndigo
```

## Components

### Dashboard

- [Dashboard](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/index.vue): `Frontend/components/TheMain/index.vue`
- [Task form](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/TaskForm.vue): `Frontend/components/TheMain/TaskForm.vue`
- [Data composables](https://github.com/chen-yihua/auto-scheduling-system/tree/main/Frontend/composables): `Frontend/composables`
- [Calendar embed](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Frontend/components/TheMain/GoogleCalendarEmbed.vue): `Frontend/components/TheMain/GoogleCalendarEmbed.vue`

### API routes

- [FastAPI app](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/main.py): `Backend/main.py`
- [Task routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/manualTask.py): `Backend/routers/manualTask.py`
- [GitHub routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/github.py): `Backend/routers/github.py`
- [Jira routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/jira.py): `Backend/routers/jira.py`
- [Moodle routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/moodle.py): `Backend/routers/moodle.py`
- [Account routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/linkedAccount.py): `Backend/routers/linkedAccount.py`
- [Calendar OAuth routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/oauth.py): `Backend/routers/oauth.py`
- [Schedule routes](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/schedule.py): `Backend/routers/schedule.py`
- [PR webhook](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/routers/webhook.py): `Backend/routers/webhook.py`

### Task and schedule logic

- [Manual tasks](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/manualTask.py): `Backend/crud/manualTask.py`
- [Schedulable items](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/schedulable_items.py): `Backend/crud/schedulable_items.py`
- [Schedule logic](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/schedule.py): `Backend/crud/schedule.py`
- [Task inference](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/task_inference.py): `Backend/crud/task_inference.py`
- [External sync](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/external_sync.py): `Backend/crud/external_sync.py`
- [GitHub sync](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/github.py): `Backend/crud/github.py`
- [Account links](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/linkedAccount.py): `Backend/crud/linkedAccount.py`
- [Calendar tokens](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/crud/oauth.py): `Backend/crud/oauth.py`

### External integrations

- [Calendar operations](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/services/google_calendar.py): `Backend/services/google_calendar.py`
- **GitHub**
- **Jira**
- **Moodle**
- **Google Calendar**
- **Gemini**
- **Discord**

### Security and storage

- [MongoDB](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/db/mongodb.py): `Backend/db/mongodb.py`
- [Clerk JWT auth](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/db/security.py): `Backend/db/security.py`
- [Short-term cache](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/cache.py): `Backend/cache.py`
- **Redis**
- [Rate limiting](https://github.com/chen-yihua/auto-scheduling-system/blob/main/Backend/rate_limit.py): `Backend/rate_limit.py`

### Other components

- **User**

## Connections

- User → Dashboard: views
- Dashboard → Task form: renders (evidence: `Frontend/components/TheMain/index.vue`)
- Dashboard → Data composables: loads dashboard data (evidence: `Frontend/components/TheMain/index.vue`)
- Dashboard → Calendar embed: renders (evidence: `Frontend/components/TheMain/index.vue`)
- Task form → Data composables: manages task form
- Data composables → FastAPI app: calls API
- FastAPI app → Task routes: registers (evidence: `Backend/main.py`)
- FastAPI app → GitHub routes: registers (evidence: `Backend/main.py`)
- FastAPI app → Jira routes: registers (evidence: `Backend/main.py`)
- FastAPI app → Moodle routes: registers (evidence: `Backend/main.py`)
- FastAPI app → Account routes: registers (evidence: `Backend/main.py`)
- FastAPI app → Calendar OAuth routes: registers (evidence: `Backend/main.py`)
- FastAPI app → Schedule routes: registers (evidence: `Backend/main.py`)
- FastAPI app → PR webhook: registers (evidence: `Backend/main.py`)
- Task routes → Manual tasks: calls (evidence: `Backend/routers/manualTask.py`)
- Task routes → Task inference: infers fields (evidence: `Backend/routers/manualTask.py`)
- Task routes → Clerk JWT auth: authenticates (evidence: `Backend/routers/manualTask.py`)
- Task routes → Rate limiting: limits requests (evidence: `Backend/routers/manualTask.py`)
- GitHub routes → GitHub sync: calls (evidence: `Backend/routers/github.py`)
- Jira routes → External sync: syncs items
- Moodle routes → External sync: syncs items
- Account routes → Account links: calls (evidence: `Backend/routers/linkedAccount.py`)
- Calendar OAuth routes → Calendar tokens: calls (evidence: `Backend/routers/oauth.py`)
- Schedule routes → Calendar tokens: gets availability (evidence: `Backend/routers/schedule.py`)
- Schedule routes → Schedule logic: calls (evidence: `Backend/routers/schedule.py`)
- Schedule routes → Schedulable items: gets tasks (evidence: `Backend/routers/schedule.py`)
- GitHub sync → External sync: syncs items (evidence: `Backend/crud/github.py`)
- GitHub sync → MongoDB: reads and writes (evidence: `Backend/crud/github.py`)
- Schedulable items → Manual tasks: reads tasks (evidence: `Backend/crud/schedulable_items.py`)
- Schedulable items → MongoDB: reads and writes (evidence: `Backend/crud/schedulable_items.py`)
- Manual tasks → MongoDB: reads and writes
- Account links → MongoDB: stores credentials
- Calendar tokens → MongoDB: stores tokens (evidence: `Backend/crud/oauth.py`)
- Calendar tokens → Short-term cache: caches free slots (evidence: `Backend/crud/oauth.py`)
- Short-term cache → Redis: uses if configured
- Calendar tokens → Calendar operations: fetches and creates events (evidence: `Backend/crud/oauth.py`)
- Calendar OAuth routes → Calendar operations: fetches calendars and events (evidence: `Backend/routers/oauth.py`)
- Calendar operations → Google Calendar: requests calendar data (evidence: `Backend/services/google_calendar.py`)
- GitHub sync → GitHub: fetches issues and PRs
- External sync → Jira: fetches issues
- External sync → Moodle: fetches assignments
- Task inference → Gemini: estimates fields
- PR webhook → GitHub: handles PR events (evidence: `Backend/routers/webhook.py`)
- PR webhook → Gemini: summarizes PR (evidence: `Backend/routers/webhook.py`)
- PR webhook → Discord: posts summary (evidence: `Backend/routers/webhook.py`)
- Schedule logic → Calendar tokens: uses free slots
- Schedule logic → Google Calendar: suggests calendar slots
- FastAPI app → MongoDB: ensures indexes (evidence: `Backend/main.py`)
