Skip to content

feat(fn-42): Quickstart documentation and demo infrastructure refactor #110

Merged
bordumb merged 18 commits intomainfrom
feat/fn-42-quickstart-docs
Feb 1, 2026
Merged

feat(fn-42): Quickstart documentation and demo infrastructure refactor #110
bordumb merged 18 commits intomainfrom
feat/fn-42-quickstart-docs

Conversation

@bordumb
Copy link
Owner

@bordumb bordumb commented Feb 1, 2026

Summary

Implements fn-42 (Quickstart Documentation) with a complete refactor of the demo infrastructure for a cleaner separation of concerns.

Changes

Demo Infrastructure Refactor

  • Move docker-compose.demo.yml into demo/ directory
  • Move observability configs (otel-collector-config.yaml, jaeger-ui-config.json) to infra/
  • Add INCLUDE_SEEDS env var to init-app-db.sh to control seed migrations
  • Simplify justfile demo recipes from 600+ lines to ~40 lines using compose

DuckDB Integration

  • Add pg_duckdb service (real PostgreSQL with DuckDB query engine) on port 5433
  • Create init-pgduckdb.sql to load demo fixtures on startup
  • Users manually connect datasource via UI (no auto-connect)

Bug Fixes

  • Add capture_snapshot activity to temporal worker (was missing)
  • Add tenant record to seed migration (required for datasource foreign key)

Documentation

  • Rewrite demo/README.md with clear demo workflow instructions
  • Update quickstart docs

Demo Workflow

# Start demo                                                                                                                               
just demo                                                                                                                                  
                                                                                                                                           
# Login at http://localhost:3000                                                                                                           
# Email: demo@dataing.io                                                                                                                   
# Password: demo123456                                                                                                                     
                                                                                                                                           
# Add datasource via UI:                                                                                                                   
# Type: PostgreSQL, Host: duckdb, Port: 5432                                                                                               
# Database: demo, User: demo, Password: demo                                                                                               
                                                                                                                                           
# Run investigation on connected datasource                                                                                                
                                                                                                                                           
Required Environment Variables                                                                                                             
                                                                                                                                           
Add to .env:                                                                                                                               
ANTHROPIC_API_KEY=sk-ant-...                                                                                                               
DATADR_ENCRYPTION_KEY=<fernet-key>                                                                                                         
                                                                                                                                           
Test plan                                                                                                                                  
                                                                                                                                           
- just demo starts all services including pg_duckdb                                                                                        
- Login works with demo credentials                                                                                                        
- Can add DuckDB datasource via UI                                                                                                         
- Investigation runs successfully with LLM calls                                                                                           
- just demo-stop and just demo-clean work

bordumb and others added 17 commits January 31, 2026 23:09
- Create infra/Dockerfile.backend with multi-stage build
- Use uv for fast dependency installation
- Run as non-root user (dataing) for security
- Include migrations at /app/migrations
- Health check on /health endpoint
- Default CMD starts API server, worker via command override

Image size ~2GB due to ML dependencies (sentence-transformers, torch)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create infra/Dockerfile.frontend with Vite build + nginx serving
- Add infra/nginx.conf with SPA fallback, API proxy, gzip compression
- Uses runtime DNS resolution for API upstream (works standalone)
- Image size: 93.4MB
- Includes security headers and health check endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create docker-compose.yml with 7 services: postgres, redis, temporal,
  temporal-ui, api, worker, frontend
- Add infra/init-temporal-db.sh for Temporal database initialization
- Use pgvector/pgvector:pg16 for shared PostgreSQL
- Configure Temporal auto-setup with postgres12 driver
- Wire environment variables with ${VAR:-default} pattern
- Add health checks for postgres, redis, and temporal
- Include observability profile for optional Jaeger/OTEL

Services verified:
- postgres, redis, temporal, temporal-ui start successfully
- Health checks pass
- Temporal uses shared PostgreSQL with separate databases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…fn-41.4)

- Add health checks to all services:
  - temporal-ui: wget spider check on port 8080
  - frontend: wget check on /nginx-health endpoint
  - worker: Python Temporal client connection check
