This repository contains the source code for the HokieFinder app, designed to help users find compatible roommates using a machine learning-based matching algorithm.
Follow these instructions to set up the project on your local machine.
- Node.js, ios simulator and npm installed.
- One must also add the serviceAccountKey.json file from their Firebase account by generating a new private key inside the WebFlaskService folder.
-
Install dependencies:
yarn
-
Import expo-cli
yarn global add expo-cli
-
To install debugger (not required for setup)
npm install -g react-devtools
-
To start the app
npx expo start
-
To run in ios mode
i
-
Run the backend code
cd WebFlaskService python main.py
Unit tests were implemented using the pytest
library in Python to ensure the functionality and correctness of the APIs. Below are instructions to run the tests for both the Flask Model API and the Flask Firebase API.
-
Navigate to the backend directory:
cd WebFlaskService
-
Run the test cases for the Model API:
pytest -v test_model_flask_api.py
-
Output Example:
====================================================================== test session starts ======================================================================= platform darwin -- Python 3.11.5, pytest-8.3.4, pluggy-1.5.0 -- /Users/taeeshassadi/Desktop/Projects/Software Engineering/RoommateFinderApp/WebFlaskService/venv/bin/python cachedir: .pytest_cache rootdir: /Users/taeeshassadi/Desktop/Projects/Software Engineering/RoommateFinderApp/WebFlaskService plugins: mock-3.14.0, anyio-4.6.2.post1 collected 3 items test_model_flask_api.py::test_find_roommates_success PASSED [ 33%] test_model_flask_api.py::test_find_roommates_missing_field PASSED [ 66%] test_model_flask_api.py::test_find_roommates_internal_error PASSED [100%] ======================================================================== 3 passed, 2 warnings in 1.00s ========================================================================
-
Test Details:
- The Model API tests verify the retrieval of recommended Roommates when passed with different parameters.
- All tests pass successfully, ensuring API stability.
-
Navigate to the backend directory:
cd WebFlaskService
-
Run the test cases for the Firebase API:
pytest -v test_firebase_flask_api.py
-
Output Example:
====================================================================== test session starts ======================================================================= platform darwin -- Python 3.11.5, pytest-8.3.4, pluggy-1.5.0 -- /Users/taeeshassadi/Desktop/Projects/Software Engineering/RoommateFinderApp/WebFlaskService/venv/bin/python cachedir: .pytest_cache rootdir: /Users/taeeshassadi/Desktop/Projects/Software Engineering/RoommateFinderApp/WebFlaskService plugins: mock-3.14.0, anyio-4.6.2.post1 collected 4 items test_firebase_flask_api.py::test_add_user_success PASSED [ 25%] test_firebase_flask_api.py::test_get_user_success PASSED [ 50%] test_firebase_flask_api.py::test_get_user_not_found PASSED [ 75%] test_firebase_flask_api.py::test_add_user_internal_error PASSED [100%] ======================================================================== 4 passed in 0.31s ========================================================================
-
Test Details:
- The Firebase API tests verify the addition and retrieval of users in the Firestore database.
- All tests pass successfully, ensuring API stability.
This section outlines the acceptance tests designed to validate that the HokieFinder application meets the user stories and functionality. The provided use cases include execution steps and expected outputs. These instructions can be followed to verify the correctness and completeness of the application functionality.
As a user, I want the profile form to validate inputs so I can avoid submitting incorrect data. This will save me time and ensure that only accurate and complete information is stored in my profile.
- Navigate to the "Create Profile" page in the app.
- Enter invalid data into the following fields:
- Email: Enter an incorrect format (e.g.,
invalidemail
). - Phone Number: Enter letters or an incomplete number (e.g.,
abcd123
). - Age or Budget: Enter a non-numeric value (e.g.,
twenty
).
- Email: Enter an incorrect format (e.g.,
- Attempt to submit the form.
- For invalid email input, an error message should display: "Enter a valid email."
- For incorrect phone number input, an error message should display: "Enter a valid phone number."
- For invalid numeric fields like Age or Budget, an error message should display: "Enter a valid age (18-99)." or "Enter a valid Budget" respectively.
As a user, I want an engaging swiping page with fluid animations so I can quickly browse and evaluate potential roommates.
- Navigate to the "Recommendation" page in the app (The one with VT logo).
- Swipe left or right on a profile card to reject or accept a match.
- Observe the transition animation as the card moves out of view.
- Repeat the swiping action for multiple profiles.
- The swiping animation should be smooth and responsive, without lag or glitches.
- Swiping left should dismiss the profile as "not interested."
- Swiping right should mark the profile as a potential match and populated in messaging page.
- Users should experience a seamless browsing experience with no functional errors.
As a user, I want to edit my profile easily once I run out of swipes. This will allow me to update my preference and ensure accurate matching with potential roommates based on new features.
- Click the "Edit Profile" button shown when you run out of swipes.
- Modify the following fields under "Roommate Preference" section:
- Change the Age value.
- Update the Dietary Preference to a new option.
- Update the Smoker or Drinker option.
- Update the Ethinicity option.
- Click the "Continue" button to save the changes.
- Redirects you to the recommendation page (the one with VT Logo).
- Clicking the "Continue" button should save the updated profile information.
- The modified fields should reflect the updated roommates on the "Recommendation" page.
- The backend database should also reflect the updated information when queried.