UW Toot: Where students and tooters connect. Toot helps students students find tutors for the courses they are struggling on.
Our application provides a full set of features to support students and tutors.
- Proximity Search: Students can filter postings by location using an interactive map, with tutors shown as pins within the visible region.
- Full-Text Search: Search postings by tutor name, course, or description with partial matches and fast paginated results.
- Live Chat: Messages appear instantly using PostgreSQL’s LISTEN/NOTIFY and WebSockets, so users don’t need to refresh for updates.
- Group Chats: Chats can include up to 10 users. SQL triggers enforce group size limits and prevent chats without participants.
- Calendar Scheduling: Tutors set custom availability, merged and updated when bookings are made. Students book only within open slots.
- Authentication: Secure login and signup with password hashing.
- User Profiles: Update email, username, password, avatar, and register as a tutor (“tooter”), with support for adding or removing courses.
- Postings: Tooters create postings describing their services, rates, and location, with integration into search and map-based filtering.
- Chat System: One-on-one chat between students and tutors with text messages and file attachments.
- Bookings & Scheduling: Students can book sessions based on tutor availability, while tutors track upcoming sessions in their calendar.
- Reviews: Students leave ratings and comments for tutors, which appear on tutor profiles and postings, and can be edited in their profile.
The app is set up using Docker Compose currently.
- The data is stored in a PostgreSQL container.
- There is a Python with Flask backend to connect the frontend with SQL.
- The frontend uses TypeScript and React.
With the database running in Docker, run the following to generate the
test-sample-actual.out output:
cat ./toot_backend/queries/drop-table.sql | docker exec -i toot-db-1 psql -U toot -d toot
cat ./toot_backend/queries/init_scripts/create-table.sql | docker exec -i toot-db-1 psql -U toot -d toot
cat ./toot_backend/queries/test-data.sql | docker exec -i toot-db-1 psql -U toot -d toot
cat ./toot_backend/queries/test-sample.sql | docker exec -i toot-db-1 psql -U toot -d toot > test-sample-actual.outTo initialize the database, the 2nd and 3rd lines can be run. Alternatively, you can use adminer to manage the database and import sql files.
drop-table.sql cleans the database. Useful for resetting to a clean state.
create-table.sql creates empty tables for all relations defined by our schema.
test-data.sql populates the database with some sample data.
test-sample.sql runs sample queries to verify our schema and feature queries and produces output in the test-sample-actual.out.
Verify test-sample-actual.out with our provided test-sample.out.
With the database running in the Docker container, run the following in the root directory to populate the database:
python3 ./toot_backend/populate_db.py -d(WARNING: The -d flag will delete all data from the database, remove it if you do not want to remove existing data from the database.)
By running this script, it will give you several prompts, in which you can input the following values:
Enter the number of users you would like to generate. 500
Enter the number of tooters you would like to have. This number must be less than the number of users. 200
Enter the number of bookings. 1000
Enter the number of postings. 2000
Enter the number of reviews. 1200
Enter the number of chat entries. 5000
Enter the number of messages. 10000
Then, run the following in the root directory to generate the test-production-actual.out output:
cat ./toot_backend/queries/test-production.sql | docker exec -i toot-db-1 psql -U toot -d toot > test-production-actual.outNow, verify the test-production-actual.out with test-production.out outputs.
Note that the output (i.e., via EXPLAIN ANALYZE queries) is non-deterministic.
docker compose up --remove-orphans --buildYou'll need Docker and Docker Compose set up to run this.
- The frontend is hosted at
localhost:5002. - Adminer is available at
localhost:8080.