Expense Splitter is a backend system designed to manage shared group expenses, member balances, and intelligent CSV-based expense imports with anomaly detection.
The system supports:
- Group-based expense management
- Expense participant tracking
- Balance simplification
- Intelligent CSV ingestion
- Automated anomaly detection
- Financial validation workflows
- Auto onboarding of imported users
This project was developed as part of a backend engineering assignment focused on real-world financial data handling and import workflow design.
| Technology | Purpose |
|---|---|
| Java 17 | Core language |
| Spring Boot | Backend framework |
| Spring Data JPA | ORM and persistence |
| Hibernate | Database interaction |
| MySQL | Relational database |
| Maven | Dependency management |
| Apache Commons CSV | CSV parsing |
| Lombok | Boilerplate reduction |
| BCrypt | Password hashing |
- User registration
- User login
- Password encryption using BCrypt
- DTO + Mapper based architecture
- Create groups
- Add members to groups
- Remove members from groups
- Retrieve group members
- Membership timeline tracking
- Create expenses
- Split expenses among participants
- Group balance calculation
- Balance simplification logic
The system includes an anomaly-aware CSV import workflow capable of:
- Multipart CSV upload
- Row-by-row parsing
- Structured import report generation
- Missing amount detection
- Invalid amount format detection
- Decimal precision validation
- Negative/refund transaction detection
- Zero amount detection
- Missing payer detection
- Missing participant detection
- Missing currency validation
- Unsupported currency validation
- Unsupported split type detection
- Missing split details validation
- Invalid date format handling
-
Settlement transaction detection
-
Duplicate expense heuristics
-
Unknown user detection
-
Auto onboarding of imported users
-
Classification into:
- VALID
- WARNING
- ERROR
- NEEDS_REVIEW
Only validated rows are imported into the database:
CSV → Validation → Anomaly Detection → User Resolution → Expense Creation → Participant Creation → Import Report
The project follows a layered backend architecture:
controller → service → repository → database
Additional layers:
- DTO layer
- Mapper layer
- Request/Response models
- Import validation engine
Stores application users.
Represents expense groups.
Tracks group membership and membership timeline.
Stores expenses and financial metadata.
Stores participant share information.
| Method | Endpoint |
|---|---|
| POST | /api/auth/register |
| POST | /api/auth/login |
| Method | Endpoint |
|---|---|
| POST | /api/groups |
| POST | /api/groups/{groupId}/members |
| DELETE | /api/groups/{groupId}/members/{userId} |
| GET | /api/groups/{groupId}/members |
| Method | Endpoint |
|---|---|
| POST | /api/expenses |
| GET | /api/groups/{groupId}/balances |
| GET | /api/groups/{groupId}/simplify-balances |
| Method | Endpoint |
|---|---|
| POST | /api/import/csv |
Request Type: multipart/form-data
Parameter: file
git clone <repository-url>
cd expense-splitterUpdate application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/expense_splitter
spring.datasource.username=root
spring.datasource.password=your_passwordmvn clean installmvn spring-boot:runApplication runs on:
http://localhost:8080
POST /api/import/csv
The importer:
- Parses CSV rows
- Detects anomalies
- Validates financial consistency
- Auto-creates missing users
- Creates expenses and participants
- Generates import report
[
{
"rowNumber": 1,
"status": "VALID",
"message": "Expense imported successfully"
},
{
"rowNumber": 11,
"status": "ERROR",
"message": "Unsupported split type: unequal"
},
{
"rowNumber": 25,
"status": "WARNING",
"message": "Negative amount detected (possible refund)"
}
]AI assistance was used during:
- Architecture brainstorming
- CSV validation workflow design
- Debugging assistance
- Import pipeline refinement
- Documentation drafting
All generated suggestions were manually reviewed, tested, adapted, and integrated into the final implementation.
Detailed AI collaboration notes are documented separately in AI_USAGE.md.
The repository maintains a structured and meaningful commit history with feature-based commits following industry-style conventions such as:
feat(auth): implement authentication module
feat(group): implement group management workflows
feat(import): add intelligent CSV import engine
Potential future enhancements include:
- JWT authentication
- Swagger/OpenAPI documentation
- Async import processing
- Import history persistence
- Frontend dashboard
- Role-based access control
- Advanced duplicate similarity matching
Vijay Kumar
Backend Engineering Assignment Submission