-`app.py` is the Flask entrypoint; it wires blueprints from `lawrisk/api` (`v1.py` legacy, `v2.py` current) and enables CORS/logging.
-`lawrisk/services` contains business logic and data access (`lawrisk_service.py`, `lawrisk_v2_service.py`, `licensing_repo.py`); keep new services thin and testable.
- Run the API locally: `python app.py` (defaults to `http://localhost:8000`, health check at `/healthz`).
- Lint/format: `ruff .` and `black .` before submitting.
- Tests: `pytest` (use `pytest -q` for faster feedback). For API smoke tests, open `static/v2_tester.html` or `curl` the V2 endpoint shown in `docs/guides/README.md`.
- Follow the existing Conventional Commit pattern (`feat: ...`, `fix: ...`, `chore: ...`); scope subjects to the domain (e.g., `feat: enhance v2 permit filter`).
- Group one logical change per commit; avoid mixing formatting-only changes with functional updates.
- PRs should state intent, summarize testing (`pytest`, manual curls, screenshots of payload diffs), and link any issue/task. Call out config/env expectations for reviewers.
## Security & Configuration Tips
- Copy `.env` locally and set DB creds (`PG_*`, `LIC_PG_*`), `FLASK_SECRET_KEY`, and DashScope keys before running anything beyond unit tests.
- Never hardcode secrets or connection strings; prefer env variables read through `env_loader`.
- Guard new endpoints with existing auth middleware and log sensitive operations at INFO, not DEBUG, to avoid leaking payloads.