A production-oriented REST API built with Node.js + JavaScript only. No Express, Fastify, NestJS, ORM, validation framework, logger framework, authentication framework, or test framework.
- Node.js 24+
- npm (only used for scripts; there are zero runtime dependencies)
cp .env.example .env
npm startServer: http://127.0.0.1:3333
Health:
curl http://127.0.0.1:3333/healthRegister:
curl -i -c cookies.txt \
-H 'content-type: application/json' \
-d '{"name":"Ada","email":"ada@example.com","password":"StrongPass123!"}' \
http://127.0.0.1:3333/auth/registerLogin:
curl -i -c cookies.txt \
-H 'content-type: application/json' \
-d '{"email":"ada@example.com","password":"StrongPass123!"}' \
http://127.0.0.1:3333/auth/loginCreate a project:
curl -b cookies.txt \
-H 'content-type: application/json' \
-d '{"name":"Nexus Lab","description":"Native Node project"}' \
http://127.0.0.1:3333/projectsHTTP server → middleware pipeline → router → controller → use case → repository → SQLite.
The core folder contains reusable technical primitives. The modules folder
contains business capabilities.
- Build an HTTP server from
node:http. - Implement route matching and path parameters.
- Implement middleware composition.
- Use
AsyncLocalStoragefor request context. - Hash passwords with
crypto.scrypt. - Manage secure sessions.
- Use native SQLite with prepared statements and transactions.
- Implement RBAC.
- Add rate limiting, body limits, security headers and request IDs.
- Add health checks, metrics and graceful shutdown.
- Test with
node:test. - Benchmark with the Node runtime.
This is a learning-grade production-style implementation, not a replacement for mature frameworks. The point is to expose the mechanisms frameworks hide. For a commercial system, use battle-tested libraries where appropriate.