Hi! I'm Shahir Islam your helper for flask startup kit.
If you just want backend web response then just clone this repo and you are good to go.
This is the first JWT authintication auth based starter kit. You are welcome mate !
-
Flask : Flask obviously...duh
-
SQLAlchemy : SQLAlchemy for Database
SQL-lite
-
flask-marshmallow : For serializing API response
-
PyJwt : For encoding JWT user token
-
Werkzeug : For Password Hashing
sha256
- pycache : This is a default folder you don't need to look at it.
- instance : This folder is for Database
- venv : This folder is for Virtual Enviroment. You just need to activate it. You can delete it if you want.
- requirements : This is a text file and this contains every package you need to install in one place.
- app : This is a python file and this contains our main code.
--> Use this repo for only backend perpous.
--> There is no front-end.
--> This is a starter kit with JWT based auth system.
--> I used sql-lite
as database.
Note : You can use db as your wish.
Make sure you have installed python.
Step 1. Clone this repo into your local mechine.
Step 2. Open downloaded/cloned folder using any code editor.
Step 3. Activate virtual enviroment. Open terminal and type ./venv/Scripts/Activate.ps1
Note : If you have deleted venv folder then you can skip
Step 4. Install all libraries. Open terminal and type > pip install -r requirements.txt
Step 5. RUN ! Open terminal and type > python app.py
Extra : If you want to add more tables or columns to the db then type in the terminal
> flask shell
> db.create_all()
Here we use db
for line 16 where we inisialize db as database variable.
- You need any web response reader software. (Postman, Insomnia, API Tester) I'm using Postman
- After running
> python app.py
you should see an IP:portexm: 127.0.0.1:5000
on your terminal where the app is running. Copy that IP:port and send aGET
request. If the response is success then you are good to go. - On
/sign-up , /login
I've used to input data in forms.
Token Key is : x-access-token
You will get a token when you login.
Note : Token will expayre after 1 hour you can change this on code line 102.
Thanks for visiting my repo. If you are having any problem working with this please tweet me @lifeofdekisugi.
Fell free to contribute. Don't forget to spread the love 🖤