Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.04 KB

README.md

File metadata and controls

79 lines (56 loc) · 2.04 KB

RetroGame-DB - FastAPI - Python API

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.


Install:

  1. 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
  1. After that has been created activate the virtual environment by typing in your terminal:
venv\Scripts\activate
  1. Now to install the project dependencies type:
pip install -r requirements.txt
  1. 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)"
  1. 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

Features

  • 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

Tools and technologies used:
  • Python
  • FastAPI
  • PyMySQL