Skip to content

[Flask] - API for a to-do list + auth endpoints (JWT)

Notifications You must be signed in to change notification settings

Gr0ki/flask-todo-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here is an API for To do project.

API

📚 Documentation 📚

Dependencies [pipenv]

The Pipifile and Pipfile.lock files contains info about project dependencies. To install all dependencies form a Pipifile the pipenv package required.

Install the pipenv package:

pip install pipenv

Once pipenv is installed, the following command will create virtual enviroment and install all project dependencies:

pipenv install

Dependencies [pip]

To install all dependencies form a requirements.txt file enter the following command:

pip install -r requirements.txt

Enviroment Variables and starting the server

.flaskenv file contains enviroment variables for flask, such as:

  • FLASK_ENV=development to run server in development mode
  • FLASK_APP=manage to run server from a specific file

So by exporting the last one it becomes possible to run server simply with a command:

flask run

Instead of specifying the file name in a command.

But don't forget to create the database:

flask db_create

There are also .env file in use, whitch wasn't pushed to the repo. This file contains the next varibles:

  • SECRET_KEY= - contains secret key for Flask
  • JWT_SECRET_KEY= - contains secret key for Flask-JWT-Extended

Code

The ~src folder contains source code for the Flask REST API:

  • auth and tasks folders contain models for database and serializers schemas for endpoints.
  • api folder contains versions of API.