This project is a NestJS-based backend application, featuring GraphQL API endpoints and a Swagger UI for API documentation. It's deployed on Vercel and utilizes a PostgreSQL database hosted on Railway.
A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# Build a Container
npm run start:dev
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- GraphQL API with Mercurius integration
- Swagger UI for RESTful API documentation
- Dockerized environment for development
- Vercel serverless deployment
- Railway PostgreSQL database integration
- Node.js (v16+)
- Docker (for local development)
- Vercel CLI (for deployment)
- Railway account (for database)
- Clone the repository:
git clone https://github.com/Milan-960/Nestjs-backend.git # and cd Nestjs-backend
- Create a new PostgreSQL database on Railway.
- Configure the environment variables in
.env
file with your Railway database credentials.
Access the GraphQL playground at http://localhost:3000/graphql
when running locally.
Access the Swagger UI for RESTful API documentation at http://localhost:3000/api
Describe your GraphQL and RESTful API endpoints here.
┣ 📂src
┃ ┣ 📂config # Configuration files and services
┃ ┣ 📂dtos # Data Transfer Objects
┃ ┣ 📂entities # Database entities
┃ ┣ 📂graphql # GraphQL related files
┃ ┃ ┣ 📂pubsub # PubSub module for subscriptions
┃ ┃ ┗ 📜... # Other GraphQL-related files
┃ ┣ 📂migrations # Database migration files
┃ ┣ 📂modules # Application modules
┃ ┃ ┗ 📂sample # Example module (can have many such modules)
┃ ┣ 📜app.controller.ts # Main application controller
┃ ┣ 📜app.module.ts # Main application module
┃ ┣ 📜app.service.ts # Main application service
┃ ┗ 📜main.ts # Entry point of the application
┣ 📂test
┃ ┗ 📜... # Test files
┣ 📜.env # Environment variables
┣ 📜... # Other configuration and setup files