Skip to content

hourlier96/fastapi-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Template Generator

This repository provides a duplicable FastAPI code base:

See ReadMe


The template is

Usage

(Recommended) Use Stack generator module to generate a new code base from this template.


OR


Clone this repository and install dependencies

cd fastapi-generator
python3 -m pip install -r requirements.txt

(Optional): Add a github access token to .env file if you want the branch protection to be automated at generation

# .env content ...
GITHUB_ACCESS_TOKEN="<PERSONAL_ACCESS_TOKEN>"

Generate the code base

cookiecutter fastapi-generator/app   # Will ask your needs from cookiecutter.json

Options

  • 'repository_name' allows you to specify an empty-existing Git repository to push the template on.

    <github_username>/<repo_name>  # Required format
    
    # 1. Ensure you have corrects SSH rights & access
    
    # 2. This will also set branch protection if you specified GITHUB_ACCESS_TOKEN variable in .env
    # Change settings as your convenience in hooks_modules/branch_protection.json
  • 'project_name' is the name on the top of ReadMe.

  • 'project_slug' is the name of the generated folder

  • 'description' will be added under the project name in the ReadMe.

  • 'maintainer' has an informativ goal (not used in the template)

  • 'database' make you choose which type of database will be provided (Firestore, PostgreSQL with SQLModel, or Both)

  • 'as_container' provide local dockerization and auto deploy on Cloud Run

  • 'gcloud_project' is the GCP project ID on which the project will be deployed

CICD

Github action is provided for testing the template generation, install dependencies, runs dev server & unit tests.

You can try github actions locally from root folder using act:

act -j test-run-template --rm -W .github/workflows/template-generation.yaml

TODO

Deployment:

  • Add a specific database user and not postgres

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published