A Flask-based RESTful API that leverages flask-jwt-extended to handle backlog activites for multiple users
Requirements:
- Python3
- pipenv (unless you want to install the minimal dependencies manually or using pip)
https://github.com/pypa/pipenv
- Redis
https://redis.io/topics/quickstart
Installation
- Inside repo, run
pipenv shell
to initialize a pipenv environment - Run
pipenv install
to install dependencies inside Pipfile python run.py
and it should be running at defaultlocalhost:5000
Database Initialization
- Enter the python shell with
python
- Import the database from the app with
from app import db
- Run the database create function:
db.create_all()
Starting Redis
- After installation, run
redis-server
and it should now start as a system service - Start the default redis queue on a separate terminal from the main application by running
rq worker
It should display*** Listening on default...
- Try hitting the
/register
endpoint and observe the redis terminal.
/register
POST
Creates new User
{
"username"
"password"
"email"
}
/login
POST
Authenticates user and returns JWT
{
"username"
"password"
}
/user/<id>
GET
Returns a user based on id
/user/activity/new
POST
Creates new user activity
{
"activity_type"
"name"
"desc"
}
/user/activity
GET
Returns all activites of a user
/activity/episode/<id>
POST
Extends an Activity with the Episode class
{
"episode_total"
"episode_progress"
}
/user/activity/edit/<id>
PUT
Edits both an activty and/or episodes. This allows the user to mark the activity as complete or update episode progress
{
"activity_type"
"name"
"desc"
"episode_total"
"episode_progress"
}