Git Product home page Git Product logo

rabbitmq-microservice's Introduction

RabbitMQ Microservice

This Node.js learning project focuses on understanding RabbitMQ microservices. In this project, I have developed three simple services which are responsible for authentication, product management, and order management.

Services Structure and Workflow

  • The authentication service is responsible for user register and login processes.
  • The product service is responsible for product creation and buying processes.
  • The order service is responsible for order creation processes.

The product and order services, process and connect to each other through RabbitMQ queues.

Prerequisites

Before running the project, make sure you have the following installed:

Setting Up RabbitMQ with Docker

To set up RabbitMQ using Docker, run the following command in your terminal:

docker run -d -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.12-management

This command pulls the RabbitMQ Docker image and starts a container with RabbitMQ running. The RabbitMQ management console will be accessible at http://localhost:15672 (username: guest, password: guest).

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/saeedNW/rabbitmq-microservice.git
  2. Navigate to the project directory:

    cd rabbitmq-microservice
  3. Install project dependencies:

    npm install
  4. Ensure RabbitMQ is running using Docker (as specified in the "Setting Up RabbitMQ with Docker" section).

  5. Follow the instructions for testing each service as described in the "Instructions for Testing Each service" section.

Instructions for Testing Each Service

Auth Service

To start and use the auth service follow these steps:

  1. Open a new terminal instants and navigate to auth service directory

    cd auth-service/
  2. Install project dependencies:

    npm install
  3. Start authenticate service:

    npm run dev

After starting the authentication service you can use the postman collection file in the project root directory to create a user and login to system.

Order Service

The order service is responsible for managing order queue so the only thing you need to do for it is to run it and let it be.

To start the order service follow theses steps:

  1. Open a new terminal instants and navigate to order service directory

    cd order-service/
  2. Install project dependencies:

    npm install
  3. Start order service:

    npm run dev

Product service

To start and use the product service follow these steps:

  1. Open a new terminal instants and navigate to product service directory

    cd product-service/
  2. Install project dependencies:

    npm install
  3. Start product service:

    npm run dev

After starting the product service you can use the postman collection file in the project root directory to create and buy a product. After registering a buy request you can start monitoring the order and product services terminal to see the result of RabbitMQ processes.

You can also monitor the process by opening the RabbitMQ manager web page in http://localhost:15672 (username: guest, password: guest).

Contributors

We would like to thank the following individuals who have contributed to the development of this project:

avatar ‎ ‎ ‎ avatar

Erfan Yousefi - Supervisor and instructor of the node.js programming course

Saeed Norouzi - Back-end Developer

rabbitmq-microservice's People

Contributors

saeednw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.