Building FairSplit: A Full-Stack Expense Splitting App
FairSplit is a full-featured expense splitting app that allows users to create groups, log shared expenses, and track who owes who. Built from scratch using Java and Spring Boot on the backend and React with Tailwind on the frontend, it supports JWT authentication, real-time balance calculations, and full CRUD functionality.
The Goal
Create a modern, real-world full-stack web app with:
- Secure registration and login using JWT
- Group creation and invite-based joining
- Adding shared expenses with custom splits
- Calculating live balances and settlement flows
- Clean, responsive frontend with Tailwind CSS
- Production deployment with Docker, Render, and Netlify
Stack Overview
Layer | Tools |
---|---|
Frontend | React + Vite + Tailwind CSS v4 |
Backend | Spring Boot + Gradle + JWT |
Database | PostgreSQL (via Render) |
Deployment | Backend on Render, Frontend on Netlify |
Auth | JWT token-based auth |
DevOps | Dockerfile + CI/CD + environment vars |
Core Features
- JWT Authentication: Secure login and protected routes
- Groups: Create, join via invite code, and manage
- Expenses: Add expenses, split between users, calculate who owes whom
- Balances: Auto-calculate real-time balances with custom logic
- Settlement Suggestions: Show users how to settle up (one-to-one)
- UI Polishing: Tailwind-based styling, component architecture, responsive layout
Challenges Faced
- Settlements logic: Designing a reliable way to resolve debt into simple payback suggestions
- CORS woes: Handling cross-origin requests between Netlify and Render (solved via config)
- JWT debugging: Tracking down subtle token bugs during auth routing
- Database setup: Using Flyway migrations to bootstrap cloud DB cleanly
- Dark mode regrets: Started, then scrapped — next version maybe
Deployment Notes
- Spring Boot backend containerized and deployed to Render via Docker
- PostgreSQL provisioned via Render’s managed DB
- React frontend deployed to Netlify with VITE_API_URL as an env var
- Netlify
_redirects
file added to support SPA routing
What I Learned
- How to build a scalable backend in Java with clean service/repo structure
- Deploying full-stack apps with Docker and cloud CI/CD
- Advanced CORS and JWT session handling across domains
- Tailwind v4 workflows in production-grade projects
- Real-world team-friendly folder structure and DTO/service isolation
Try It Out
FairSplit isn’t just a demo — it’s a deployable, usable full-stack application with clean architecture, production hosting, and sharp UI. It’s the foundation for more advanced apps to come, and a concrete example of what I can build from scratch and take all the way to production.