py-metrics

Installation

PyMetrics ships as a Docker Compose stack with six services: backend (FastAPI), worker (Celery), flower, frontend (nginx), redis, and minio. A one-shot data-init container normalizes bind-mount permissions on Windows/macOS hosts, and minio-init creates the object-storage bucket before the worker comes up.

Prerequisites

Quick start

git clone https://github.com/cagatayuresin/py-metrics.git
cd py-metrics
cp .env.example .env
docker compose up -d

Wait until docker compose ps shows every service as healthy. Then open:

Environment variables

The most relevant knobs (full list in .env.example):

Variable Default Purpose
CLONE_SHALLOW true git clone --depth 1. Fast, but leaves git-history metric columns empty.
CLONE_DEPTH 1 Depth passed to shallow clone.
PYLINT_ENABLED true Toggle Pylint subprocess. Off cuts analysis time roughly in half.
MAX_REPO_SIZE_MB 500 Reject larger repositories up front.
MAX_FILE_COUNT 5000 Hard cap on Python files analyzed per repo.
AUTH_ENABLED false When true, SECRET_KEY must be set to a real secret.
S3_ENDPOINT_URL http://minio:9000 Object storage endpoint for ZIP/CSV artifacts.

Production notes

Development workflow

# Backend tests
docker compose run --rm --no-deps backend pytest

# Rebuild frontend production image
docker compose build frontend

# Follow runtime logs
docker compose logs -f backend worker frontend

Host virtualenvs and host node_modules are not required for normal project verification. The Compose stack is the reference environment.