A REST API for tracking salaries, recurring expenses, and monthly summaries.
I built this project to solve a personal problem — I needed a way to keep track of my salary and fixed expenses. At the same time, I wanted to practice Quarkus on a real use case.
The Salary Tracker API helps manage:
- Base salary and adjustments
- Recurring fixed expenses (e.g. rent, loans)
- One-time expenses
- Monthly summaries of income vs expenses
It’s a simple but practical backend that reflects both a real need and my learning journey with Quarkus.
Features
- User authentication with JWT
- Salary management
- Expense categories
- Recurring expenses
- Monthly financial summaries
- Dockerized for easy deployment
The application follows a layered architecture:
- Resource Layer: REST endpoints for handling HTTP requests
- Service Layer: Business logic implementation
- Repository Layer: Data access using Panache
- Model Layer: Domain entities
- DTO Layer: Data transfer objects for API communication
- Security Layer: JWT authentication and authorization
- Java 21
- Quarkus 3 (RESTEasy, Hibernate Panache)
- MySQL 8
- JWT for authentication
- Docker
- Create a MySQL database:
CREATE DATABASE salary_tracker_app;
CREATE USER 'salary_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON salary_tracker_app.* TO 'salary_user'@'localhost';
FLUSH PRIVILEGES;- Update the database configuration in
src/main/resources/application.propertiesif needed.
./mvnw quarkus:devThis enables live coding with:
- Hot reload for code changes
- Dev UI at http://localhost:8080/q/dev/
- Swagger UI at http://localhost:8080/q/swagger-ui/
./mvnw package
java -jar target/quarkus-app/quarkus-run.jarThe API uses JWT (JSON Web Token) for authentication. To access protected endpoints:
- Register a user using the
/api/v1/users/registerendpoint - Login with the created user at
/api/v1/users/loginto receive a JWT token - Include the token in the
Authorizationheader for subsequent requests:
Authorization: Bearer your_jwt_token
POST /api/v1/users/register- Register a new userPOST /api/v1/users/login- Login and get JWT tokenGET /api/v1/users/me- Get current user information
GET /api/v1/salaries- Get all salariesGET /api/v1/salaries/{id}- Get salary by IDPOST /api/v1/salaries- Create a new salaryPUT /api/v1/salaries/{id}- Update a salaryDELETE /api/v1/salaries/{id}- Delete a salary
GET /api/v1/categories- Get all categoriesGET /api/v1/categories/{id}- Get category by IDPOST /api/v1/categories- Create a new categoryPUT /api/v1/categories/{id}- Update a categoryDELETE /api/v1/categories/{id}- Delete a category
GET /api/v1/expenses- Get all expensesGET /api/v1/expenses/{id}- Get expense by IDPOST /api/v1/expenses- Create a new expensePUT /api/v1/expenses/{id}- Update an expenseDELETE /api/v1/expenses/{id}- Delete an expense
GET /api/v1/recurringExpenses- Get all recurring expensesGET /api/v1/recurringExpenses/{id}- Get recurring expense by IDPOST /api/v1/recurringExpenses- Create a new recurring expensePUT /api/v1/recurringExpenses/{id}- Update a recurring expenseDELETE /api/v1/recurringExpenses/{id}- Delete a recurring expense
GET /api/v1/summary/{year}/{month}- Get financial summary for a specific month
API documentation is available via Swagger UI when the application is running:
- Development: http://localhost:8080/q/swagger-ui/
- Production: https://your-domain.com/q/swagger-ui/