A modern, production-ready web application for splitting expenses and calculating settlements between friends, roommates, and travel groups.
- Smart Settlement Logic: Advanced algorithm to calculate "who owes who" across multiple receipts
- Real-time Collaboration: Share trips with unique invite codes and track expenses together
- Customizable Themes: Personalize trip covers and receipt designs
- Receipt Management: Upload receipt photos and add items with automatic calculations
- Multi-location Support: Track expenses from different locations within a single trip
- Secure Authentication: Google Sign-in with Firebase
- PDF Export: Print or export settlement summaries
- Frontend: React 18 + Vite (modern, fast builds)
- Backend: Flask (Python) - Serverless on Vercel
- Database: Firebase Firestore (real-time, scalable)
- Auth: Firebase Authentication with Google Provider
- Hosting: Vercel (frontend + backend)
- Node.js 18+ and npm 9+
- Python 3.9+
- Firebase project account
- Vercel account (for deployment)
# Clone the repository
git clone <your-repo-url>
cd GroupTab
# Setup backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Setup frontend
cd frontend
npm install
cd ..cp frontend/.env.example frontend/.envEdit frontend/.env with your Firebase credentials:
VITE_API_KEY=your_firebase_api_key
VITE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_PROJECT_ID=your-project-id
VITE_STORAGE_BUCKET=your-project.appspot.com
VITE_MESSAGING_SENDER_ID=your_sender_id
VITE_APP_ID=your_app_id
cp .env.example .envEdit .env:
FLASK_ENV=development
CORS_ORIGINS=http://localhost:3000
# Terminal 1: Backend
source venv/bin/activate
python -m flask --app api/index run --port 5000
# Terminal 2: Frontend
cd frontend
npm run devVisit http://localhost:5173
-
Connect Repository
- Push code to GitHub/GitLab
- Connect to Vercel dashboard
-
Set Environment Variables
- Add all Firebase credentials to Vercel project settings
- Add
CORS_ORIGINSwith your production domain
-
Deploy
npm install -g vercel vercel
- Set
FLASK_ENV=productionon Vercel - Update
CORS_ORIGINSto production domain - Configure Firebase security rules for production
- Enable HTTPS on custom domain
- Set up monitoring and error tracking
- Review security headers (included in vercel.json)
- Test payment flows and calculations
β Implemented:
- Secure environment variable management
- CORS protection
- Rate limiting (30 requests/minute on /api/calculate)
- Security headers (X-Frame-Options, X-Content-Type-Options, etc.)
- Input validation on all API endpoints
- HTTP-only Firebase auth tokens
- No console logs in production builds
Edit frontend/src/App.css CSS variables:
:root {
--primary: #0891b2; /* Teal */
--secondary: #3b82f6; /* Blue */
--bg-deep: #0f172a; /* Background */
}Toggle features in frontend/.env:
VITE_ENABLE_ANALYTICS=true
VITE_ENABLE_ERROR_REPORTING=true
The backend uses a proven algorithm to calculate fair settlements:
- Aggregates all expenses by person
- Calculates net balances
- Optimizes settlement transactions (fewer, cleaner payments)
- Returns who owes whom and how much
# Frontend
cd frontend
npm run lint
npm run build # Test production build
# Backend
python -m pytest # if tests addedCORS errors?
- Check
CORS_ORIGINSin backend config - Verify frontend URL matches allowed origin
Firebase auth not working?
- Verify Firebase credentials in .env
- Check Google OAuth redirect URLs in Firebase console
- Ensure Firestore rules allow access
Backend timeout?
- Increase
maxDurationin vercel.json if needed - Check backend logs:
vercel logs
Build failing?
- Clear node_modules:
rm -rf node_modules && npm install - Check Node version:
node --version(should be 18+)
# View Vercel logs
vercel logs
# Local backend logs (development)
# Check console output in terminal
# Frontend errors
# Browser DevTools Console (F12)GroupTab/
βββ api/
β βββ index.py # Flask backend
β βββ settlement.py # Calculation logic
βββ frontend/
β βββ src/
β β βββ App.jsx # Main component
β β βββ App.css # Styling
β β βββ firebase.js # Firebase config
β β βββ main.jsx # Entry point
β βββ index.html
β βββ vite.config.js
βββ vercel.json # Deployment config
βββ requirements.txt # Python dependencies
βββ README.md
- Create a feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature/your-feature - Open a Pull Request
MIT License - see LICENSE file for details
- Issues: GitHub Issues
- Documentation: See docs/ folder
- Email: support@grouptab.app
Planned features:
- Mobile app (React Native)
- Recurring expense tracking
- Payment integration (Stripe/PayPal)
- Group analytics and charts
- Multi-currency support
- Email notifications
Built with β€οΈ for making expense-splitting simple and fair.