A beginner-friendly project showcasing fundamental NestJS concepts through structured code examples, from controllers and providers to validation and RESTful APIs.
Documentation:
Nest.js Note
|
Postman Documentation
Table of Contents
Nest.js Intro is a structured tutorial repository that demonstrates key NestJS concepts through modular code examples. Organized into separate directories, it covers controllers, providers, DTO validation, RESTful APIs, and essential NestJS features, enabling you to learn and reference best practices for building scalable server-side applications with TypeScript.
- Modular Controllers
Organize your request handling logic with dedicated controllers for clean routing. - Providers & Dependency Injection
Leverage NestJS’s provider system to manage services and inject dependencies. - DTO Validation
Enforce data integrity using DTOs (Data Transfer Objects) and class-validator decorators. - REST API Endpoints
Implement CRUD operations and role-based queries for users and employees. - Essentials (Loggers, Guards, Error handling, Exception)
Explore NestJS’s powerful features.
- NestJS – A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- Node.js – JavaScript runtime built on Chrome's V8 engine.
- TypeScript – Typed superset of JavaScript.
- Prisma – Next-generation ORM for Node.js & TypeScript.
- Neon – Serverless PostgreSQL database.
- Postman – API development and testing tool.
Follow these steps to set up and run Nest.js Intro locally.
- Node.js (v22 or higher)
- npm or yarn
- Git
- Clone the repository:
git clone https://github.com/GRB-Workspace/Nestjs-Intro.git
- Navigate to the project directory:
cd Nestjs-Intro
- Install dependencies:
npm install # or yarn install
- Configure environment variables:
- Create a
.env
file based on.env.example
. - Add your database connection string and any other required variables.
- Create a
- Run database migrations (if using Prisma):
npx prisma migrate dev
- Start the development server:
npm run start:dev
- Access the API documentation in Postman:
Nestjs-Intro
├── .git
├── 01-Controllers
├── 02-Providers
├── 03-DTO-Validation
├── 04-REST-API
├── 05-Essentials
└── LICENSE
- 01-Controllers – Example controllers for routing and request handling.
- 02-Providers – Service providers demonstrating dependency injection.
- 03-DTO-Validation – DTO classes and validation rules using class-validator.
- 04-REST-API – Complete RESTful endpoints for users and employees.
- 05-Essentials – Error handling, CORS, Logging, and etc showcasing advanced NestJS features.
- NestJS Documentation: https://docs.nestjs.com/
- Neon Console: https://console.neon.tech/app/projects
- Prisma Docs: https://www.prisma.io/docs
- NestJS-Prisma Integration: https://nestjs-prisma.dev/
Learn step-by-step by following the tutorial video:
© 2025 Gayanuka Bulegoda