-
Notifications
You must be signed in to change notification settings - Fork 1
Centralize API base path and introduce /api/v1 versioning #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Centralize API base path and introduce /api/v1 versioning #78
Conversation
5a1ae27 to
ceed352
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request centralizes API path configuration and introduces versioning by adding /api/v1 as the base path for all API endpoints. The change establishes a foundation for future API evolution while maintaining backward compatibility through environment configuration. The PR also upgrades development tooling (mypy 1.19.1, pre-commit hooks) and improves configuration management in both frontend and backend.
Key changes:
- Introduced centralized API versioning with
/api/v1base path via newapp/api/version.pymodule - Updated all environment files, tests, and CI configuration to use the new versioned API endpoints
- Added explicit environment validation in Vite configuration and upgraded frontend dependency management with dotenv
- Upgraded mypy to 1.19.1 and updated pre-commit configuration for better type checking
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
backend/app/api/version.py |
New module defining centralized API_BASE path constant (/api/v1) |
backend/app/api/meta.py |
New meta endpoint exposing API version information |
backend/app/api/health.py |
Extracted health endpoint into dedicated router module |
backend/app/main.py |
Updated router registration to use centralized API_BASE prefix |
backend/tests/**/*.py |
Updated all test URLs to use API_BASE constant |
backend/pyproject.toml |
Upgraded mypy to 1.19.1, refined per-file-ignores patterns, added isort configuration |
backend/uv.lock |
Lock file updates for mypy 1.19.1 and new librt dependency |
frontend/vite.config.ts |
Replaced Vite's loadEnv with explicit dotenv loading and added environment file validation |
frontend/src/api/api.ts |
Removed fallback default for VITE_API_BASE_URL to enforce explicit configuration |
frontend/package.json & frontend/pnpm-lock.yaml |
Added dotenv dependency for environment file loading |
.envs/**/*.env.example |
Updated all example environment files with /api/v1 paths |
.pre-commit-config.yaml |
Upgraded pre-commit hooks to v6.0.0 and mypy to v1.19.1, added explicit config file arguments |
.github/workflows/backend-ci.yml |
Renamed workflow, added path filters, updated cache strategy, clarified pre-commit execution context |
README.md |
Enhanced pre-commit documentation with explicit guidance on running from repo root |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
.github/workflows/backend-ci.yml:144
- The cache key for pre-commit has been changed from 'pre-commit-${{ runner.os }}-' to remove the restore-keys. While this may be intentional for stricter cache control, it means that partial cache matches will no longer be used when the config file changes, potentially slowing down CI runs. Consider adding back 'restore-keys: pre-commit-${{ runner.os }}-' to allow partial cache hits.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b36c87d to
d9cf597
Compare
Description
Closes #51
This pull request centralizes API path configuration and introduces versioning by adding
/api/v1as the base path for all API endpoints. The change establishes a foundation for future API evolution while maintaining backward compatibility through environment configuration. The PR also upgrades development tooling (mypy 1.19.1, pre-commit hooks) and improves configuration management in both frontend and backend.Key changes:
/api/v1base path via newapp/api/version.pymoduleRequirements
CI structure
Python / uv
uv venv+uv sync.venv(correctness over speed)~/.cache/uvonlypre-commit
pre-commitis installed via backend dev depsSKIPto avoid frontend hooks in backend CI--config-file=backend/pyproject.toml)pytest / Alembic
backend/(not repo root)Caching
restore-keysusage for toolsStill to do (before merge)
--strict-markersto pytest if desiredExplicitly out of scope (future PRs)
Checklist
Deployment Notes (if any)