Skip to content

Microservice built with NestJS for handling product management within a distributed system. Provides endpoints for product CRUD operations and communicates with other microservices using TCP. Designed for scalability and integration within a modular microservices ecosystem.

Notifications You must be signed in to change notification settings

Nest-Microservices-Samples/products-microservice

Repository files navigation

🛒 Products Microservice

NestJS Logo

Microservice built with NestJS to manage product-related operations using TCP communication. This microservice uses SQLite as the database for storing product information.

SQLite Logo

🚀 Development Setup

  1. 📥 Clone the repository:

    git clone https://github.com/Nest-Microservices-Samples/products-microservice
    cd products-microservice
  2. 📦 Install dependencies:

    npm install
  3. 🔧 Set up environment variables: Create a .env file based on the provided .env.template:

    cp .env.template .env

    Edit the .env file to add the required environment variables.

  4. 🗃️ Run Prisma migrations and generate the client:

    npx prisma migrate dev
    npx prisma generate
  5. 🛠️ Start the application in development mode:

    npm run start:dev
  6. 🧪 Test the microservice: Use tools like Postman, Insomnia, or curl to send TCP messages and test the microservice endpoints. Both Postman and Insomnia are powerful tools that allow you to easily create requests, view responses, and debug APIs.

📂 Data Folder for Testing

  • The data folder in the root of the project is intended for adding sample product data to the database for testing purposes. You can place JSON or CSV files with product information in this folder and use scripts or commands to import them into your development database. TablePlus was used to insert these sample data into the SQLite database, test the database functionality, and visually inspect the data.

📚 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 product management within a distributed system. Provides endpoints for product CRUD operations and communicates with other microservices using TCP. Designed for scalability and integration within a modular microservices ecosystem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published