SplitSmart is a small Flask-based web application used to track shared expenses between roommates. It was created as the final project for SDEV‑220 (Team C).
- Web form built with HTML and vanilla JavaScript
- Input validation on the client side
/add_expenseAPI route stores rent and grocery costs in an SQLite database/get_expensesAPI route returns a JSON list of saved expenses
app.py– Flask routes and server configurationdata/– SQLite schema and helper functions (db.py)templates/– HTML interface (index.html)static/– basic stylesheetclasses/– placeholder modules for future object‑oriented design
- (Optional) Create a virtual environment
python -m venv venv source venv/bin/activate - Install dependencies
pip install -r requirements.txt
- Initialize the database
flask --app app.py init-db
- Run the development server
flask --app app.py run -p 3000
Open http://localhost:3000 in your browser to access the app.
Run the unit test suite with:
pytestEnter the names of up to four roommates and specify the rent and grocery totals. Click Add Bill to save the expenses or View Debts to retrieve everything stored in the database.
The repository includes a sample data/database file for convenience. You can delete it and run the init-db command to start fresh.
-
Team Member (Backend Developer)
Led development and planning. Built and tested all backend Flask routes including/add_expense,/get_expenses, and/get_balances. Integrated form inputs with SQLite, connected frontend to backend, managed GitHub repository, and ensured project completion. -
Emma (Frontend Developer)
Built the HTML form layout and JavaScript functions for validating user input and submitting expenses. Implemented the initial structure of the Add Bill and View Debts functionality and styled the user interface. -
Matt (Backend Developer)
Assisted with backend database logic and route handling. -
Zane (Data Handler)
Managed JSON data or database layer.
The /get_expenses endpoint returns JSON similar to the following:
[
{"id": 1, "description": "Rent", "amount": 999.0},
{"id": 2, "description": "Groceries", "amount": 999.0},
{"id": 3, "description": "Rent", "amount": 843.0},
{"id": 4, "description": "Groceries", "amount": 838.0}
]