GithubHelp home page GithubHelp logo

flask-authentication-jwt-demo's Introduction

Flask Authentication

Here's a demo of JWT authentication implemented by Flask with usage of a relational database, offers RESTful endpoints for registration, authentication and modification of user.

Launch

  1. Prerequiste: docker and docker-compose already installed
  2. Run docker-compose build --no-cache to build image
  3. Run docker-compose up to run in container. Use -d argument to run it in background

Development

  1. Prerequiste: pipenv already installed, or convert the Pipfile into requirements.txt for using virtualenv if you wish
  2. Run pipenv install
  3. Get in the virtual environment: pipenv shell

CLI

Use flask to view all CLI commands in virtual environment

Routes and documentation

Here are the endpoints implemented in application:

Endpoint           Methods   Rule
-----------------  --------  --------------------------
api.auth_login     POST      /api/v1/auth/login
api.auth_register  POST      /api/v1/auth/register
api.auth_user      GET, PUT  /api/v1/auth/user
api.doc            GET       /api/v1/ui
api.root           GET       /api/v1/
api.specs          GET       /api/v1/swagger.json
restx_doc.static   GET       /swaggerui/<path:filename>
static             GET       /static/<path:filename> 

By using flask-restx, a swagger documentation is generated when application is launched.

Run the application by docker-compose up or flask run in virtual environment, then view the documentation at http://0.0.0.0:8000/api/v1/ui.

flask-authentication-jwt-demo's People

Contributors

valeeraz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.