Spring Boot API for CodeKB (knowledge bases, repos, graph jobs, search).
Copy src/main/resources/application.example.yml to src/main/resources/application.yml, then override with environment variables as needed. Set at least:
| Variable | Description |
|---|---|
CODEKB_DATASOURCE_URL |
JDBC URL |
CODEKB_DATASOURCE_USERNAME / CODEKB_DATASOURCE_PASSWORD |
DB credentials |
CODEKB_REDIS_HOST / CODEKB_REDIS_PORT / CODEKB_REDIS_PASSWORD |
Redis |
CODEKB_JWT_SECRET |
At least 32 bytes |
CODEKB_OSS_* |
Aliyun OSS (if used) |
CODEKB_GRAPH_BASE_URL |
Graph worker service URL |
CODEKB_GITHUB_TOKEN |
GitHub API token for repo metadata; GITHUB_TOKEN / GH_TOKEN also work |
Optional: add src/main/resources/application-local.yml (gitignored) for local overrides.
PowerShell example:
$env:CODEKB_GITHUB_TOKEN = "your_github_token"
mvn spring-boot:runThis project needs JDK 17+, and the current local machine already has JDK 21.
Recommended on Windows PowerShell:
.\scripts\run-local.ps1The script does three things before startup:
- switches the shell to
C:\Program Files\Java\jdk-21 - removes stale
target/output that can break Maven incremental compile on Chinese Windows paths - runs
mvn spring-boot:run
Manual startup is still available:
$env:JAVA_HOME = "C:\Program Files\Java\jdk-21"
$env:Path = "$env:JAVA_HOME\bin;$env:Path"
mvn clean spring-boot:runAPI base path: http://localhost:8080/api/v1