This repo contains source code for my REST-API to be used by my bot GamerBotBot. The API is deployed on Heroku and is currently being used. It uses a user system to authenticate users to access endpoints. Also connects to a PostgreSQL database for various storage.
- Used as the web framework for the api
- This is used for the user authentication of the api
- Creates user tokens to access endpoints
- Flask wrapper for the SQLAlchemy package
- Allows management of database in classes and objects
- Models held in models folder
- An extenstion to flask that helps create REST APIs
- Used for encryption of users passwords
- Used for serving the python application to Heroku
- PostgreSQL adapter for Python
- /register
- Registers a user into the API
- Puts user in database
- Required info:
{"username": "<username>", "password": "<password>"}
- /login
- Logs user into the API (provides a valid user with a JWT token)
- Required info:
{"username": "<username>", "password": "<password>"}
- /refresh
- Provides a new (but not fresh) token to a valid user
- Used once a token expires
- /meme
- Returns a random meme to the user
- /backlog/<string: user_id>
- Adds (POST), updates (PUT), retrieve (GET) backlog items. A backlog item is currently limited to only games.
- Required info:
{"game": "<game>", "status": "<status: unplayed, playing, finished>"}
- /backloglist/<string: user_id>
- Returns the list of the users backlog