Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/robot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
# Show logs every 10 attempts to help debug
if [ $((i % 10)) -eq 0 ]; then
echo "Still waiting... showing recent logs:"
docker compose -f docker-compose-test.yml logs --tail=20 friend-backend-test
docker compose -f docker-compose-test.yml logs --tail=20 chronicle-backend-test
fi
if [ $i -eq 40 ]; then
echo "✗ Backend failed to start - showing full logs:"
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
working-directory: backends/advanced
run: |
echo "=== Backend Logs (last 50 lines) ==="
docker compose -f docker-compose-test.yml logs --tail=50 friend-backend-test
docker compose -f docker-compose-test.yml logs --tail=50 chronicle-backend-test
echo ""
echo "=== Worker Logs (last 50 lines) ==="
docker compose -f docker-compose-test.yml logs --tail=50 workers-test
Expand Down
43 changes: 43 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,49 @@ This supports a comprehensive web dashboard for management.

**❌ No Backward Compatibility**: Do NOT add backward compatibility code unless explicitly requested. This includes fallback logic, legacy field support, or compatibility layers. Always ask before adding backward compatibility - in most cases the answer is no during active development.

## Initial Setup & Configuration

Chronicle includes an **interactive setup wizard** for easy configuration. The wizard guides you through:
- Service selection (backend + optional services)
- Authentication setup (admin account, JWT secrets)
- Transcription provider configuration (Deepgram, Mistral, or offline ASR)
- LLM provider setup (OpenAI or Ollama)
- Memory provider selection (Chronicle Native with Qdrant or OpenMemory MCP)
- Network configuration and HTTPS setup
- Optional services (speaker recognition, Parakeet ASR)

### Quick Start
```bash
# Run the interactive setup wizard from project root
uv run python wizard.py

# Or use the quickstart guide for step-by-step instructions
# See quickstart.md for detailed walkthrough
```

### Setup Documentation
For detailed setup instructions and troubleshooting, see:
- **[@quickstart.md](quickstart.md)**: Beginner-friendly step-by-step setup guide
- **[@Docs/init-system.md](Docs/init-system.md)**: Complete initialization system architecture and design
- **[@Docs/getting-started.md](Docs/getting-started.md)**: Technical quickstart with advanced configuration
- **[@backends/advanced/SETUP_SCRIPTS.md](backends/advanced/SETUP_SCRIPTS.md)**: Setup scripts reference and usage examples
- **[@backends/advanced/Docs/quickstart.md](backends/advanced/Docs/quickstart.md)**: Backend-specific setup guide

### Wizard Architecture
The initialization system uses a **root orchestrator pattern**:
- **`wizard.py`**: Root setup orchestrator for service selection and delegation
- **`backends/advanced/init.py`**: Backend configuration wizard
- **`extras/speaker-recognition/init.py`**: Speaker recognition setup
- **Service setup scripts**: Individual setup for ASR services and OpenMemory MCP

Key features:
- Interactive prompts with validation
- API key masking and secure credential handling
- Environment file generation with placeholders
- HTTPS configuration with SSL certificate generation
- Service status display and health checks
- Automatic backup of existing configurations

## Development Commands

### Backend Development (Advanced Backend - Primary)
Expand Down
2 changes: 1 addition & 1 deletion Docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ uv sync --group (whatever group you want to sync)
## Troubleshooting

**Service Issues:**
- Check logs: `docker compose logs friend-backend`
- Check logs: `docker compose logs chronicle-backend`
- Restart services: `docker compose restart`
- View all services: `docker compose ps`

Expand Down
2 changes: 1 addition & 1 deletion Docs/init-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ curl http://localhost:8767/health
docker compose logs [service-name]

# Backend logs
cd backends/advanced && docker compose logs friend-backend
cd backends/advanced && docker compose logs chronicle-backend

# Speaker Recognition logs
cd extras/speaker-recognition && docker compose logs speaker-service
Expand Down
8 changes: 4 additions & 4 deletions backends/advanced/Docs/HTTPS_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ CORS_ORIGINS=https://localhost,https://127.0.0.1,https://100.83.66.30
**Services started:**
- ✅ nginx (ports 443/80) - SSL termination and proxy
- ✅ webui (port 5173, internal) - Vite dev server
- ✅ friend-backend (port 8000, internal)
- ✅ chronicle-backend (port 8000, internal)
- ✅ mongo, qdrant (databases)

