Intra Bus Server
REST API for bus ticketing and fleet management, with refresh-token auth and a full integration test suite.
Node.js · Express · MongoDB
The source for this one is in a private repository, so there's no public link. Happy to walk through it on request.
overview
The backend for a bus ticketing and fleet management platform. It handles ticketing, scheduling and fleet data for an operator running scheduled intercity routes.
This is the most thoroughly engineered service I've built. Auth is JWT with rotating refresh tokens, every endpoint validates its input before it reaches a handler, and the whole surface is covered by integration tests that run against an in-memory MongoDB instance rather than mocks.
highlights
- JWT authentication with rotating refresh tokens
- Schema validation on every request with Joi
- Structured JSON logging via Pino, with per-request correlation
- Helmet, CORS and rate limiting applied at the edge
- Integration tests against an in-memory MongoDB, not mocks
stack
Runtime
Node.js ESM
Framework
Express 5
Database
MongoDB Mongoose
Auth
JWT Refresh tokens bcrypt crypto
Validation
Joi
Logging
Pino pino-http
Security
Helmet CORS express-rate-limit
Testing
Vitest Supertest mongodb-memory-server