Welcome to the Avanti Fellows Reporting Engine!
- Python 3.11+ installed
- uv package manager installed
- Install dependencies and create virtual environment
uv sync
- Install pre-commit hooks
uv run pre-commit install
- Create environment file
cp .env.example .env.local
-
Configure credentials Obtain credentials from repository owners and replace the local keys in the
.env.local
file. -
Run the FastAPI server
uv run uvicorn app.main:app --port 5050 --reload
The application will be available at localhost:5050/docs
Update dependencies:
uv sync --upgrade
Run code quality checks:
uv run pre-commit run --all-files
Add new dependency:
uv add <package-name>
Add development dependency:
uv add --dev <package-name>
We deploy our FastAPI instance on AWS Lambda which is triggered via an API Gateway. In order to automate the process, we use AWS SAM, which creates the stack required for deployment and updates it as needed with just a couple of commands and without having to do anything manually on the AWS GUI. Refer to this blog post for more details.
The actual deployment happens through Github Actions. Look at .github/workflows/deploy_to_staging.yml
to understand the deployment to Staging and .github/workflows/deploy_to_prod.yml
for Production.
The details of the AWS Lambda instances are described in templates/prod.yaml
and templates/staging.yaml
.