A modern, scalable microservices-based e-commerce backend built with Spring Boot and Spring Cloud. BuyBuddy provides a robust foundation for customer, product, and order management with service discovery capabilities.
- Microservices Architecture: Three independent services (Customer, Product, Order)
- Service Discovery: Integrated Eureka server for service registration and discovery
- RESTful APIs: Clean, well-structured endpoints for all operations
- CORS Enabled: Pre-configured for frontend integration
- MySQL Integration: Persistent data storage with JPA
- Admin Dashboard: Built-in management UI
- Java 17
- Spring Boot 3.x
- Spring Cloud (Eureka, Feign Clients)
- MySQL Database
- Gradle Build System
- Java 17 or higher
- MySQL Server
- Gradle (or use included wrapper)
- Clone and setup the database:
mysql -u root -p -e "CREATE DATABASE buybuddy_microservices_mysql_db"- Update database credentials in each service's
application.properties:
spring.datasource.username=your_username
spring.datasource.password=your_password- Start the services (in order):
# Start Eureka Server (port 8761)
cd eureka-server && ./gradlew bootRun
# Start Customer Service (port 8081)
cd ../buy-buddy-customer-service && ./gradlew bootRun
# Start Product Service (port 8082)
cd ../buy-buddy-product-service && ./gradlew bootRun
# Start Order Service (port 8083)
cd ../buy-buddy-order-service && ./gradlew bootRunGET /api/customers- List all customersPOST /api/customers- Create new customerGET /api/customers/{id}- Get customer by IDPUT /api/customers/{id}- Update customerDELETE /api/customers/{id}- Delete customer
GET /api/products- List all productsPOST /api/products- Create new productGET /api/products/{id}- Get product by IDPUT /api/products/{id}- Update productDELETE /api/products/{id}- Delete product
GET /api/orders- List all ordersPOST /api/orders- Create new orderGET /api/orders/{id}- Get order by IDDELETE /api/orders/{id}- Delete order
Use Postman or curl to test:
-
Create customer:
POST http://localhost:8081/api/customers Body: {"name": "Crio Beaver", "email": "beaver@criodo.com"} -
Get customers:
GET http://localhost:8081/api/customers
-
Create product:
POST http://localhost:8082/api/products Body: {"name": "iPad Air", "price": 60000} -
Get products:
GET http://localhost:8082/api/products
-
Create order:
POST http://localhost:8083/api/orders Body: {"customerId": 1, "productIds": [1, 2]} -
Get order:
GET http://localhost:8083/api/orders/1
- Ensure MySQL is running before starting services
- Verify all services are registered in Eureka dashboard: http://localhost:8761
- Database configurations should be properly set in each service's application.properties
- If services fail to start, check database connection settings
- Verify all dependencies are properly imported in build.gradle files
- Ensure correct port configurations for each service
Access the built-in admin interface at http://localhost:8081 after starting the customer service. The dashboard provides:
- Customer management
- Product catalog management
- Order processing
- Real-time statistics
Each service is a standalone Spring Boot application. Use the included Gradle wrapper to build and run:
./gradlew build
./gradlew bootRunKey configuration files:
application.properties- Database and server settingsWebConfig.java- CORS and web configuration- Feign clients for inter-service communication
This project is part of the BuyBuddy e-commerce platform.