Microservices Product User Gateway
This repository demonstrates a microservices-based architecture built with Spring Boot. It includes services for managing Products and Users, with features like service discovery, API gateway integration, and inter-service communication using Feign Client.
🌟 Features
- ProductService: Manage products (CRUD operations).
- UserService: Manage users (CRUD operations).
- Service Registration: Eureka Server for dynamic service discovery.
- Zuul Gateway: API gateway for routing and load balancing.
- Feign Client: Simplified inter-service communication.
- Scalable Architecture: Separate services for easy scaling and management.
- Spring Boot: Framework for building and deploying microservices.
🏗️ Project Structure
- ProductService: Handles product-related operations.
- UserService: Manages user-related functionalities.
- ServiceRegistration: Eureka Server for service discovery.
- ZuulService: Gateway service using Zuul for routing and filtering requests.
- FeignClient: Enables easy communication between ProductService and UserService.
⚙️ Technology Stack
- Language: Java 8
- Framework: Spring Boot
- Service Discovery: Eureka
- API Gateway: Zuul
- Inter-Service Communication: Feign Client
- Build Tool: Maven
- Database: MySQL
🚀 Setup and Run Instructions
-
Clone the repository and navigate to the project directory.
-
Build the project using Maven.
- Start the services in the following order:
- ServiceRegistration (Eureka)
- ProductService
- UserService
- ZuulService (Gateway)
- Use the API Gateway to access the services:
http://localhost:8765/product-service/...
http://localhost:8765/user-service/...
📜 API Endpoints
ProductService
- GET
/products: Fetch all products.
- POST
/products: Add a new product.
- PUT
/products/{id}: Update a product.
- DELETE
/products/{id}: Delete a product.
UserService
- GET
/users: Fetch all users.
- POST
/users: Add a new user.
- PUT
/users/{id}: Update a user.
- DELETE
/users/{id}: Delete a user.