Backend REST API for Expense Splitter, a full-stack application inspired by Splitwise that helps users manage shared expenses, calculate balances, and simplify settlements within groups.
Backend
https://expense-splitter-backend-eb7u.onrender.com/
Swagger API Documentation
https://expense-splitter-backend-eb7u.onrender.com/swagger-ui/index.html
- User Registration
- User Login
- JWT Authentication
- Password Encryption using BCrypt
- Protected APIs with Spring Security
- Create Group
- View Groups
- Delete Group
- Soft Delete Support
- Add Members
- Remove Members
- Group Membership Validation
- Add Expense
- Delete Expense
- Equal Split
- Exact Split
- Input Validation
- Calculate Group Balances
- Calculate User Balances
- Settlement Suggestions
- Optimized Debt Simplification
- Global Exception Handler
- Consistent API Response Structure
- Validation Error Handling
- Java 21
- Spring Boot
- Spring Security
- Spring Data JPA
- Hibernate
- JWT
- Maven
- TiDB Cloud (MySQL Compatible)
- Docker
- Render
Controller
β
βΌ
Service Layer
β
βΌ
Repository Layer
β
βΌ
Database (TiDB Cloud)
Project follows a layered architecture for better maintainability and separation of concerns.
src
βββ main
βββ controller
βββ service
βββ repository
βββ entity
βββ dto
βββ security
βββ config
βββ exception
βββ ExpenseSplitterApplication
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/signup |
Register User |
| POST | /auth/login |
Login User |
| Method | Endpoint |
|---|---|
| GET | /groups |
| POST | /groups |
| GET | /groups/{id} |
| DELETE | /groups/{id} |
| Method | Endpoint |
|---|---|
| POST | /groups/{groupId}/members/{userId} |
| DELETE | /groups/{groupId}/members/{userId} |
| GET | /groups/members/{groupId} |
| Method | Endpoint |
|---|---|
| POST | /expenses/groups/{groupId}/expenses |
| GET | /expenses/groups/{groupId}/expenses |
| DELETE | /expenses/{expenseId} |
| Method | Endpoint |
|---|---|
| GET | /balances/groups/{groupId}/balances |
| GET | /balances/groups/{groupId}/settlements |
| GET | /balances/me |
Create an .env (or configure environment variables in your deployment platform):
DB_URL=
DB_USERNAME=
DB_PASSWORD=
JWT_SECRET=git clone https://github.com/DevbBhatt/expense-splitter-backend.gitMove into project
cd expense-splitter-backendRun
./mvnw spring-boot:runBuild
docker build -t expense-splitter-backend .Run
docker run -p 8080:8080 expense-splitter-backend| Service | Platform |
|---|---|
| Backend | Render |
| Database | TiDB Cloud |
- Email Verification
- Password Reset
- Recurring Expenses
- Expense Categories
- Notifications
- File Attachments
- Group Invitations
- Audit Logs
Dev Bhatt
GitHub
https://www.linkedin.com/in/dev-bhatt-9825b12bb/