Observed since 20 Oct, 18:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Production-ready Node.js + TypeScript Express template with opinionated tooling, security middleware, logging, MongoDB connectivity, migrations, Docker, PM2, and NGINX examples.
Production-ready Node.js + TypeScript Express template with opinionated tooling, security middleware, logging, MongoDB connectivity, migrations, Docker, PM2, and NGINX examples.
ts-migrate-mongoose and helper scriptsrc/
app.ts # Express app, middleware, routes, error handler
server.ts # App bootstrap, DB connect, rate limiter init, startup logs
router/apiRouter.ts # Routes: GET /self, GET /health
controller/ # Controllers (apiController)
middleware/ # globalErrorHandler, etc.
service/ # databaseService
config/ # config, rateLimiter
util/ # logger, httpError, etc.
public/ # Static assets
docker/ # Dockerfiles (development, production)
nginx/ # http.conf, https.conf examples
script/migration.js # Helper for running migrations
ecosystem.config.js # PM2 configuration
npm install
Copy .env.example to the appropriate dotenv-flow files. dotenv-flow loads files by NODE_ENV.
Minimum variables:
# General
ENV=development # production
PORT=3000
SERVER_URL=http://localhost:3000
# Database
DATABASE_URL="mongodb://localhost:27017/your-db"
# Migration
MIGRATE_MONGO_URI="mongodb://localhost:27017/your-db"
MIGRATE_AUTOSYNC="true" # or false
npm run dev — Start development mode with nodemon (NODE_ENV=development)npm run dist — Compile TypeScript to dist/npm start — Run compiled app (NODE_ENV=production)npm run lint / npm run lint:fix — Lint and auto-fixnpm run format:check / npm run format:fix — Prettier check and writenpm run migrate:dev — Run migration helper (development)npm run migrate:prod — Run migration helper (production)npm run dev
The app listens on PORT (default 3000). Static files served from public/.
npm run dist
npm start
Base path: /api/v1
GET /api/v1/self — Returns basic service infoGET /api/v1/health — Health check endpointglobalErrorHandlerhttpError utility standardizes error responseshelmet() enabled by defaultcors() configured with an allowlist (update origin in src/app.ts)initRateLimiterwinston logger with support for MongoDB transport (winston-mongodb)server.tsutil/loggermongoose for ODMservice/databaseServiceDATABASE_URL in your envPowered by ts-migrate-mongoose with a helper script.
Commands (via helper):
# Syntax: node script/migration.js <command> [name]
# Valid commands: create | up | down | list | prune
# examples
node script/migration.js create add-users-collection
node script/migration.js up add-users-collection
node script/migration.js down add-users-collection
node script/migration.js list
node script/migration.js prune
Set MIGRATE_MONGO_URI (usually same as DATABASE_URL).
Dockerfile: docker/development/Dockerfile
Example build/run:
docker build -f docker/development/Dockerfile -t ts-backend-dev .
docker run --env-file .env -p 3000:3000 ts-backend-dev
Dockerfile: docker/production/Dockerfile
Example build/run:
docker build -f docker/production/Dockerfile -t ts-backend-prod .
docker run --env-file .env -p 3000:3000 ts-backend-prod
ecosystem.config.js runs dist/server.js in cluster mode.
pm2 start ecosystem.config.js
pm2 status
pm2 logs
Examples in nginx/http.conf and nginx/https.conf. Point upstream to your app container/host and expose 80/443 accordingly.
eslint.config.mjs (TypeScript-aware, Prettier-compatible).prettierrc.ts filesDATABASE_URL is reachable from the app container/hostorigin allowlist in src/app.tsnpm run dist to confirm type safety and build outputlogs/ and PM2 logs for runtime issuesISC — see package.json.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0Registry latest | 23 Nov 2025 | 29 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:eaf9f80877a6c9ad4dbd5dcaec99950ceb21f63fe169671db8e2c8e2e6121586