An open API service indexing awesome lists of open source software.

https://github.com/aswath0001/expense-tracker

Expense Tracker is a financial management application that helps users monitor their spending by recording and categorizing expenses. It provides insights through date-based filtering and visual reports to improve budgeting.
https://github.com/aswath0001/expense-tracker

java postman springboot sql

Last synced: 6 months ago
JSON representation

Expense Tracker is a financial management application that helps users monitor their spending by recording and categorizing expenses. It provides insights through date-based filtering and visual reports to improve budgeting.

Awesome Lists containing this project

README

          

Expense Tracker

A robust, scalable,and production-ready expense tracking system built with Spring Boot and MySQL. It supports full financial tracking, user management, split expenses, and real-time balance calculations.

Setup Instructions

Clone the Repository

git clone https://github.com/aswath0001/expense-tracker.git
cd expense-tracker

πŸš€ Features Overview
1. πŸ‘€ User Management

βœ… User Registration – Create new users with email validation

βœ… Get All Users – Retrieve full list of users

βœ… Get User by ID – Fetch specific user details

βœ… Update User – Modify user data

βœ… Delete User – Remove users with relationship handling

2. πŸ’Έ Expense Management

βœ… Create Expenses – Add new expense records

βœ… View All Expenses – Full expense history

βœ… Get Expense by ID – Retrieve specific expense

βœ… Update Expenses – Modify existing records

βœ… Delete Expenses – Remove records cleanly

βœ… Date Range Filtering – Filter expenses by date

βœ… Title-based Search – Find expenses by name/title

3. πŸ’° Income Tracking

βœ… Record Income – Add income entries

βœ… View All Income – Complete income log

βœ… Get Income by ID – Specific income details

βœ… Update Income – Edit income data

βœ… Delete Income – Remove entries

4. πŸ‘₯ Split Expense System

βœ… Create Splits – Divide expenses among users

βœ… View All Splits – See all divisions

βœ… Get Split by ID – Fetch a specific split

βœ… Settle Splits – Mark splits as settled

βœ… Delete Splits – Remove records

βœ… Payer-based Filtering – See what each user owes

βœ… Payee-based Filtering – See what each user receives

5. πŸ“Š Balance Management

βœ… Automatic Balance Updates – Real-time balance changes

βœ… User Balance Tracking – Current financial position

βœ… Transaction History – Full record of income, expenses, and splits

πŸ—„οΈ Database Structure
πŸ”‘ Core Tables

user – User accounts, balance tracking

expense – Expense records with categories and timestamps

income – Income records with source tracking

split_expense – Shared expenses across users

expense_participant – Links participants in splits

πŸ”— Key Relationships

Users can create multiple expenses and income entries

Expenses can be split between multiple users

Automatic balance sync between users

Referential integrity using foreign keys

🧠 Technical Architecture
βš™οΈ Backend

Spring Boot 3.x – Modern Java framework

Spring Data JPA – ORM and repository pattern

RESTful APIs – Clean, maintainable, scalable

CORS Enabled – Cross-origin resource sharing

Error Handling – Centralized and descriptive

πŸ—ƒοΈ Database

MySQL – Relational database integration

Auto-increment IDs – Primary key management

Foreign Key Constraints – Referential integrity

Transaction Management – ACID-compliant operations

Lazy Loading – Efficient resource use

βœ… Data Validation

Unique email enforcement

Proper data type validation

Foreign key constraints for relationships

Real-time balance sync logic

πŸ”„ Workflow Example

A user creates an expense: β‚Ή1000 Dinner

Split with 3 friends β†’ β‚Ή333.33 each

Automatic balance update:

Payer’s balance: -β‚Ή666.67

Each payee’s balance: +β‚Ή333.33

Splits are marked as settled when paid

🚦 Production-Ready Features

βœ… Database migrations with schema updates

βœ… Proper HTTP status codes & error responses

βœ… Full input validation

βœ… Optimized SQL queries via JPA

βœ… Scalable codebase and modular design

πŸ› οΈ Getting Started
Prerequisites

Java 17+

Maven

MySQL Server

Configure application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/expense_db
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update

Run the Application

mvn spring-boot:run