A backend Expense Tracker application built with Java, Spring Boot, and Spring Cloud, designed using a microservices architecture.
The project separates user management, expense management, service discovery, centralized configuration, and API routing into independent services.
┌─────────────────────┐
│ Client │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ API Gateway │
│ :8088 │
└──────────┬──────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ User Service │ │ Expense Service │
│ :8087 │ │ :8086 │
└────────┬────────┘ └────────┬────────┘
│ │
│ OpenFeign │
└───────────────┬───────────────┘
│
▼
┌───────────────┐
│ PostgreSQL │
└───────────────┘
┌─────────────────┐ ┌─────────────────┐
│ Eureka Server │ │ Config Server │
│ :8761 │ │ configurable │
└─────────────────┘ └─────────────────┘
| Service | Responsibility | Port |
|---|---|---|
config-server |
Centralized configuration | Configured in service |
eureka-server |
Service discovery and registration | 8761 |
user-service |
User registration and profile management | 8087 |
expense-service |
Expense management | 8086 |
api-gateway |
Single entry point and request routing | 8088 |
- Java 21
- Spring Boot 4.1.1
- Spring Cloud 2025.1.3
- Spring Web
- Spring Data JPA
- Hibernate
- Jakarta Validation
- Lombok
- Spring Cloud Netflix Eureka
- Spring Cloud Config
- Spring Cloud Gateway
- OpenFeign
- Service Discovery
- Client-side load balancing
- PostgreSQL
- JPA / Hibernate
- Maven
- IntelliJ IDEA
- Git
- GitHub
- Postman
- Microservices-based backend architecture
- Centralized configuration using Spring Cloud Config
- Service registration and discovery using Eureka
- API Gateway for routing client requests
- User management APIs
- Expense management APIs
- Inter-service communication using OpenFeign
- PostgreSQL persistence
- RESTful APIs
- Jakarta Bean Validation
- Independent service structure suitable for deployment
Meridian-Spring/
│
├── api-gateway/
│ ├── src/
│ └── pom.xml
│
├── config-server/
│ ├── src/
│ └── pom.xml
│
├── eureka-server/
│ ├── src/
│ └── pom.xml
│
├── user-service/
│ ├── src/
│ └── pom.xml
│
├── expense-service/
│ ├── src/
│ └── pom.xml
│
├── .gitignore
└── README.md
The API Gateway acts as the single entry point for client requests.
Client
│
▼
http://localhost:8088
│
├── /user-service/**
│
└── /expense-service/**
Requests are routed to the corresponding service through service discovery.
Application services register with the Eureka Server.
Eureka Server :8761
│
├── API-GATEWAY
├── USER-SERVICE
└── MERIDIAN
MERIDIAN is the registered service name used by the Expense Service.
The Expense Service communicates with the User Service using OpenFeign and Eureka-based service discovery rather than relying on a hardcoded service IP.
Base URL:
http://localhost:8087
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/users/signup |
Create a user |
GET |
/api/users/{id} |
Get user profile |
GET |
/api/users/getAllUsers |
Get all users |
PUT |
/api/users/editProfile/{id} |
Edit user profile |
PATCH |
/api/users/editProfileField/{id} |
Edit individual profile fields |
DELETE |
/api/users/deleteUserById/{id} |
Delete user |
Base URL:
http://localhost:8086
The Expense Service manages expense-related operations and communicates with the User Service through OpenFeign.
Base URL:
http://localhost:8088
Example:
GET /user-service/api/users/getAllUsersThe Gateway resolves USER-SERVICE through Eureka and forwards the request to the User Service.
The Config Server provides centralized configuration for the microservices.
This allows common and environment-specific configuration to be managed centrally instead of duplicating configuration across services.
For deployment, sensitive values such as database passwords, API keys, and tokens should be supplied through environment variables or platform secrets rather than committed to GitHub.
- Java 21
- Maven
- PostgreSQL
- Git
Verify:
java -version
mvn -versionStart the services in this order:
1. Config Server
2. Eureka Server
3. User Service
4. Expense Service
5. API Gateway
Eureka dashboard:
http://localhost:8761
User Service:
http://localhost:8087
Expense Service:
http://localhost:8086
API Gateway:
http://localhost:8088
The services use PostgreSQL for persistence.
Use environment variables for credentials:
spring.datasource.url=${DATABASE_URL}
spring.datasource.username=${DATABASE_USERNAME}
spring.datasource.password=${DATABASE_PASSWORD}Do not commit production credentials to GitHub.
- JWT authentication and authorization
- Role-based access control
- Expense categories and analytics
- Pagination and sorting
- Global exception handling
- Swagger / OpenAPI documentation
- Docker containerization
- GitHub Actions CI/CD
- Redis caching
- Kafka-based event-driven communication
- Prometheus and Grafana monitoring
- Cloud deployment
This project demonstrates practical experience with:
Java
↓
Spring Boot
↓
REST APIs
↓
Spring Cloud
├── Config Server
├── Eureka
├── Gateway
└── OpenFeign
↓
PostgreSQL
↓
Microservices Architecture
Krishna Sai Raj
Java | Spring Boot | Microservices | Cloud | GenAI
This project is intended for learning and portfolio purposes.