A NestJS backend application built with TypeScript.
This is a boilerplate NestJS application with TypeScript, providing a solid foundation for building scalable server-side applications.
- Node.js (v18 or higher)
- npm or yarn
# Install dependencies
npm install# Development mode with hot reload
npm run start:dev
# Production mode
npm run build
npm run start:prod
# Debug mode
npm run start:debugThe application will be available at http://localhost:3000/api
GET /api- Welcome messageGET /api/health- Health check endpoint
# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Test coverage
npm run test:cov
# Watch mode
npm run test:watch# Lint code
npm run lint
# Format code
npm run formatsrc/
├── app.controller.ts # Main controller with route handlers
├── app.module.ts # Root module
├── app.service.ts # Business logic service
└── main.ts # Application entry point
test/
├── app.e2e-spec.ts # End-to-end tests
└── jest-e2e.json # E2E test configuration
Create a .env file in the root directory based on .env.example:
PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/heatstackThis application uses MongoDB with Mongoose.
Using Docker:
docker run -d -p 27017:27017 --name mongodb mongo:latestOr install locally:
- macOS:
brew install mongodb-community && brew services start mongodb-community - Ubuntu:
sudo apt-get install mongodb - Windows: Download from mongodb.com
For detailed database configuration, see DATABASE.md
npm run buildThe compiled files will be in the dist/ directory.
- NestJS - Progressive Node.js framework
- TypeScript - Typed JavaScript
- Jest - Testing framework
- ESLint - Code linting
- Prettier - Code formatting
- Install dependencies:
npm install - Start development server:
npm run start:dev - Visit
http://localhost:3000/apito see your application running - Begin adding your own modules, controllers, and services
To create new modules, controllers, or services, you can use NestJS CLI:
# Generate a new module
nest g module users
# Generate a new controller
nest g controller users
# Generate a new service
nest g service users
# Generate a complete resource (CRUD)
nest g resource usersMIT