Overview

NetrunSite is the Express.js backend powering the Netrun Systems corporate website. It handles authentication, KAMERA job processing, Stripe payments, blog content, and administrative functions. The frontend has been migrated to Sigil CMS; the backend continues serving API endpoints.

Architecture

  • Backend: Express, Drizzle ORM, PostgreSQL (Azure + GCP Cloud SQL)
  • Auth: Local (passport-local) + MSAL (Azure AD B2C) + Google OAuth
  • Build: Vite (client) + esbuild (server bundle)
  • Database: 25+ tables with RLS, sessions, CSRF tokens

API Routes

30+ route modules including:

  • /api/auth/* — Login, register, CSRF, OAuth
  • /api/kamera/* — Job CRUD, webhooks, reports (GCP Cloud SQL)
  • /api/posts/* — Blog content
  • /api/admin/* — Dashboard, subscriptions, user management
  • /api/files/* — Secure file upload/download
  • /api/health — Health check endpoint

Build Commands

npm run dev:api          # Backend dev server (port 8080)
npm run build:production # Full production build
npm test                 # Vitest
npm run db:migrate       # Drizzle migrations