A Copier template for generating REST APIs across multiple cloud platforms and languages.
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-timeEach 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-apiFollow 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| ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ |
Note
Each project follows the controller-service-repository pattern.
Python
Typescript
Dotnet
Go
Below are the SDKs and frameworks used in the various templates.
- Nuget for dependency management
- xUnit for testing
- FluentValidation for schema validation
- Go Modules for dependency management
- testing and testify for testing
- jsonschema for schema validation
- Azure SDK for Go (azcosmos) for Cosmos DB
- Azure Function Apps for hosting the APIs
- Cosmos DB for data storage
- Lambda docs for hosting the APIs
- DynamoDB for data storage
- Cloud Functions for hosting the APIs
- Firestore for data storage
Florian Maas' cookiecutter-poetry repository was a helpful resource for building out this template.