**Access:** https://localhost/ or https://your-ip/
Expand All @@ -99,7 +99,7 @@ CORS_ORIGINS=https://localhost,https://127.0.0.1,https://100.83.66.30
**Services started:**
- ✅ nginx (ports 443/80) - but without SSL certificates
- ✅ webui (port 5173, direct access) - Vite dev server
- ✅ friend-backend (port 8000)
- ✅ chronicle-backend (port 8000)
- ✅ mongo, qdrant (databases)

**Access:** http://localhost:5173
Expand Down Expand Up @@ -169,7 +169,7 @@ docker compose restart nginx
**Problem:** "Cross-Origin Request Blocked"
**Solution:**
1. Update CORS_ORIGINS in `.env` to include your HTTPS origin
2. Restart backend: `docker compose restart friend-backend`
2. Restart backend: `docker compose restart chronicle-backend`

### Microphone Access Denied

Expand All @@ -192,7 +192,7 @@ docker compose restart nginx
### Standard Setup
- **3000** - HTTP (webui production)
- **5173** - HTTP (webui development)
- **8000** - HTTP (friend-backend)
- **8000** - HTTP (chronicle-backend)

## Live Recording Feature

Expand Down
2 changes: 1 addition & 1 deletion backends/advanced/Docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ backends/advanced-backend/

- **Debug API**: `GET /api/debug/memory/*` endpoints show real-time system status
- **Configuration**: Check `memory_config.yaml` for behavior controls
- **Logs**: Check Docker logs with `docker compose logs friend-backend`
- **Logs**: Check Docker logs with `docker compose logs chronicle-backend`
- **Documentation**: Each doc file links to relevant code sections

---
Expand Down
4 changes: 2 additions & 2 deletions backends/advanced/Docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ stateDiagram-v2
```mermaid
graph LR
subgraph "Docker Network"
Backend[friend-backend<br/>uv + FastAPI]
Backend[chronicle-backend<br/>uv + FastAPI]
WebUI[webui<br/>React Dashboard]
Proxy[nginx<br/>Load Balancer]
Mongo[mongo:4.4.18<br/>Primary Database]
Expand Down Expand Up @@ -616,7 +616,7 @@ graph LR

### Container Specifications

#### Backend Container (`friend-backend`)
#### Backend Container (`chronicle-backend`)
- **Base**: Python 3.12 slim with uv package manager
- **Dependencies**: FastAPI, WebSocket libraries, audio processing tools
- **Volumes**: Audio chunk storage, debug directories
Expand Down
4 changes: 2 additions & 2 deletions backends/advanced/Docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ curl -X POST "http://localhost:8000/auth/jwt/login" \
#### 3. Admin User Creation
```bash
# Check logs for admin creation
docker compose logs friend-backend | grep -i admin
docker compose logs chronicle-backend | grep -i admin

# Verify environment variables
echo $ADMIN_PASSWORD
Expand All @@ -272,7 +272,7 @@ echo $ADMIN_PASSWORD
docker exec -it mongo-container mongosh chronicle

# View authentication logs
docker compose logs friend-backend | grep -i auth
docker compose logs chronicle-backend | grep -i auth

# Test API endpoints
curl -H "Authorization: Bearer $TOKEN" http://localhost:8000/api/users/me
Expand Down
2 changes: 1 addition & 1 deletion backends/advanced/Docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ uv sync --group (whatever group you want to sync)
## Troubleshooting

**Service Issues:**
- Check logs: `docker compose logs friend-backend`
- Check logs: `docker compose logs chronicle-backend`
- Restart services: `docker compose restart`
- View all services: `docker compose ps`

Expand Down
22 changes: 11 additions & 11 deletions backends/advanced/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ http {
}

