This project demonstrates a microservices architecture using Spring Boot, with various services that interact with each other through a central API Gateway. It includes services for authentication, expense tracking, and notifications, all of which are monitored using Grafana and deployed in Docker containers.
The system consists of multiple microservices with a centralized API Gateway to route requests. Here's a high-level description of the components:
- Angular Frontend: Serves as the client-side interface for interacting with the microservices.
- Spring Cloud API Gateway: Acts as an entry point for all incoming requests, handling routing and load balancing.
- Eureka Server: Service registry that allows the microservices to locate and communicate with each other.
- Authorization/Authentication Server: Manages user authentication and authorization.
- Expense Tracking Service: Handles the operations related to expense management.
- Notification Service: Sends notifications based on different events or triggers.
- Grafana: Provides monitoring and metrics for the services.
- Docker: Used to containerize the application for easy deployment and scaling.
-
API Gateway:
- Handles routing and security for the microservices.
- Configured using Spring Cloud Gateway.
-
Eureka Server:
- Acts as a service registry for discovery and registration of microservices.
- Ensures load balancing and resilience of services.
-
Authorization/Authentication Service:
- Responsible for user authentication (login and registration).
- Manages access tokens and secures APIs.
-
Expense Tracking Service:
- Manages CRUD operations for expenses.
- Stores data in a relational database.
-
Notification Service:
- Sends notifications for events like successful authentication, new expense entries, etc.
- Spring Boot: Microservices, Eureka, Gateway, and Security.
- Angular: Frontend framework.
- Grafana: Monitoring and analytics.
- Docker: Containerization.
- MySQL/PostgreSQL (or any relational database): Data persistence.
- gRPC/REST: Communication protocols.
- Java 17 or above
- Docker and Docker Compose
- Node.js (for Angular frontend)
git clone https://github.com/ThePygmalion/Springboot-Microservices.git
cd spring-boot-microservices-project-
Start Eureka Server:
cd eureka-server ./mvnw spring-boot:run -
Start API Gateway:
cd api-gateway ./mvnw spring-boot:run -
Start Authorization/Authentication Server:
cd auth-service ./mvnw spring-boot:run -
Start Expense Tracking Service:
cd expense-service ./mvnw spring-boot:run -
Start Notification Service:
cd notification-service ./mvnw spring-boot:run
To simplify deployment, use Docker Compose to bring up all services.
docker-compose up -d- Navigate to the
frontenddirectory. - Install dependencies:
npm install
- Start the Angular application:
ng serve
| Service | Endpoint | Description |
|---|---|---|
| API Gateway | /api/** |
Routes requests to services |
| Authorization Service | /auth/login, /auth/signup |
User login and registration |
| Expense Tracking Service | /expenses/** |
CRUD operations for expenses |
| Notification Service | /notifications/** |
Triggers notifications |
Grafana is set up to monitor the health and metrics of the microservices. Access Grafana at http://localhost:3000 (default credentials are admin/admin).