Welcome to the Mix and Match research code repository. This repository contains the codebase for the Mix and Match platform, which explores the interplay between user behavior and recommendation algorithms in the context of online dating applications. Below, you'll find an overview of the repository structure and key components.
This branch has been heavily edited by the Unsupervised Learners Capstone Team (2024 Sem 2) (Team 36)
The repository is organized into the following key components:
-
API Code (Flask):
- The main Flask application handles user authentication, user profiles, matches, and recommendation algorithms.
- Includes user and match-related endpoints.
-
Frontend Code (Vite & React):
- The Mix and Match dating platform's user interface and client-side code.
- Built using Vite and React for a responsive and interactive user experience.
-
Dependency Configuration (package.json):
- Contains the project dependencies, including React libraries, Axios for API requests, and others.
Please ensure you have MySQL set up before you run these scripts
Read SQL.md before proceeding
You can setup either with the Setup Script or manually
Run the command below to use a script to create a virtual environment and install dependencies
& "C:\Program Files\Git\bin\bash.exe" ./setup.shsh ./setup.shIf the scripts do not work, do the following steps from the root folder to create a virtual environment and install dependencies:
# Backend setup
cd backend_mm
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
cd ..
# Frontend setup
cd frontend_mm
npm i
# Backend setup
cd backend_mm
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd ..
# Frontend setup
cd frontend_mm
npm iAfter completing the above setup (SQL.md, installing frontend and backend dependencies), ensure the following before continuing:
- Ensure MySQL is running (go to services and start it)
- Set up local SQL mixnmatch database and user access to that database (make user, password and database all called "mixnmatch"), as in
SQL.md - source the SQL dump file (
./backend_mm/mysql_database/dump.sql) into your local mixnmatch database to set it up
For chat to work, both sides need to match first and chat.py needs to be running
Once you have setup with either the scripts or manual setup above, either use the Run Script or manually run MixnMatch.
& "C:\Program Files\Git\bin\bash.exe" ./run.shsh ./run.sh- Start venv from
./backend_mm:- Windows:
.venv\Scripts\activate - Mac:
source .venv/bin/activate
- Windows:
- Run
python app.pyin./backend_mmin a new console - Run
python chat.pyin./backend_mmin a new console - Run
npm run start:frontendin./frontend_mmdirectory in a console - If there are persistent 401 errors, go to application tab in developer tools (under same tab as console), go to cookies, and delete all cookies, then try again. There appears to be a problem with duplicate cookies
The Mix and Match platform will be accessible at http://localhost:5173, and the API endpoints can be accessed locally at http://localhost:5000 and WebSocket at http://localhost:8765.
-
User Endpoints:
GET /users/<int:user_id>: Get user information by user ID.PUT /users/<int:user_id>: Update user information.POST /login: User login.GET /logout: User logout.POST /signup: User registration.POST /onboarding/<int:user_id>: Complete user onboarding.GET /chat: Get user's chat conversations.POST /chat-history: Get chat history.POST /reset-chat/<int:user_id>: Resets the users chat historyPOST /delete-user/<int:user_id>: Removes user from mixnmatch db
-
Match Endpoints:
POST /matches/<int:other_user_id>: Match with another user.GET /matches: Get recommended users for matchmaking.POST /reset-matches/<int:user_id>: Resets users match history in db