Skip to content

portableDD/veritix-python

 
 

Repository files navigation

Veritix Python Service

Run with Docker

Prerequisites: Docker and Docker Compose installed.

  1. Build the image:
docker compose build
  1. Start the stack (app + Postgres):
docker compose up -d

The API will be available at http://localhost:8000.

Health check:

curl http://localhost:8000/health

Environment Variables

  • QR_SIGNING_KEY: Secret used to sign and validate QR payloads. Defaults to test_signing_key in development.

ETL Pipeline

This service includes a simple ETL that pulls ticketing data from a NestJS API and loads summary tables into Postgres (and optionally BigQuery).

  • Extracts events and ticket-sales from NEST_API_BASE_URL.
  • Transforms into two summary tables:
    • event_sales_summary (event-level totals)
    • daily_ticket_sales (event/day breakdown)
  • Loads into Postgres automatically if DATABASE_URL is set. BigQuery load is optional.

Configure

Copy .env.example to .env and set:

  • DATABASE_URL: Postgres connection string.
  • NEST_API_BASE_URL: Base URL of the NestJS API (e.g., https://nest.example.com/api).
  • NEST_API_TOKEN: Optional bearer token.
  • ENABLE_ETL_SCHEDULER: Set to true to enable periodic ETL.
  • ETL_CRON: Optional cron expression (UTC). If not set, uses ETL_INTERVAL_MINUTES.
  • ETL_INTERVAL_MINUTES: Interval for ETL run (default 15).
  • BigQuery (optional): BQ_ENABLED, BQ_PROJECT_ID, BQ_DATASET, BQ_LOCATION.

Run

  • Docker: docker compose up -d will start app and Postgres. Set env vars in compose or .env.
  • Local: python run.py starts the API; scheduler runs if enabled.

Tables are created automatically on first load.

Stop and Clean Up

docker compose down

Running tests

Install test dependencies (preferably inside a virtualenv):

python -m pip install --upgrade pip
pip install -r requirements.txt

Run the test suite with coverage:

python -m pytest --cov=src --cov-report=term-missing

The GitHub Actions workflow is configured to fail if overall coverage falls below 70%.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.9%
  • Dockerfile 3.1%