This is a chatbot integrated with OpenAI and Vanna AI, connected through a Chrome extension that provides users with real-time assistance based on the UoM Student Handbook.
Chrome Extension Version
Website Version (Not maintaining)
OpenAI: Obtain an API key from the OpenAI website. This key is required for integrating OpenAI services.
Vanna AI Keys: Obtain an API key from Vanna AI. This key is required for interacting with Vanna AI services.
PostgreSQL Database: Set up your own PostgreSQL database to store the necessary data. You can use cloud providers like AWS RDS, Google Cloud SQL, or any other preferred method to host your PostgreSQL database.
git clone https://github.com/may-bee/it-project2024-sm-2.git
Install Python
Ensure Python 3.x is installed on your system. You can verify by running:
python3 --version
Create a Virtual Environment
Set up a virtual environment to isolate the dependencies:
python3 -m venv venv
Activate the Virtual Environment
For Windows:
venv\Scripts\activate
For Linux or macOS:
source venv/bin/activate
Install Dependencies
Install the necessary dependencies from requirements.txt
:
pip install -r requirements.txt
Install Node.js and NPM
Ensure that Node.js and npm are installed on your machine, as Vercel requires npm. You can check the versions with:
node -v
npm -v
Install Vercel CLI
To install the Vercel command-line tool globally, run:
npm install -g vercel
Vercel automatically detects and builds your project when deploying. However, to ensure everything goes smoothly, set up the necessary build
command.
Create a Start Script
Add a start command to app.py
if not already present:
if __name__ == '__main__':
from os import environ
app.run(debug=False, port=int(environ.get('PORT', 5000)), host='0.0.0.0')
Ensure Dependencies
Make sure all necessary Python dependencies are included in requirements.txt
.
Log in to Vercel
Use the Vercel CLI to log in:
vercel login
Initialize Deployment
Navigate to your project directory and initialize Vercel deployment:
vercel
.env.sample
as a reference for necessary environment variables. You can add these to Vercel's configuration:
vercel env add VARIABLE_NAME VARIABLE_VALUE
You can also use the Vercel Dashboard to manage environment variables.
Test the Deployment
After the initial deployment, Vercel provides a unique staging URL where you can test your API to ensure it works as expected.
Promote to Production
If everything looks good on the staging URL, you can promote the app to production using:
vercel --prod
Vercel will handle the build and deployment processes and provide you with an updated production link.