Knowledge Base updated: 2026-11-05
NUSMods Knowledge Base
Orientation
NUSMods is a student-facing NUS planning platform: a web application for building and viewing timetables, planning academic progress, finding campus information, and accessing supporting tools.
The browser application is primarily under website/, with Redux state, timetable and planner features, client API calls, and serverless API handlers. Academic and campus data is acquired by separate scraper applications and consumed by the web product.
Critical client state鈥攊ncluding selected modules, lesson choices, settings, undo history, and persisted preferences鈥攆lows through the website Redux store and browser storage. Operational concerns span the export renderer, serverless handlers, and deployment configuration.
flowchart TD
User[Student browser] --> Web[website application]
Web --> Redux[Redux state and persistence]
Web --> Timetable[Timetable UI]
Web --> Planner[Planner and module bank]
Web --> Tools[Campus tools]
Web --> API[Website API and serverless handlers]
API --> NUS[NUS data services]
API --> Optimiser[Timetable optimiser]
API --> MPE[Module prerequisite explorer]
API --> Transit[Transport, weather, GitHub services]
Web --> Export[Timetable export service]
NUSScraper[nus-v2 scraper] --> Data[NUS academic data]
CPExScraper[CPE-X scraper] --> Data
Data --> API
Deploy[Infrastructure and hosting] --> Web
Deploy --> Export
Glossary
- MPE: Module Prerequisite Explorer, the authenticated tool for navigating module prerequisite relationships.
- Module bank: The planner workspace where users organize prospective modules independently of a selected timetable.
- Lesson choice: A selected lesson group or class choice used to construct a timetable.
- CPE-X: External course-planning data supplied by the dedicated CPE-X scraper.
- NUSMods export: The separate rendering flow that generates shareable or downloadable timetable output.
Codebase-wide invariants
- Client state changes must remain compatible with persisted state and storage migrations; evidence:
website/src/reducers/**andwebsite/src/storage/**. - Timetable selections must preserve lesson-choice and conflict rules before rendering; evidence:
website/src/actions/timetable/**andwebsite/src/reducers/timetable/**. - Serverless handlers must maintain their authentication boundary when exposing external integrations; evidence:
website/src/api/**. - Scraped academic data is produced independently of the web UI and must retain the scraper-to-published-data contract; evidence:
scrapers/nus-v2/**andscrapers/cpex/**. - Export rendering remains a standalone service boundary rather than browser-only UI behavior; evidence:
export/**.
Routing table
website/src/index.*,website/src/App.*,website/src/bootstrap/**,website/src/components/App/**-> docs/web-application-runtime.mdwebsite/src/actions/**,website/src/reducers/**,website/src/selectors/**,website/src/storage/**,website/src/theme/**-> docs/client-state-and-persistence.mdwebsite/src/api/**,website/api/**,website/src/services/**-> docs/serverless-and-external-apis.mdwebsite/src/views/Timetable/**,website/src/components/Timetable/**,website/src/routes/timetable/**-> docs/timetable-experience.mdwebsite/src/actions/timetable/**,website/src/reducers/timetable/**,website/src/selectors/timetable/**,website/src/utils/timetable/**-> docs/timetable-scheduling.mdwebsite/src/views/Timetable/**,website/src/components/Timetable/**,website/src/routes/timetable/**-> docs/timetable-rendering-and-interaction.mdwebsite/src/views/Planner/**,website/src/components/Planner/**,website/src/utils/academicCalendar/**-> docs/academic-planning.mdwebsite/src/views/Planner/**,website/src/components/Planner/**,website/src/actions/planner/**,website/src/reducers/planner/**,website/src/actions/moduleBank/**,website/src/reducers/moduleBank/**-> docs/planner-and-module-bank.mdpackages/academic-calendar/**,website/src/utils/academicCalendar/**,website/src/utils/semester/**-> docs/academic-calendar-utilities.mdwebsite/src/views/Venue/**,website/src/views/Bus/**,website/src/views/Optimiser/**,website/src/views/MPE/**-> docs/campus-tools.mdwebsite/src/views/Venue/**,website/src/views/Bus/**,website/src/components/Venue/**,website/src/components/Bus/**,website/src/api/nextbus/**-> docs/venue-and-transport-tools.mdwebsite/src/views/Optimiser/**,website/src/components/Optimiser/**,website/src/api/optimiser/**-> docs/timetable-optimisation.mdwebsite/src/views/MPE/**,website/src/components/MPE/**,website/src/api/mpe/**,website/src/services/mpe/**-> docs/module-prerequisite-explorer.mdscrapers/**,scraper/**,packages/nusmoderator/**-> docs/data-ingestion.mdscrapers/nus-v2/**,scraper/nus-v2/**-> docs/nus-module-data-scraper.mdscrapers/cpex/**,scraper/cpex/**-> docs/cpex-data-scraper.mdexport/**, website/serverless.yml, website/netlify.toml,infrastructure/**-> docs/export-and-operations.mdexport/**-> docs/timetable-export-service.mdinfrastructure/**, website/serverless.yml, website/netlify.toml, export/serverless.yml,.github/workflows/**-> docs/deployment-and-hosting.md