codeandrew / fastapi-poc

Proof Of Concept for Fast API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fastapi-poc

Overview

fastapi-0

API Endpoints / Features

  • USERS
    • create
    • get all
    • get {user_id}
  • ITEMS
    • get
    • create
  • FILES
    • upload Files

API DOCUMENTATION

URL: {$HOST}/docs fastapi-1-docs

Setup

python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt 

# to run the application 
uvicorn main:app --reload

troubleshooting

to access requestion json use async and await

@app.post("/")
async def read_root(request: Request):
    header = request.headers
    client = request.client.host
    body =  await request.json()

References

Accessing Request Headers: https://stackoverflow.com/questions/68231936/how-can-i-get-headers-or-a-specific-header-from-my-backend-api

access whole body request

Database Schema vs Pydantic Models

https://christophergs.com/tutorials/ultimate-fastapi-tutorial-pt-7-sqlalchemy-database-setup/

Authentication and SSO

Very Detailed

Very Bsic

Security

Securing salt has password https://stackoverflow.com/questions/9594125/salt-and-hash-a-password-in-python

Deployment

https://christophergs.com/tutorials/ultimate-fastapi-tutorial-pt-13-docker-deploy/

About

Proof Of Concept for Fast API


Languages

Language:Python 89.7%Language:Shell 7.9%Language:Dockerfile 2.4%