Skip to content

Cookiecutter for FastAPI starter application with ORM, authentication, granular access control, etc.

License

Notifications You must be signed in to change notification settings

pratik-shivarkar/fastapi-cookiecutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI CookieCutter

Features

  • JWT
  • OTP Login & Password Reset
  • Emailing
  • SQLAlchemy
  • RBAC
  • Login History
  • CORS
  • Modularity
  • Admin API (WIP)

License

MIT licensed.

Using Cookie-Cutter

pip3 install cookiecutter
cookiecutter https://github.com/pratik-shivarkar/fastapi-cookiecutter.git

Project name should not use special characters except _ (underscore)

cd {project_name}
pip install .

Once installed the project_name command will be available

Required environment variables

  • PYTHONUNBUFFERED set to 1 when using Docker
  • AUTH_MODE set value to native or api-gateway
  • AUTH_HEADER set value to authenticated user header when using api-gateway based authentication
  • MASTER_DB_URI URI for postgres master database and master user (will be used for creating project role and database)
  • DB_URI URI for project database, role, and password
  • DB_PASSWORD password for project database
  • SECRET_KEY secret key for JWT
  • REFRESH_KEY secret key for JWT refresh tokens
  • SMTP_SERVER SMTP server host
  • SMTP_PORT SMTP server port
  • SMTP_USERNAME SMTP server username
  • SMTP_PASSWORD SMTP server password
  • SENDER_EMAIL SMTP sender email
  • ORIGINS Comma separated origins to allow (eg. https://example.com,http://localhost:8080)

Command Reference

Usage: project_name [OPTIONS] COMMAND [ARGS]...

Options:
  --production / --no-production
  --help                          Show this message and exit.

Commands:
  clean
  init
  run
  test

Create database and schema

project_name init

Clean database and schema

project_name clean

Run application

project_name run

Run tests

project_name test

About

Cookiecutter for FastAPI starter application with ORM, authentication, granular access control, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published