Skip to content

Code-and-Sorts/cookiecutter-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookiecutter API

A Copier template for generating REST APIs across multiple cloud platforms and languages.

Usage

Install Copier (and the Jinja extensions the templates use) with pip or pipx:

# pipx is strongly recommended.
pipx install copier
pipx inject copier jinja2-strcase jinja2-time

# If pipx is not an option, install into your Python user directory.
python -m pip install --user copier jinja2-strcase jinja2-time

Each language lives in its own template directory (python, typescript, dotnet, go). Copier reads the configuration from the directory you point it at, so clone the repository and generate from the language you want:

git clone https://github.com/Code-and-Sorts/cookiecutter-api.git
copier copy ./cookiecutter-api/{LANGUAGE_OPTION} ./my-api

Follow the prompts to configure your project. The generated project includes a .copier-answers.yml file, so you can pull in future template changes with:

cd my-api
copier update

Supported Templates

Azure AWS GCP
Function App Lambda Cloud Function

Note

Each project follows the controller-service-repository pattern.

Examples

Python

Typescript

Dotnet

Go

Resources

Below are the SDKs and frameworks used in the various templates.

Python

Typescript NodeJS

  • Yarn for dependency management
  • Jest for testing
  • Zod for schema validation

Dotnet

Go

Azure

AWS

Google Cloud

Acknowledgements

Florian Maas' cookiecutter-poetry repository was a helpful resource for building out this template.

About

Cookiecutter API templates for Azure Function Apps, AWS Lambdas, and Google Cloud Functions.

Topics

Resources

License

Contributing

Stars

4 stars

Watchers

1 watching

Forks

Contributors