This project is a React Native application designed to help users find and rate public bathrooms. It includes a map interface, a form for submitting ratings, and a review section.
To create a sample database, please ensure that MySQL is installed before continuining with the following steps. Installing can be found at the installation page.
-
index.tsx
:- The entry point of the application.
- Manages navigation between the Map screen and the Form screen.
- Handles location permissions and fetching the user's current location.
-
MapScreen.tsx
:- Displays the map with markers for nearby bathrooms.
- Fetches bathroom coordinates from the backend.
- Contains a button to navigate to the rating form.
-
Form.tsx
:- Allows users to submit ratings for cleanliness, gender, and wait times.
- Starts and stops a timer to track wait times.
- Sends rating data to the backend.
test.php
:- Backend script that handles requests for bathroom coordinates and ratings.
- Connects to the SQL database to store and retrieve data.
-
CreateScoreTrigger.sql
:- Creates a SQL trigger called UpdateScoreAfterInsert.
- Updates the score of a washroom in the Washrooms table whenever a new rating is inserted into the Forms table.
-
CreateScoreView.sql
:- Creates a view (virtual table) called WashroomScores.
- Calculates overall scores for washrooms based on wait time, gender equality, and cleanliness.
- Make a new database by following the instructions provided below:
$ mysql -u root -p (or sudo mysql -u root)
mysql> CREATE DATABASE pissd;
mysql> USE pissd;
- Create Tables and populate with
- sample data
mysql> source sql-files/MakeEverything.sql
mysql> source sql-files/SamplePopulateData.sql
- production data
mysql> source sql-files/MakeEverything.sql
mysql> source sql-files/ProductionPopulateData.sql
- Install yarn
- Run
yarn install
- additional dependencies may need to be added
- Run
yarn start
- note it will not work when connected to the school wifi
- Scan the QR code with the
Expo Go
app on your phone