Skip to content

Repository files navigation

NestJS TypeScript Starter

Simple NestJS API with MongoDB. Includes products CRUD, Swagger docs, and basic error handling.

Quick Start

npm install
npm run start:dev

You'll need MongoDB. Use MongoDB Atlas (free cloud) or install locally.

Environment Variables

Create a .env file in the root:

NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/products
SWAGGER_ENABLED=true
CORS_ORIGIN=http://localhost:3000

Running

npm run start:dev    # development with hot reload
npm run build        # build for production
npm run start:prod   # run production build

Or with Docker:

docker-compose up -d

API

Swagger docs available at http://localhost:3000/api/docs

Main endpoints:

  • GET /api/products - list all
  • GET /api/products/:id - get one
  • POST /api/products - create
  • PUT /api/products/:id - update
  • DELETE /api/products/:id - delete

Docs

Tests

npm run test
npm run test:e2e

About

NestJS starter project with TypeScript, structured for scalable backend APIs and clear architectural patterns.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages