Skip to content

Microservice built with NestJS for handling order management within a distributed system. Manages order headers and provides endpoints for order CRUD operations while communicating with other microservices via HTTP and with the gateway using TCP. Designed for scalability and seamless integration within a modular microservices architecture.

Notifications You must be signed in to change notification settings

Nest-Microservices-Samples/orders-microservice

Repository files navigation

🛒 Orders MicroService

NestJS Logo

Microservice built with NestJS to manage order-related operations using HTTP and TCP communication. This microservice uses **PostgreSQL** as the database for storing order information and communicates with the gateway using TCP.

PostgreSQL LogoDocker Logo

🚀 Development Setup

  1. 📥 Clone the repository:
 git clone https://github.com/Nest-Microservices-Samples/products-microservice.git
 cd products-microservice
  1. 📦 Install dependencies:
 npm install
  1. 🔧 Set up environment variables: Create a .env file based on the provided .env.template and edit the .env file to add the required environment variables.
 cp .env.template .env
  1. 🐳 Start the PostgreSQL database with Docker Compose: Ensure Docker is installed and run the following command to start the PostgreSQL database:
 docker compose up -d
  1. 🗃️ Run Prisma migrations and generate the client:
 npx prisma migrate dev
 npx prisma generate
  1. 🛠️ Start the application in development mode:
 npm run start:dev
  1. 🧪 Test the microservice: Use tools like Postman, Insomnia, or curl to send HTTP requests to test the microservice endpoints. You can also use these tools to test TCP communication with the gateway.

📚 Documentation

  • For more details about the endpoints and their usage, refer to the docs folder or the Postman/Insomnia collection provided. - Learn more about NestJS at nestjs.com.

Built with ❤️ using NestJS.

About

Microservice built with NestJS for handling order management within a distributed system. Manages order headers and provides endpoints for order CRUD operations while communicating with other microservices via HTTP and with the gateway using TCP. Designed for scalability and seamless integration within a modular microservices architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published