- Enable Redis AOF persistence with --appendonly yes
- Rename volumes to dataing-pgdata and dataing-redis
- Create infra/healthcheck-worker.sh for reference

All services now have health checks with appropriate intervals,
timeouts, and start periods for proper startup sequencing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create .env.example with all documented environment variables
- Add infra/check-env.sh for startup validation
- Add env_file directive to api and worker services
- Update .gitignore to track .env.example

Variables organized by category:
- Required: ANTHROPIC_API_KEY, DATADR_ENCRYPTION_KEY
- Database: POSTGRES_PASSWORD
- Temporal: TEMPORAL_NAMESPACE, TEMPORAL_TASK_QUEUE
- API: LLM_MODEL
- Optional: observability settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create infra/smoke-test.sh for automated health verification
- Fix health checks to use 127.0.0.1 instead of localhost
- Cross-platform compatible (works on macOS without timeout command)

Verified on macOS Apple Silicon (arm64):
- All 7 services start and become healthy
- Total idle memory: ~595MB
  - api: 170MB, worker: 187MB, postgres: 116MB
  - temporal: 94MB, frontend: 9MB, temporal-ui: 9MB, redis: 9MB
- Data persistence across restarts verified
- Clean volume removal with -v verified
- All smoke tests pass

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace outdated Arq/Redis worker instructions with Docker Compose
- Add dual-path presentation (Docker vs pip) using MkDocs tabs
- Include demo datasource connection with pre-seeded anomalies
- Add verification commands with expected output
- Streamlined to 5-minute flow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Step 4-6: trigger, watch, and view investigation results
- Include curl and Python SDK examples with tabbed content
- Show expected JSON responses at each step
- Add "What just happened?" explainer for investigation phases
- Mention Temporal UI for workflow visualization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- API key not set, Docker daemon, port conflicts
- Temporal startup timing, memory requirements
- Database migrations, stuck investigations
- Platform-specific notes for macOS/Linux/Windows
- Getting Help section with support links

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create package-quickstart-fixtures.sh to build tarball
- Include baseline, null_spike, volume_drop scenarios
- Exclude events.parquet (18MB each) to keep tarball under 5MB
- Create quickstart-load.sql for standalone use
- Tarball is build artifact (not committed), generates to ~3.1MB

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create docs/test-quickstart.sh for automated E2E validation
- Fix broken link to self-host guide in quickstart.md
- Script tests: env setup, stack startup, health check, investigation trigger

Note: Full E2E validation requires ANTHROPIC_API_KEY and running Docker stack

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add db-migrate init service to run SQL migrations before API starts
- Add DATADR_DEMO_MODE=true to seed demo data (tenant, API key, datasource)
- Create infra/init-app-db.sh migration runner script
- API and worker now depend on db-migrate completing successfully

This fixes the "api_keys table does not exist" error on fresh Docker starts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The investigation API requires expected_value, actual_value,
deviation_pct, and anomaly_date fields. Update:
- docs/docs/quickstart.md curl and Python examples
- docs/test-quickstart.sh E2E test script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move observability configs to infra/ (otel-collector, jaeger-ui)
- Create root docker-compose.demo.yml override with pg_duckdb service
- Add INCLUDE_SEEDS env var to control seed migrations
- Add tenant to seed migration for datasource foreign key
- Register capture_snapshot activity in temporal worker
- Simplify justfile demo recipes to use compose
- Update demo README with new workflow instructions

Demo workflow:
1. just demo (starts all services including pg_duckdb on port 5433)
2. Login: demo@dataing.io / demo123456
3. Add datasource: Type=PostgreSQL, Host=duckdb, Port=5432, DB=demo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep demo-related files together in the demo/ directory.
Update justfile and volume paths accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bordumb bordumb self-assigned this Feb 1, 2026
@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dataing Ready Ready Preview, Comment Feb 1, 2026 9:57pm
dataing-app Ready Ready Preview, Comment Feb 1, 2026 9:57pm
dataing-docs Ready Ready Preview, Comment Feb 1, 2026 9:57pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant