# cookiecutter-fastapi
Template for new fastapi microservice

## Setup
We use Poetry to manage dependencies. Go to https://python-poetry.org/docs/#installing-with-the-official-installer to follow the steps to install Poetry with the official installer.

### Possibly:
Ensure you have python3.12 installed.
```sh
$ brew update
$ brew install pyenv
$ pyenv install 3.12
$ pyenv local 3.12
```

## Usage
```sh
$ git clone git@github.com:theorchard/cookiecutter-fastapi.git
$ cd cookiecutter-fastapi
$ make env cookies
```

Follow the prompts to set up your cookiecutter'd fastapi microservice. It will create a new directory and you can move it outside of `cookiecutter-fastapi` into your Github repository.

By default, the `E2E Tests` Jenkinsfile stage is commented out. This is because it expects your fastapi microservice to have a corresponding [`cucumber-cypress-tests`](https://github.com/theorchard/cucumber-cypress-tests/blob/master/Makefile) Makefile target. Once you've added that Makefile target to the `cucumber-cypress-tests` repo, you can un-comment out the line that executes `e2eTests`

Please be sure to make PRs against [`terraform-infra`](https://github.com/theorchard/terraform-infra) to add your service to `qa/lambda-jwt-refresh/jwt_enabled_services.tf` and `prod/lambda-jwt-refresh/jwt_enabled_services.tf`. While we continue to make sure all parts of our application support JWT Bearer tokens, we need to maintain this list.
