Contributing¶
How to set up a local environment, run the same lint, test and migration checks as CI, and land a change in fredgar-ai.
Thanks for contributing to Fredgar AI (FRED + EDGAR, with AI) — a Django + DRF backend and Vite/React UI for SEC EDGAR company data and FRED macro series, with AI-assisted analysis. Repo: fredgar-ai.
Prerequisites¶
- Python 3.12+
- Node.js 20+ (for the Vite frontend)
- Optional: Docker with Compose (matches CI-style checks)
Python environment¶
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
cp src/.env.example src/.env
# Set USER_AGENT_EMAIL for any command that calls SEC.
# src/.env is loaded automatically by config/settings.py (python-dotenv);
# real environment variables already set take precedence.
Dependencies¶
Runtime deps are managed with pip-tools: edit requirements.in (bounded ranges) and regenerate the pinned lock:
pip-compile requirements.in # rewrites requirements.txt
pip-compile --upgrade-package django requirements.in # bump one package
Common tasks are wrapped in the Makefile: make lint, make test, make typecheck, make migrations, make all.
Run Django from src/:
PYTHONPATH and DJANGO_SETTINGS_MODULE are set automatically when using cd src and the project layout; tests use config.settings_test via pyproject.toml [tool.pytest.ini_options].
Lint and tests¶
From the repository root:
Coverage thresholds apply in Docker CI (docker compose --profile ci); local pytest runs without the coverage gate unless you pass the same flags as docker/ci.sh.
Frontend¶
Migrations¶
After model changes:
Documentation¶
- Index:
docs/README.md - Architecture:
docs/architecture.md - API and CLI:
docs/api-and-cli.md, with the generated route and command reference indocs/reference/(python3 tools/gen_reference.py --write) - Releasing:
docs/releasing.md - Agent guide:
AGENTS.md
Security¶
Never report a vulnerability in a public issue or pull request. Follow SECURITY.md to report it privately, and keep live tokens out of the report.
SEC usage¶
Identify your application with a valid contact in User-Agent (USER_AGENT_EMAIL / SEC_USER_AGENT_EMAIL per settings). Follow SEC fair access guidance.