Thank you for your interest in contributing to CodeFRAME!
# Clone repository
git clone https://github.com/frankbria/codeframe.git
cd codeframe
# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment
uv venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
# Install development dependencies
uv sync
# Set up environment variables
export ANTHROPIC_API_KEY="your-api-key-here"
# Set up frontend (if working on UI)
cd web-ui
npm install
cd ..
# Run tests
uv run pytest
# Format code
uv run ruff format codeframe tests
uv run ruff check codeframe tests- Follow PEP 8
- Use type hints
- Write docstrings for public APIs
- Maximum line length: 100 characters
Before contributing, review relevant architecture documentation in docs/architecture/:
- Task Identifiers: Understand the dual-identifier system (
idvstask_number) and dependency semantics - Design Decisions: Review existing patterns before introducing new ones
Add new architecture documentation when introducing cross-cutting patterns or data model changes.
CodeFRAME uses FastAPI Users for authentication and implements comprehensive authorization checks.
Authentication is always required for all API endpoints. All requests must include a valid JWT Bearer token in the Authorization header. Requests without valid tokens receive 401 Unauthorized.
For testing, test fixtures automatically create JWT tokens. See tests/api/conftest.py for examples.
When creating new API endpoints that access project resources:
from fastapi import HTTPException, Depends
from codeframe.persistence.database import Database
from codeframe.ui.dependencies import get_db, get_current_user, User
@router.get("/api/projects/{project_id}/resource")
async def get_resource(
project_id: int,
db: Database = Depends(get_db),
current_user: User = Depends(get_current_user),
):
# 1. Verify project exists
project = db.get_project(project_id)
if not project:
raise HTTPException(status_code=404, detail="Project not found")
# 2. Authorization check
if not db.user_has_project_access(current_user.id, project_id):
raise HTTPException(status_code=403, detail="Access denied")
# 3. Proceed with operation
return {"resource": "data"}Key Requirements:
- Add
current_user: User = Depends(get_current_user)parameter - Check project existence before authorization check
- Use
db.user_has_project_access()for authorization - Return 403 Forbidden (not 404) for unauthorized access
See Also: docs/authentication.md for complete guide.
- Write unit tests for new features
- Maintain >85% code coverage
- Run
uv run pytestbefore submitting PRs - Include authentication/authorization tests for protected endpoints
- Create a feature branch from
main - Make your changes with clear commit messages
- Add tests for new functionality
- Update documentation if needed
- Run tests and linting
- Submit PR with description of changes
See codeframe/providers/base.py for the provider interface.
Example:
from codeframe.providers.base import AgentProvider
class GeminiProvider(AgentProvider):
def initialize(self, config: dict) -> None:
# Implementation
pass
# etc.See codeframe/tasks/test_runner.py for test runner configuration.
Open an issue or start a discussion on GitHub.