This is a project where I'm making an API for a retro video game themed database using FastAPI with PyMySQL. The goal is to test and showcase the Python and MySQL knowledge that I have gained.
- To run this project on your locally, first clone the repo and enter the folder in your terminal. Now setup a VENV with the command:
python -m venv venv
- After that has been created activate the virtual environment by typing in your terminal:
venv\Scripts\activate
- Now to install the project dependencies type:
pip install -r requirements.txt
- Now create a file called ".env" at the root of the project and inside the file add:
MYSQL_HOST="(your MySQL hostname)"
MYSQL_USER="(your MySQL username)"
MYSQL_PASSWORD="(your MySQL password)"
MYSQL_DATABASE="(the MySQL database that you want to use)"
JWT_SECRET_KEY="(generate with command: openssl rand -hex 32)"
JWT_REFRESH_SECRET_KEY="(generate with command: openssl rand -hex 32)"
CORS_ORIGIN="(the frontend host)"
- When everything has been done, we can start the server with:
uvicorn app.main:app
or this command for automatic reloading
uvicorn app.main:app --reload
- JWT authentication system with locked routes
- JWT access token updating via a JWT refresh token function
- MySQL integration with PyMySQL
- CRUD operations for admin level users
- Routes for handling users data
- Routes for handling platform data
- Routes for handling genre data
- Routes for handling developer data
- Routes for handling publisher data
- Routes for handling game data
- Routes for handling favourites data
- Routes for generating new access tokens
- Routes for rating games system
- Python
- FastAPI
- PyMySQL