Documentation for the AI-Native executive coaching platform
deploy.py)# Clone the repo
git clone git@github.com:jazzmind/ai-native.git
cd ai-native/coaches/app
# Install dependencies
npm install
# Set up environment
cp ../.env.example ../.env
# Edit .env with your ANTHROPIC_API_KEY
# Set up auth
cp .env.local.example .env.local
# Edit .env.local with AUTH_SECRET and AUTH_ADMIN_EMAILS
npm run dev
Starts Next.js with Turbopack on http://localhost:3000.
npm run electron:dev
Runs Next.js dev server and Electron concurrently. Electron opens a window pointing to the dev server.
# Next.js production build
npm run build
# Electron packaging
npm run electron:build
# Electron unpackaged (for testing)
npm run electron:pack
# Run all tests
npm test
# Run specific test file
npx vitest run src/lib/__tests__/router.test.ts
# Watch mode
npx vitest
Tests live alongside their source in __tests__/ directories:
src/lib/
├── __tests__/
│ ├── config-store.test.ts # Config store tests
│ ├── knowledge.test.ts # Knowledge provider tests
│ └── router.test.ts # Router logic tests
Per project rules:
"use client" only when needed@/ path alias for src/coaches/new-advisor/INSTRUCTIONS.mdCOACH_CONFIGS in deploy.pyCOACH_META in app/src/lib/coaches.tsCOACH_CONFIGS in app/src/lib/deploy/coach-loader.tspython deploy.py deploy to deploycoaches/modes/new-mode.md with the mode templateAGENT_MODES and MODE_META in app/src/lib/modes.tsapp/src/lib/router.tssrc/app/api/GET, POST, etc. from route.tsNextRequest for typed request handlinggetRequiredUser() from lib/auth.ts for authenticationResponse.json() for JSON responsesDeployAdapter interface from lib/deploy/adapter.tslib/deploy/index.tslib/<type>/ directorySQLite via better-sqlite3 in WAL mode. The database file coach-router.db is created in the app’s working directory on first access.
Tables are auto-created by each module’s getDb() function. No migration system – schema changes are additive via CREATE TABLE IF NOT EXISTS.
| Table | Purpose |
|---|---|
conversations |
Chat threads (per-user, per-project) |
messages |
Chat messages with mode column |
message_feedback |
Thumbs up/down ratings with comments |
agent_behaviors |
Behavioral directives (per-advisor, per-project) |
behavior_revisions |
AI-proposed behavioral changes |
tool_trust |
Tool trust levels (per-user, per-project) |
review_requests |
Expert review tracking |
expert_comments |
Inline expert feedback |
projects |
User workspaces |
user_profile |
User profile facts (global per-user) |
knowledge_fts |
FTS5 knowledge index (per-project) |
deploy_targets |
Deployment configuration (per-user) |
config |
Key-value settings (per-user) |
mcp_connections |
MCP server auth state |
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | API key for Claude |
AUTH_SECRET |
Yes | Auth.js session encryption key |
AUTH_TRUST_HOST |
Yes | Set to true for local development |
AUTH_ADMIN_EMAILS |
No | Comma-separated list of allowed email addresses |
AUTH_GOOGLE_ID |
No | Google OAuth client ID |
AUTH_GOOGLE_SECRET |
No | Google OAuth client secret |
AUTH_GITHUB_ID |
No | GitHub OAuth client ID |
AUTH_GITHUB_SECRET |
No | GitHub OAuth client secret |
COACH_MCP_ENABLED |
No | Enable MCP servers in deploy.py (true/false) |
CONFIG_ENCRYPTION_KEY |
No | Override key for credential encryption |