API Server Flask
Open-source API Server crafted in Flask using JWT Authentication and SQLite.
Simple Flask API Boilerplate enhanced with JWT authentication, SqlAlchemy, SQLite persistence and deployment scripts via Docker. It has all the ready-to-use bare minimum essentials.
Feb 11, 2023
- API Definition - the unified API structure implemented by this server
- Flask API Server - source code
- Full-stack samples compatible with this product:
- React Berry Dashboard - open-source sample
- React Datta Dashboard - open-source sample
API Interface - for full description please access API Unified Definition
- USERS API:
/api/users/register
: create a new user/api/users/login
: authenticate an existing user/api/users/logout
: delete the associated JWT token/api/users/checkSession
: check an existing JWT Token for validity/api/users/edit
- edit the information associated with a registered user
Requirements​
Python3
(Python2 is not supported)Flask
==2.1.2flask-restx
==0.5.1Flask-JWT-Extended
==4.4.1pytest
Getting Started​
👉 Step 1 - clone the project using GIT
$ git clone https://github.com/app-generator/api-server-flask.git
$ cd api-server-flask
👉 Step 2 - Install dependencies (using a virtual environment)
$ python3 -m venv /path/to/your/virtual/environment
$ source <path/to/venv>/bin/activate
Install dependencies in once the virtualenv
is activated
$ pip install -r requirements.txt
👉 Step 3 - Prepare the environment
$ export FLASK_APP=run.py
$ export FLASK_ENV=development
Or for Windows-based systems
$ (Windows CMD) set FLASK_APP=run.py
$ (Windows CMD) set FLASK_ENV=development
$
$ (Powershell) $env:FLASK_APP = ".\run.py"
$ (Powershell) $env:FLASK_ENV = "development"
👉 Step 4 - Initialize the database, check
run.py
for shell context
$ flask shell
>>> from api import db
>>> db.create_all()
👉 Step 5 - Start the API server
$ python run.py
// OR
$ flask run
Visit http://localhost:5000
in your browser. The API server will be running.
Project Structure​
The codebase has a simple, intuitive structure where run.py
is responsible to bundle and start the API Server using the setup coded by the api
folder:
api-server-flask/
├── api
│ ├── config.py
│ ├── __init__.py
│ ├── models.py
│ └── routes.py
├── Dockerfile
├── README.mdx
├── requirements.txt
├── run.py
└── tests.py
Compatible Fullstack Products​
React Purity Dashboard​
Start your Development with an Innovative Admin Template for Chakra UI and React.
- ✅ Innovative Chakra Design -
Designed
by Creative-Tim - ✅ React, Redux, Redux-persist
- ✅ Authentication: JWT Login/Register/Logout
Django React Berry​
Full-Stack
Seed project generated by React App Generator top of Berry Dashboard design.
- 👉 Django React Berry - product page
- 👉 Django React Berry - LIVE Demo
React Soft Dashboard​
React Soft Dashboard
is built with over 70 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining.
The product comes with a simple JWT authentication flow: login/register/logout.
The React Design is crafted by Creative-Tim on top of MUI
Library.
✅ Resources​
- 👉 Access AppSeed and start your next project
- 👉 Deploy Projects on Aws, Azure and Digital Ocean via DeployPRO
- 👉 Create an amazing landing page with Simpllo, an open-source site builder
- 👉 Django App Generator - A 2nd generation App Builder