A full-stack microservices application built with Spring Boot 3, Java 17, PostgreSQL, and a Node.js-powered frontend.
No Docker required — runs locally with Maven and Node.js.
Perfect for learning, portfolios, or production prototypes.
This project simulates an e-commerce system with:
- ✅
user-service: Manages user data - ✅
order-service: Manages orders - ✅
discovery-server: Eureka Server for service discovery - ✅ PostgreSQL: Persistent database (no H2)
- ✅ Frontend: HTML + JavaScript served via
http-server - ✅ CORS: Enabled for frontend-backend communication
- ✅ Maven multi-module structure
All services register with Eureka and communicate via REST.
- ✅ REST APIs with Spring Web
- ✅ Service Discovery with Eureka
- ✅ Persistent Data with PostgreSQL
- ✅ Frontend integration (no Docker)
- ✅ CORS enabled for
http://localhost:3000 - ✅ Inter-service communication (future-ready)
- ✅ Maven multi-module structure
- ✅ Runs without Docker
- ✅ Full
READMEin one file
ecommerce-microservices/
├── user-service/ → User management (8081)
├── order-service/ → Order management (8082)
├── discovery-server/ → Eureka Server (8761)
├── frontend/ → Static HTML/JS (3000)
├── pom.xml → Parent Maven POM
└── README.md ← You're here!
- ✅ Java 17 (JDK 17)
- ✅ Maven 3.6+ (
mvn --version) - ✅ Node.js + npm (for frontend:
npx http-server) - ✅ PostgreSQL (installed manually or via installer)
- ✅ Browser (Chrome, Firefox, Edge)
Download: https://www.postgresql.org/download/
Create databases:
CREATE DATABASE userdb;
CREATE DATABASE orderdb;
## 🧪 Step-by-Step: Run the Project
### 1. Clone the repo
```bash
git clone https://github.com/yourname/ecommerce-microservices.git
cd ecommerce-microservices
Use:
- Username: postgres
- Password: admin123
- Port: 5432
cd discovery-server
mvn spring-boot:run
✅ Open: http://localhost:8761 → Eureka Dashboard
cd user-service
mvn spring-boot:run
- → Runs on http://localhost:8081
- ✅ Registers with Eureka
cd user-service
mvn spring-boot:run
- → Runs on http://localhost:8082
- ✅ Registers with Eureka
cd frontend
npx http-server -p 3000
- → Runs on http://localhost:3000
curl -X POST http://localhost:8081/users \
-H "Content-Type: application/json" \
-d '{"name":"Alice","email":"alice@example.com"}'
-H "Content-Type: application/json" \
-d '{"item":"Laptop","quantity":1,"userId":1}' ```
- After starting services,
- open: 👉 http://localhost:8761
You should see:
🔍 Troubleshooting
- ✅ Add Eureka Discovery Server
- ✅ Add API Gateway (Spring Cloud Gateway)
- ✅ Add Config Server
- ✅ Add Resilience4j (Circuit Breaker)
- ✅ Add Distributed Tracing (Sleuth + Zipkin)
- ✅ Dockerize all services
- ✅ Deploy on Kubernetes (Minikube / Kind)
- 🙌 Author
- 👤 Rajeev NAYAN
- 📧 imrajeevnayan.@gmail.com
- 🔗 GitHub
This project is open source. Please check the repository for license information.
- imrajeevnayan - Project Creator - @imrajeevnayan
- Thanks to all contributors who have helped shape this project
- Inspired by the open-source community
- Built with ❤️ and modern development practices
- ⭐ Stars: 0
- 🍴 Forks: 0
- 🐛 Issues: 0
- 📝 Language: Java
⭐️ If you found this project helpful, please give it a star!