This starter kit provides a foundation for building scalable and maintainable server-side applications using Nest.js. It is designed to seamlessly integrate with Prisma Object-Relational Mapping (ORM) libraries for efficient data handling.
- Nest.js Framework: Utilizes the robust Nest.js framework for building scalable applications with TypeScript.
- Prisma ORM Integration: Seamless integration with Prisma ORM for efficient database operations.
- Custom Exception Handling: Implemented custom exceptions to handle errors gracefully.
- Router Module: the route path for a handler is determined by concatenating the (optional) prefix declared for the controller.
- Exception Filters: Added exception filters to centralize error handling and enhance application robustness.
- Custom Decorators: Included custom decorator functions to extend functionality and simplify common tasks.
- Node.js (version >= 14)
- npm or yarn
- Clone the repository:
git clone https://github.com/nainglinnphyo/nestjs-starter.git
cd nestjs-starter
- Install Dependencies
npm install
# or
yarn install
- Copy the example configuration file and edit with you credentials:
cp .env.example .env.development
- migrate and generate type
yarn migrate:dev
#in production
yarn migrate:deploy
#and
npx prisma generate
- Start the app
yarn start:dev
- View Swagger documentation
Once the application is running, navigate to /docs
to view the automatically generated Swagger documentation.
-
Docker Support The Nest.js starter kit is also available on Docker for easier deployment and containerization.
-
Pull the Docker Image
docker pull devvps/nest-starter
- Run the Docker Container
docker run --env-file .env -p 3000:3000 devvps/nest-starter
Mount local machine .env and this will start the application in a Docker container, accessible on port 3000.