Getting Started
The Roommate Matcher consists of three modules: API Server (Backend), Student Frontend, and Admin Frontend.
Deploy API Server (Backend)
The API server is built with the Flask framework, a lightweight Python web framework. The repository is located at https://github.com/Xavier-xuan/RMMT-API. We offer two different installation methods, and you can choose the one that best suits your needs.
Prerequisites
- Python version 3.10 or higher
- PyTorch version 2.3.0 or higher
- MySQL server version 5.7 or higher
Manual Deployment
Clone the repository:
bashgit clone https://github.com/Xavier-xuan/RMMT-API.git
Install the required packages:
bashpip install -r requirements.txt
Update the configuration:
bashcp config.py.example config.py
Edit
config.py
and update it with your own settings.DANGER
Make sure to regenerate a random string as your
JWT_SECRET_KEY
; otherwise, the system will be extremely insecure.Initialize the database:
bashpython models.py
Run the web server using Gunicorn:
bashgunicorn app:app -c ./gunicorn.config.py
Start the matching service:
bashpython tasks.py
The website will be accessible on port 5000.
Docker Deployment
Ensure that both Docker and Docker Compose are installed.
Clone the repository:
bashgit clone https://github.com/Xavier-xuan/RMMT-API.git
Install the required packages:
bashpip install -r requirements.txt
Update the configuration:
bashcp config.py.example config.py
Edit
config.py
and update it with your own settings.DANGER
Make sure to regenerate a random string as your
JWT_SECRET_KEY
; otherwise, the system will be extremely insecure.Start the Docker service:
bashdocker-compose up -d
The website will be accessible on port 5000.
Deploy Student Frontend and Admin Frontend
Both the Student Frontend and Admin Frontend are single-page applications (SPAs) built with Nuxt.js. These frontends are purely static sites. The repositories are located at https://github.com/Xavier-xuan/RMMT-Student.git and https://github.com/Xavier-xuan/RMMT-Admin.git, respectively.
Prerequisites
- Yarn
- Node.js version 18 or higher
Manual Deployment
Clone the repository:
For Student Frontend:
bashgit clone https://github.com/Xavier-xuan/RMMT-Student.git
For Admin Frontend:
bashgit clone https://github.com/Xavier-xuan/RMMT-Admin.git
Update the config:
Edit
nuxt.config.js
, update the line 86axios.baseURL
with your backend URL.Generate Static Files:
bashyarn generate
The generated static files locate at the dist
directory; simply upload the files to your web server.