CSC336 Group Project
- Alhassana Diallo
- Benny
- Sufyaan
- Pedro
- Yeasin Riyad
- Sangita Shrestha
- Jancarlos Jaquez
A SaaS platform that allows apartment tenants to reserve and pay for laundry machines while providing building managers with real-time machine availability and revenue tracking.
- backend/ → Backend application code
- frontend/ → User interface code
- database/ → Database schema, SQL scripts, and ER diagrams
- docs/ → Project documentation and reports
WashWise is a full-stack laundry reservation application for apartment buildings.
Tenants can log in, view available washers and dryers, reserve a machine, view their bookings, and cancel reservations.
Building managers can log in to a manager dashboard to monitor machines, view live revenue information, and see the building subscription plan.
Course: CSC336 – Introduction to Database Systems
Project type: Full-stack relational database application
- SvelteKit
- HTML
- CSS
- JavaScript
- Python
- Flask
- mysql-connector-python
- MySQL
- Stored procedures
- Triggers
- Views
- Indexes
- Database-based login for tenants and managers
- Role-based tenant and manager dashboards
- Live washer and dryer availability
- Machine duration and price information
- Tenant machine reservations
- Tenant booking history
- Booking cancellation
- Stored procedure for booking creation
- Booking overlap prevention
- Trigger-based machine status updates
- Manager machine inventory
- Live booking-fee revenue from MySQL
- Live subscription revenue from MySQL
- Live building subscription plan information
- Transaction-fee revenue model
- Building SaaS subscription model
WashWise uses two revenue streams:
- A transaction fee from every laundry booking
- A recurring SaaS subscription paid by each apartment building
Example for a $3.00 laundry cycle:
- Building share: $2.55
- Application developer fee: $0.45
- Transaction fee rate: 15%
The database stores the revenue split in the booking_payments table.
Building subscriptions are stored using:
subscription_plansbuilding_subscriptionssubscription_payments
The final database contains these main tables:
buildingsusersmachinesbookingsbooking_paymentssubscription_plansbuilding_subscriptionssubscription_payments
The data model is normalized to at least Second Normal Form.
Email:
Password:
password123
Email:
Password:
password123
LaundryApp/
├── backend/
│ ├── app.py
│ ├── db.py
│ ├── schema.sql
│ ├── procedures.sql
│ ├── indexes_views.sql
│ ├── seed.py
│ ├── test_api.py
│ ├── test_db.py
│ ├── requirements.txt
│ └── .env.example
├── database/
├── docs/
├── frontend/
│ ├── src/
│ │ └── routes/
│ │ └── +page.svelte
│ ├── package.json
│ └── vite.config.js
├── compose.yaml
├── Midpitch.pdf
└── README.md
GitHub contains the source code, but the application must be run locally unless the frontend, backend, and database are deployed online.
The application requires:
- MySQL
- Python 3
- Node.js
- npm
Open MySQL Workbench.
The database name is:
washwiseRun the SQL files in this order:
1. backend/schema.sql
2. backend/procedures.sql
3. backend/indexes_views.sql
All three SQL files are required. The automated tests depend on the stored procedures, triggers, indexes, and views created by these files.
Open a terminal in the project folder:
cd ~/Desktop/LaundryApp-main/backendCreate and activate the Python virtual environment:
python3 -m venv venv
source venv/bin/activateInstall the Python requirements:
pip install -r requirements.txtCreate the local environment file:
cp .env.example .envUpdate backend/.env with the local MySQL credentials.
Example:
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=washwise
Do not upload the .env file to GitHub.
Load the demonstration data:
python3 seed.pyRun the automated backend and database tests:
pytest test_api.py test_db.py -vA successful setup should report:
22 passed
After the tests pass, start the Flask backend:
python3 app.pyThe backend should run at:
http://127.0.0.1:5001
From the backend folder, run:
python3 seed.pyThis creates the demo users, machines, bookings, payments, and subscription information.
From the backend folder, run:
source venv/bin/activate
python3 app.pyThe backend should run at:
http://127.0.0.1:5001
Keep the backend terminal open.
Open another terminal:
cd ~/Desktop/LaundryApp/frontendInstall the frontend packages:
npm installStart the development server:
npm run devOpen the local address shown by Vite, such as:
http://localhost:5173
The port number may be different if another port is already being used.
- Tenant logs in
- Tenant views available washers and dryers
- Tenant selects a machine
- Tenant chooses a date and time
- The booking is created through the Flask backend
- The booking is stored in MySQL
- The machine becomes unavailable
- The tenant can view the booking
- The tenant can cancel the booking
- The machine becomes available again
- Manager logs in
- Manager opens the Manager Dashboard
- Manager views machine totals and machine status
- Manager views live transaction-fee revenue
- Manager views live subscription revenue
- Manager views the building subscription plan
Important backend routes include:
POST /login
GET /machines
POST /bookings
GET /users/<user_id>/bookings
DELETE /bookings/<booking_id>
GET /subscriptions
GET /reports/revenue
The project uses:
- Parameterized SQL queries
- Foreign keys
- Stored procedures
- Triggers
- Indexes
- Views
- Booking conflict prevention
- Role-based frontend behavior
- Revenue calculations
- Subscription tracking
The sp_book_machine stored procedure creates bookings.
Database triggers validate bookings and update machine status when bookings are created, cancelled, or completed.
The following application flow was tested successfully:
- Tenant login
- Manager login
- Role-based navigation
- Machine availability
- Machine reservation
- Booking creation
- Booking history
- Booking cancellation
- Machine availability after cancellation
- Manager machine dashboard
- Live revenue report
- Live subscription information
- Frontend-to-backend connection
- Backend-to-MySQL connection
The .env files are excluded from GitHub because they contain local database credentials.
Each person running the application must create their own local .env file.
The application currently runs locally.
GitHub stores the project source code and documentation, but GitHub does not automatically run:
- The MySQL database
- The Flask backend
- The SvelteKit frontend
For a classroom demonstration, start MySQL, the Flask backend, and the frontend locally.