https://github.com/keshavabanda/micro-services
Exploring microservices in the real world - This is a sample project I was exploring recently with dockering..
https://github.com/keshavabanda/micro-services
api-security authentication express javascript jwt mongodb mongoose nodejs rest-api
Last synced: 27 days ago
JSON representation
Exploring microservices in the real world - This is a sample project I was exploring recently with dockering..
- Host: GitHub
- URL: https://github.com/keshavabanda/micro-services
- Owner: keshavaBanda
- Created: 2025-07-17T17:41:08.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-07-17T19:08:59.000Z (6 months ago)
- Last Synced: 2025-07-17T22:47:07.530Z (6 months ago)
- Topics: api-security, authentication, express, javascript, jwt, mongodb, mongoose, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐งฉ Microservices-Based TODO Application (MEAN Stack)
This project demonstrates how to build a scalable and secure TODO application using **Microservices architecture** with the **MEAN stack** (MongoDB, Express, Angular, Node.js).
---
## ๐ฆ Project Structure
microservices-todo-app/
โโโ todo-services # Handles todo CRUD operations with authorization
โโโ user-services # Handles user registration, login, and JWT auth
โโโ frontend/ # Angular app (planned for micro frontend integration)
---
## ๐ Features
- โ
**Two Independent Services**: `user-service` and `todo-service`
- ๐ **JWT-based Authentication** (via login API)
- ๐ **Route-Level Authorization** using Express middleware
- ๐ค Only the **creator** of a TODO can update or delete it
- ๐ **Service-to-Service Communication** using Axios
- ๐ฑ **MongoDB Integration** with Mongoose models
- ๐
Created using real-world REST API design principles
---
## ๐ Tech Stack
- **Backend**: Node.js, Express.js
- **Database**: MongoDB (Mongoose ODM)
- **Authentication**: JWT (JSON Web Token)
- **Frontend**: Angular (To be integrated as Micro Frontend)
- **Communication**: Axios for internal service HTTP calls
---
## ๐งช How to Run Locally
### โ๏ธ 1. Clone the repository
```bash
git clone https://github.com/keshavaBanda/micro-services.git
cd microservices-todo-app
```
## ๐ 2. Start MongoDB
Make sure MongoDB is running on your system (default port 27017).
๐ง Recommended: Use MongoDB Compass for UI access.
## ๐งโโ๏ธ 3. Run user-service
cd user-service
npm install
cp .env.example .env # Or manually create .env
npm start
```bash
PORT=3001
JWT_SECRET=your_jwt_secret_key
MONGO_URI=mongodb://localhost:27017/user-service
```
## โ
4. Run todo-service
cd ../todo-service
npm install
cp .env.example .env # Or manually create .env
npm start
Sample .env file:
PORT=3000
MONGO_URI=mongodb://localhost:27017/todo-service
JWT_SECRET=your_jwt_secret_key # Must match user-service
## ๐งช 5. Test with Postman
Use Postman or any REST client to:
Register/Login via user-service to get a token
Use the token as Bearer in the Authorization header for all todo-service API calls
## โจ Upcoming Enhancements
๐ Connect to Micro Frontend (Angular)\
๐ณ Dockerize both services\
๐ Add API Gateway for unified routing\
๐ Refresh Token Mechanism\
๐ Logging and Monitoring