# Upstream services
upstream friend_backend {
server friend-backend:8000;
upstream chronicle_backend {
server chronicle-backend:8000;
}

upstream friend_webui {
Expand All @@ -70,7 +70,7 @@ http {

# Backend API endpoints
location /api/ {
proxy_pass http://friend_backend/api/;
proxy_pass http://chronicle_backend/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -80,7 +80,7 @@ http {

# Authentication endpoints
location /auth/ {
proxy_pass http://friend_backend/auth/;
proxy_pass http://chronicle_backend/auth/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -90,7 +90,7 @@ http {

# Users endpoints
location /users/ {
proxy_pass http://friend_backend/users/;
proxy_pass http://chronicle_backend/users/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -100,7 +100,7 @@ http {

# WebSocket endpoints for audio streaming
location /ws_pcm {
proxy_pass http://friend_backend/ws_pcm;
proxy_pass http://chronicle_backend/ws_pcm;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand All @@ -117,7 +117,7 @@ http {
}

location /ws_omi {
proxy_pass http://friend_backend/ws_omi;
proxy_pass http://chronicle_backend/ws_omi;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand All @@ -135,7 +135,7 @@ http {

# Legacy WebSocket endpoint
location /ws {
proxy_pass http://friend_backend/ws;
proxy_pass http://chronicle_backend/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand All @@ -153,7 +153,7 @@ http {

# Health check endpoints
location /health {
proxy_pass http://friend_backend/health;
proxy_pass http://chronicle_backend/health;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -162,7 +162,7 @@ http {

# Readiness check endpoint
location /readiness {
proxy_pass http://friend_backend/readiness;
proxy_pass http://chronicle_backend/readiness;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -171,7 +171,7 @@ http {

# Audio file serving
location /audio/ {
proxy_pass http://friend_backend/audio/;
proxy_pass http://chronicle_backend/audio/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
2 changes: 1 addition & 1 deletion backends/advanced/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def start_services(self):
logger.info(f"🔄 Found {len(running_services)} running test services")
# Check if test backend is healthy (only skip if not rebuilding)
try:
health_check = subprocess.run(["docker", "compose", "-f", "docker-compose-test.yml", "ps", "friend-backend-test"], capture_output=True, text=True)
health_check = subprocess.run(["docker", "compose", "-f", "docker-compose-test.yml", "ps", "chronicle-backend-test"], capture_output=True, text=True)
if "healthy" in health_check.stdout or "Up" in health_check.stdout:
logger.info("✅ Test services already running and healthy, skipping restart")
self.services_started = True
Expand Down
6 changes: 3 additions & 3 deletions backends/advanced/webui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ A modern React-based web interface for the Chronicle AI-powered personal audio s
4. **Start backend services:**
```bash
cd ../
docker compose up friend-backend mongo qdrant
docker compose up chronicle-backend mongo qdrant
```

### Docker Development
Expand All @@ -70,7 +70,7 @@ docker compose --profile dev up
```

This starts:
- Backend services (friend-backend, mongo, qdrant)
- Backend services (chronicle-backend, mongo, qdrant)
- React dev server with hot reload (http://localhost:5173)

## Production Deployment
Expand All @@ -79,7 +79,7 @@ This starts:

```bash
cd backends/advanced
docker compose up webui friend-backend mongo qdrant
docker compose up webui chronicle-backend mongo qdrant
```

The production build will be available at http://localhost:3000
Expand Down
2 changes: 1 addition & 1 deletion backends/simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ For full transcription and memory features, use the [Advanced Backend](../advanc
### Logs
```bash
# View service logs
docker compose logs -f friend-backend
docker compose logs -f chronicle-backend

# Check audio processing
tail -f ./audio_chunks/
Expand Down
6 changes: 3 additions & 3 deletions backends/simple/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
friend-backend:
chronicle-backend:
build:
context: .
dockerfile: Dockerfile
Expand All @@ -14,6 +14,6 @@ services:
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
- NGROK_DOMAIN=${NGROK_DOMAIN}
command: "http friend-backend:8000 --domain=${NGROK_DOMAIN}"
command: "http chronicle-backend:8000 --domain=${NGROK_DOMAIN}"
depends_on:
- friend-backend
- chronicle-backend
4 changes: 2 additions & 2 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ profiles:
build:

artifacts:
- image: friend-backend-test
- image: chronicle-backend-test
context: backends/advanced
docker:
dockerfile: Dockerfile
Expand All @@ -195,7 +195,7 @@ profiles:

deploy:
docker:
images: [friend-backend-test, webui-test, mongo-test, qdrant-test, redis-test]
images: [chronicle-backend-test, webui-test, mongo-test, qdrant-test, redis-test]



Expand Down
2 changes: 1 addition & 1 deletion tests/TESTING_USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ robot --rerunfailed output.xml tests/
CLEANUP_CONTAINERS=false robot tests/endpoints/auth_tests.robot

# Inspect backend logs
docker logs advanced-friend-backend-test-1
docker logs advanced-chronicle-backend-test-1

# Inspect database
docker exec -it advanced-mongo-test-1 mongosh test_db
Expand Down
4 changes: 2 additions & 2 deletions tests/endpoints/rq_queue_tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Restart Backend Service
Log Restarting backend service to test job persistence

# Stop backend container
Run Process docker compose -f ${COMPOSE_FILE} stop friend-backend-test
Run Process docker compose -f ${COMPOSE_FILE} stop chronicle-backend-test
... cwd=. timeout=30s

# Start backend container again
Run Process docker compose -f ${COMPOSE_FILE} start friend-backend-test
Run Process docker compose -f ${COMPOSE_FILE} start chronicle-backend-test
... cwd=. timeout=60s

# Wait for backend to be ready again
Expand Down
Loading
Loading