https://github.com/skew008/expense-tracker
A production-grade expense tracking system designed using a microservices architecture. It includes modular services for authentication, expense management, budgeting goals, analytics, and monthly reporting. Each service is containerized using Docker and discoverable via Eureka, with centralized routing handled through an API Gateway.
https://github.com/skew008/expense-tracker
docker docker-compose java microservices mysql-database spring-boot spring-cloud spring-data-jpa spring-security
Last synced: 3 months ago
JSON representation
A production-grade expense tracking system designed using a microservices architecture. It includes modular services for authentication, expense management, budgeting goals, analytics, and monthly reporting. Each service is containerized using Docker and discoverable via Eureka, with centralized routing handled through an API Gateway.
- Host: GitHub
- URL: https://github.com/skew008/expense-tracker
- Owner: Skew008
- Created: 2025-06-16T09:24:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-27T14:43:49.000Z (about 1 year ago)
- Last Synced: 2025-07-07T08:15:09.490Z (12 months ago)
- Topics: docker, docker-compose, java, microservices, mysql-database, spring-boot, spring-cloud, spring-data-jpa, spring-security
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Expense Tracker with Budgeting Goals
A backend system built using **Java**, **Spring Boot**, **Spring Cloud**, and **Docker** that allows users to track expenses, set budgeting goals, and view analytics of their spending habits.
## ๐ Features
- **User Authentication** using JWT
- **Expense Tracking** with category and tags
- **Budget Goal Setting** (monthly/weekly)
- **Spending Analytics** (by category/date)
- **Report Service**: Generate and email monthly reports
- **Service Discovery** using Eureka
- **API Gateway** for centralized routing
- **Dockerized Microservices** with MySQL
## ๐งฑ Microservices Architecture
| Service | Port | Description |
|----------------------|-------|--------------------------------------|
| `eureka-server` | 8761 | Service discovery |
| `api-gateway` | 8080 | Gateway for routing APIs |
| `auth-service` | 8081 | User registration, login, JWT auth |
| `expense-service` | 8082 | Add, view, delete expenses |
| `goal-service` | 8083 | Set and track budget goals |
| `analytics-service` | 8084 | Analyze spending trends |
| `report-service` | 8085 | Send Monthly Reports |
| `mysql` | 3306 | Shared relational database |
## ๐งฐ Tech Stack
- **Java 17**
- **Spring Boot 3**
- **Spring Cloud Netflix Eureka**
- **Spring Security + JWT**
- **Spring Data JPA**
- **MySQL**
- **Docker + Docker Compose**
## ๐ณ Run with Docker Compose
### 1. Build JARs for all services
```bash
cd auth-service && mvn clean package -DskipTests=true && cd ..
cd expense-service && mvn clean package -DskipTests=true && cd ..
cd goal-service && mvn clean package -DskipTests=true && cd ..
cd analytics-service && mvn clean package -DskipTests=true && cd ..
cd report-service && mvn clean package -DskipTests=true && cd ..
cd api-gateway && mvn clean package -DskipTests=true && cd ..
cd eureka-server && mvn clean package -DskipTests=true && cd ..
```
### 2. Build and start all services with Docker Compose
```bash
docker-compose up --build
```
### 3. Visit the services:
- **Eureka Server:** [http://localhost:8761](http://localhost:8761)
- **API Gateway:** [http://localhost:8080](http://localhost:8080)
## ๐ Sample Endpoints
| Method | Endpoint | Description |
|--------|------------------------------|------------------------------|
| POST | `/auth/register` | Register a new user |
| POST | `/auth/login` | Login and get JWT token |
| GET | `/api/expense` | List all expenses |
| POST | `/api/goal` | Create a budget goal |
| GET | `/api/analytics/overview` | View analytics summary |
## ๐ฆ Environment Variables (used in Docker Compose)
Each service reads DB config like:
```properties
SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/expense_tracker
SPRING_DATASOURCE_USERNAME=root
SPRING_DATASOURCE_PASSWORD=root
```
## ๐งช Future Enhancements
- Email/SMS reminders
- User roles and admin panel
- OAuth2 / Google login
- Export data as CSV