Tutor management platform

Tutor Mx documentation

Architecture, secure authentication, API usage, testing and deployment for the Sprint 1 public demo.

Architecture

The React/Vite single-page app is hosted separately from the handwritten Express API. The browser obtains an RS256 access token from Auth0 and sends it only in the Authorization header. Express validates the JWKS signature, issuer, audience, expiry, not-before and subject before accessing Neon PostgreSQL through Prisma. The browser never connects directly to Neon.

Browser → Cloudflare Pages → Auth0 Universal Login
Browser → Bearer access token → Render Express API → Prisma → Neon PostgreSQL

Local setup

  1. Install Node.js 22 and run npm ci in the root and frontend directories.
  2. Copy the example environment files and provide local-only values.
  3. Run npm run db:migrate, then npm run dev.

Never commit environment files, tokens, database URLs, client secrets or Management API credentials.

API examples

Health and readiness are public; application data requires an Auth0 access token with audience https://api.tutormx.com.

GET /health
GET /ready
GET /api/me
Authorization: Bearer <access-token>

DELETE /api/auth/delete-account
Authorization: Bearer <access-token>

Ownership always comes from the verified token subject mapped to Profile.auth0Id. Browser-supplied user identifiers are never trusted.

Testing and coverage

CI runs Prisma generation, ESLint, TypeScript checking, backend and frontend tests, production builds and repository secret checks. Coverage is uploaded to Codecov from GitHub Actions without embedding credentials in source.

Deployment

Limitations

AI attribution

AI tools assisted with integration, tests, documentation and deployment preparation. Human team members remain responsible for review, academic disclosure, security decisions and submitted work. See AI_DECLARATION.md in the repository.