https://github.com/getange/node-microservices
This repo contains a small project to test my knowledge in distributed systems
https://github.com/getange/node-microservices
expressjs mongodb mongoose node-js rabbitmq redis-server
Last synced: about 1 year ago
JSON representation
This repo contains a small project to test my knowledge in distributed systems
- Host: GitHub
- URL: https://github.com/getange/node-microservices
- Owner: GETANGE
- Created: 2025-04-30T08:26:02.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-02T16:26:42.000Z (about 1 year ago)
- Last Synced: 2025-06-03T05:51:16.551Z (about 1 year ago)
- Topics: expressjs, mongodb, mongoose, node-js, rabbitmq, redis-server
- Language: JavaScript
- Homepage:
- Size: 211 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node Microservices Project ๐
This repository showcases a microservices-based architecture implemented with Node.js, aiming to demonstrate proficiency in building distributed systems.
---
## โ๏ธ Technologies Used
* **Node.js** โ JavaScript runtime environment ๐ข
* **Express.js** โ Web framework for Node.js ๐
* **MongoDB** โ NoSQL database for data persistence ๐
* **Mongoose** โ ODM for MongoDB ๐
* **Redis** โ In-memory data structure store, used for caching and message brokering ๐ง
* **RabbitMQ** โ Message broker for asynchronous communication between services ๐
* **Docker & Docker Compose** โ Containerization and orchestration tools ๐ณ
---
## ๐งฑ Microservices Overview
The application is divided into the following microservices:
1. **API Gateway**: Serves as the single entry point for client requests ๐ช
2. **Identity Service**: Handles user authentication and authorization ๐
3. **Media Service**: Manages media uploads and processing ๐ผ๏ธ
4. **Post Service**: Manages creation, retrieval, and manipulation of posts ๐
5. **Search Service**: Provides search functionality across posts and media ๐
---
## ๐๏ธ Project Structure
```bash
node-microservices/
โโโ api-gateway/ # Entry point for all client requests
โโโ identity-service/ # User authentication and authorization
โโโ media-service/ # Media upload and processing
โโโ post-service/ # Post management
โโโ search-service/ # Search functionality
โโโ docker-compose.yml # Docker Compose configuration
โโโ README.md # Project documentation
```
---
## ๐ Getting Started
### ๐ Prerequisites
Ensure you have the following installed:
* [Docker](https://www.docker.com/) ๐ณ
* [Docker Compose](https://docs.docker.com/compose/) ๐งฉ
### โ๏ธ Installation
1. **Clone the repository:**
```bash
git clone https://github.com/GETANGE/node-microservices.git
cd node-microservices
```
2. **Start the services using Docker Compose:**
```bash
docker-compose up --build
```
This command will build and start all the microservices along with their dependencies.
---
## ๐ซ API Endpoints
Each microservice exposes specific endpoints. Below is a summary:
### ๐ API Gateway
* `POST /api/auth/register` โ Register a new user โ๏ธ
* `POST /api/auth/login` โ Authenticate a user ๐
* `GET /api/posts` โ Retrieve all posts ๐
* `POST /api/posts` โ Create a new post ๐
* `POST /api/media/upload` โ Upload media content ๐ค
* `GET /api/search?query=...` โ Search posts and media ๐
*Note: All requests should be directed to the API Gateway, which will route them to the appropriate service.*
---
## ๐งฐ Development
To work on a specific service:
1. **Navigate to the service directory:**
```bash
cd
```
2. **Install dependencies:**
```bash
pnpm install
```
3. **Start the service:**
```bash
pnpm start
```
Ensure that the necessary environment variables are set, either through a `.env` file or your system's environment settings.
---
## ๐งช Testing
Each service includes its own set of tests. To run tests for a service:
1. **Navigate to the service directory:**
```bash
cd
```
2. **Run the tests:**
```bash
pnpm test
```
---
## ๐ฆ Deployment
For production deployment, it's recommended to:
* Use a process manager like PM2 for managing Node.js processes ๐
* Set up reverse proxies (e.g., Nginx) for handling HTTPS and domain routing ๐
* Implement monitoring and logging solutions for observability ๐
---
## ๐ License
This project is licensed under the [MIT License](LICENSE).
---
## ๐ Acknowledgments
This project was developed to demonstrate knowledge in building distributed systems using Node.js and related technologies.