Skip to content

Development Setup

Get Canon running locally for development.

Prerequisites

  • Python 3.12+
  • uv (package manager)
  • Node.js 18+ (for the frontend)
  • Git

Clone and Install

bash
git clone git@github.com:canonhq/canon.git
cd canon

# Install all dependencies (backend + frontend)
make install

This runs:

  • uv sync --extra dev — Python dependencies including dev extras
  • cd frontend && npm ci — Frontend dependencies

Environment Variables

Copy the example env file and fill in your values:

bash
cp .env.example .env

Required for basic development:

VariableDescription
GH_APP_IDGitHub App ID
GH_PRIVATE_KEYGitHub App private key (PEM format)
GH_WEBHOOK_SECRETGitHub App webhook secret
GH_INSTALLATION_IDGitHub App installation ID
ANTHROPIC_API_KEYClaude API key for agent runtime

Optional:

VariableDescription
GITHUB_TOKENGitHub PAT for ticket sync via GitHub Issues
JIRA_HOSTJira instance hostname
JIRA_EMAILJira service account email
JIRA_API_TOKENJira API token
LINEAR_API_KEYLinear API key
LOG_LEVELLogging level (default: info)

Running Locally

Backend Only

bash
# With environment variables configured
make dev

# Without secrets (no auth, limited features)
make dev-no-auth

The FastAPI server runs at http://localhost:3000 with auto-reload.

Frontend Only

bash
make dev-frontend

Vite HMR server at http://localhost:5173.

bash
make dev

The FastAPI server serves the Vue SPA and handles API routes.

Kubernetes Dev Environment

For testing against real GitHub webhooks and ticket systems, use the DevSpace-based dev environment:

Additional Prerequisites

  • Docker
  • DevSpace CLI (v6+)
  • A Kubernetes cluster with kubectl configured
  • A container registry (e.g., Docker Hub, GHCR, or cloud provider registry)

One-Time Setup

bash
# Authenticate with your container registry
docker login <your-registry>

# Configure kubectl for your cluster
kubectl config use-context <your-cluster>

Usage

bash
export DEVSPACE_USERNAME=your-name

# Full dev mode
devspace dev

# → http://localhost:3000 (port-forwarded)

File changes in src/, templates/, and static/ sync into the pod and uvicorn auto-reloads.

Useful DevSpace Commands

bash
devspace run logs             # tail pod logs
devspace run sync-secrets     # re-sync secrets
devspace run sync-trigger     # manually run reverse sync cron
devspace purge                # tear down dev environment

Make Commands

Run make help for the full list. Key commands:

CommandDescription
make installInstall all dependencies
make devRun dev server
make testRun Python tests
make lintLint backend + frontend
make formatAuto-fix Python lint errors
make typecheckRun mypy + vue-tsc
make buildBuild Vue SPA
make build-dockerBuild production Docker image
make docs-devRun docs site dev server
make docs-buildBuild docs site

AI-native enterprise documentation platform.