Starter application for building APIs with Nest!
Packages:
- Prisma ORM
- PostgreSQL
- nestjs/swagger for API documentation
- ESLint for code linting
- Prettier for code formatting
- SigNoz for Instrumentation
- Pino for Log management
- class-validator for validation
- class-transformer for data transformation
Clone the repository, install the dependencies and get started right away.
$ git clone --depth=1 [email protected]:ngKisor/nestjs-starter.git <application-name>
$ cd <application-name>
$ rm -rf .git
$ pnpm install
Make a copy of .env.example
as .env
and update your application details and database credentials.
Run the migrations and seed the database.
$ pnpm prisma:migrate
$ pnpm prisma:seed
# development
$ pnpm run start
# watch mode
$ pnpm run start:dev
# production mode
$ pnpm run start:prod
Navigate to http://localhost:8080/api/ to verify installation.
Use docker-compose to quickly bring up a stack with pre-configured Postgres database container. Data is ephemeral and containers will disappear when stack is removed.
Specific configuration for Docker is in .env.docker
0.0.0.0
as$APP_HOST
to expose app on Docker network interface- Pre-configured Postgres settings - can be updated to point to another Postgres host
Bring up stack,
$ docker-compose up
Navigate to http://localhost:8848/api-docs/ to verify application is running from docker.
Bring down stack,
$ docker-compose down
# unit tests
$ pnpm run test
# e2e tests
$ pnpm run test:e2e
# test coverage
$ pnpm run test:cov
For contribution and feature requests, please create an issue first.
NestJs-Api-Starter is under MIT License.