Skip to content

avantifellows/reporting

Repository files navigation

Reporting Engine

Welcome to the Avanti Fellows Reporting Engine!

Local Setup

Prerequisites

  • Python 3.11+ installed
  • uv package manager installed

Setup Steps

  1. Install dependencies and create virtual environment
uv sync
  1. Install pre-commit hooks
uv run pre-commit install
  1. Create environment file
cp .env.example .env.local
  1. Configure credentials Obtain credentials from repository owners and replace the local keys in the .env.local file.

  2. Run the FastAPI server

uv run uvicorn app.main:app --port 5050 --reload

The application will be available at localhost:5050/docs

Development Commands

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>

Deployment

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.

About

Reporting Server for AF Data

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5