a-braham / fastapi-services-oauth2

Structuring FastAPI applcation using 3-tier design pattern

Home Page:https://medium.com/gitconnected/structuring-fastapi-project-using-3-tier-design-pattern-4d2e88a55757

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fastapi-services-oauth2

This repository provides an approach on how to effectively structure a FastAPI application with multiple services using 3-tier design pattern, integrate it with Postgres backend, and implement straightforward OAuth2 Password authentication flow using Bearer and JSON Web Tokens (JWT).

Read the tutorial for more details.

How to install

Clone this repository and install using pip.

$ pip install --editable .

How to run

Configure the relevant DSN string to your Postgres backend database in .env file, or provide it from the environment variable MYAPI_DATABASE__DSN.

To run the application use following.

$ uvicorn app.main:app

or

$ MYAPI_DATABASE__DSN=postgresql://... uvicorn app.main:app

License

MIT License (see LICENSE).

About

Structuring FastAPI applcation using 3-tier design pattern

https://medium.com/gitconnected/structuring-fastapi-project-using-3-tier-design-pattern-4d2e88a55757

License:MIT License


Languages

Language:Python 100.0%