YE
yezz123/FRDP
Boilerplate code for quick docker implementation of REST API with JWT Authentication using FastAPI, PostgreSQL and PgAdmin โญ
FRDP
Boilerplate code for quick docker implementation of REST API with JWT Authentication using FastAPI, PostgreSQL and PgAdmin.
Project setup
# clone the repo
$ git clone https://github.com/yezz123/FRDP
# move to the project folder
$ cd FRDPGetting Started
Features
| Auth | Description |
|---|---|
Login Access Token |
OAuth2 compatible token login, get an access token for future requests |
Check Session |
Test if a user is logged in by checking if a valid access token is in the header |
Recover Password |
Password Recovery |
Reset Password |
Reset your password |
| User | Description |
|---|---|
Create New User |
Create a new user |
Get Current User By Id |
Get current user |
Update Current User |
Update own user |
Update Other User (SuperUser) |
Update a user |
Create User (Without Authentication) |
Create new user without the need to be logged in. |
Environment variables
-
Using PostgreSQL as database server.
-
Using PgAdmin as database client.
-
Dockerized the Boilerplate code.
-
Drop your own Configuration at the
docker-compose.envfile.
# Backend API Configuration
PROJECT_NAME=
DOMAIN=
# Security Configuration
SECRET_KEY=
USERS_OPEN_REGISTRATION=
EMAIL_RESET_TOKEN_EXPIRE_HOURS=
# Server Settings
SERVER_NAME=
SERVER_HOST=
# Postgres default username and password
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
POSTGRES_PORT=
POSTGRES_SERVER=
# PGADMIN_LISTEN_PORT=
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
Development ๐ง
Features
- use
hatchto manage dependencies. - use
pytestto run tests. - GitHub Actions to run tests, lints.
- Use
Dependabotto keep dependencies up to date. - use
pre-committo manage formatting and linting.- use
blackto format code. - use
ruffto lint code. - use
isortto sort imports.
- use
Setup environment ๐ฆ
You should create a virtual environment and activate it:
python -m venv venv/source venv/bin/activateAnd then install the development dependencies:
# Install dependencies
pip install -e .[test,lint]Run tests ๐
You can run all the tests with:
bash scripts/test.shFormat the code ๐
Execute the following command to apply pre-commit formatting:
bash scripts/format.shLicense
This project is licensed under the terms of the MIT license.