Skip to Content
ArchitectureArchitecture Overview

Architecture Overview

GritCert runs on a single Node.js/Express backend serving both the student app and the platform admin console. The database is PostgreSQL. Authentication is handled by two Clerk instances: one for students, one for platform admins.

Key Principles

  • DB-canonical roles: the database users.role is the sole source of truth for authorization. Clerk is a display hint only.
  • Org scoping on every tenant route: all tenant-scoped queries route through scopeToOrg(req) middleware. Fail-closed in production.
  • Platform routes are separate: /api/platform/* routes require requirePlatformAdmin and are completely isolated from tenant-scoped routes.
  • BYPASS_AUTH is permanently false: in every environment, including local dev.

Services

ServiceURLHosting
Student App (React SPA)app.{slug}.gritcert.com or custom domainRailway
Platform Admin Consoleadmin.gritcert.comRailway
API (Node/Express)app.gritcert.com/apiRailway
DatabasePostgreSQLRailway
Documentationdocs.gritcert.comVercel

Student app URL is tenant-specific. Default: {slug}.gritcert.com. Custom domains supported.

Last updated on
© 2026 GritCert. Internal platform documentation.