How gt-scheduler/backend works
Purpose and Runtime
GT Scheduler Backend is a TypeScript/Node.js Express API that supplements the GT Scheduler website/crawler. Its primary documented feature accepts frontend feedback, validates it, and forwards it to Airtable for project-owner access. The service runs locally on port 3030 and compiles TypeScript to a distributable server entry point. Paths: src/server.ts, src/app.ts, package.json.
Process Entry and Application Composition
src/server.ts is the runtime bootstrap: it starts the HTTP listener. src/app.ts constructs the Express application, where cross-cutting middleware and route mounting are expected to be composed. This separates process lifecycle concerns from reusable app configuration. Paths: src/server.ts, src/app.ts.
HTTP Routing Boundary
The route layer exposes the API surface and dispatches incoming requests to domain controllers. src/routes/index.ts is the central router integration point, keeping endpoint registration separate from application bootstrapping and request implementation. Paths: src/routes/index.ts, src/app.ts.
Feedback Intake and Validation
Feedback requests cross a validation boundary before reaching external persistence. src/middlewares/formValidation.ts uses the documented Celebrate runtime-validation approach to reject malformed input; downstream controllers can therefore operate on validated request data. Paths: src/middlewares/formValidation.ts, src/routes/index.ts, src/controllers/airTable.ts.
Airtable Integration
The Airtable controller is the external-service adapter for feedback submission. It receives validated frontend data and translates/forwards it to Airtable, whose API key and base settings are supplied through environment configuration rather than source code. This is the repository’s principal external dependency and persistence boundary. Paths: src/controllers/airTable.ts, src/config.ts, .env.example.
Class-Section API Capability
A separate controller handles class-section-related behavior, representing the backend’s scheduler-facing API capability beyond feedback intake. Routing delegates requests into this controller rather than embedding scheduler logic in transport setup. Paths: src/controllers/classSection.ts, src/routes/index.ts.
Error Handling and Operational Concerns
Errors are centralized through Express error middleware, providing a consistent response boundary for validation, controller, and integration failures. HTTP request logging is provided by Morgan per the project documentation. Deployment automation is defined separately from application code. Paths: src/middlewares/errorHandler.ts, src/app.ts, .github/workflows/deploy.yml.
Main entry points: index.ts Central router · airTable.ts Airtable controller · errorHandler.ts Error middleware · app.ts Express app
Components 12
Runtime
- Package build scripts · Builds TypeScript into the distributable server.
package.json - Server bootstrap · Starts the HTTP listener on port 3030.
src/server.ts - Express app · Composes middleware and mounted routes.
src/app.ts
HTTP API
- Central router · Registers API endpoints and dispatches requests.
src/routes/index.ts - Class-section controller · Implements scheduler-facing class-section behavior.
src/controllers/classSection.ts
Feedback Pipeline
- Feedback validation · Rejects malformed feedback before controller handling.
src/middlewares/formValidation.ts - Airtable controller · Transforms validated feedback into Airtable submissions.
src/controllers/airTable.ts - Airtable API · Project-owner feedback store.
Operations
- Environment config · Supplies Airtable API and base settings.
src/config.ts - Environment template
.env.example - Error middleware · Normalizes validation, controller, and integration failures.
src/middlewares/errorHandler.ts - Deployment workflow
.github/workflows/deploy.yml
Connections 14
- Package build scripts → Server bootstrap: builds and runs
- Server bootstrap → Express app: starts
- Express app → Central router: mounts
- Express app → Error middleware: uses
- Central router → Class-section controller: dispatches class-section requests
- Central router → Feedback validation: applies to feedback
- Feedback validation → Airtable controller: validated feedback
- Airtable controller → Airtable API: submits feedback
- Environment config → Airtable controller: provides credentials and base
- Environment template → Environment config: documents variables
- Central router → Error middleware: errors
- Feedback validation → Error middleware: validation failures
- Airtable controller → Error middleware: integration failures
- Deployment workflow → Package build scripts: deploys application