|
| 1 | +# Getting Started |
| 2 | + |
| 3 | +This guide walks you through running Integr8sCode locally and executing your first script. You'll need Docker and Docker Compose installed - that's it. |
| 4 | + |
| 5 | +## What you're deploying |
| 6 | + |
| 7 | +The full stack includes a Svelte frontend, FastAPI backend, MongoDB, Redis, Kafka with Schema Registry, and seven background workers. Sounds like a lot, but `docker compose` handles all of it. First startup takes a few minutes to pull images and initialize services; subsequent starts are much faster. |
| 8 | + |
| 9 | +## Start the stack |
| 10 | + |
| 11 | +```bash |
| 12 | +git clone https://github.com/HardMax71/Integr8sCode.git |
| 13 | +cd Integr8sCode |
| 14 | +./deploy.sh dev |
| 15 | +``` |
| 16 | + |
| 17 | +Wait for the services to come up. You can watch progress with `docker compose logs -f` in another terminal. When you see the backend responding to health checks, you're ready. |
| 18 | + |
| 19 | +Verify everything is running: |
| 20 | + |
| 21 | +```bash |
| 22 | +curl -k https://localhost/api/v1/health/live |
| 23 | +``` |
| 24 | + |
| 25 | +If everything is up, you'll get: |
| 26 | + |
| 27 | +```json |
| 28 | +{"status":"ok","uptime_seconds":42,"timestamp":"2025-01-25T12:00:00Z"} |
| 29 | +``` |
| 30 | + |
| 31 | +## Access the UI |
| 32 | + |
| 33 | +Open [https://localhost:5001](https://localhost:5001) in your browser. You'll get a certificate warning since it's a self-signed cert - accept it and continue. |
| 34 | + |
| 35 | +Log in with the default credentials: |
| 36 | + |
| 37 | +- **Username:** `user` |
| 38 | +- **Password:** `user123` |
| 39 | + |
| 40 | +For admin access (user management, system settings, event browser), use `admin` / `admin123`. |
| 41 | + |
| 42 | +!!! warning "Development only" |
| 43 | + These credentials are seeded automatically for local development. For production, set `DEFAULT_USER_PASSWORD` and `ADMIN_USER_PASSWORD` environment variables before deploying. |
| 44 | + |
| 45 | +## Run your first script |
| 46 | + |
| 47 | +The editor opens with a Python example. Click **Run** to execute it. You'll see output streaming in real-time as the script runs in an isolated Kubernetes pod (or Docker container in dev mode). |
| 48 | + |
| 49 | +Try modifying the script or switching languages using the dropdown. Each execution gets its own isolated environment with configurable resource limits. |
| 50 | + |
| 51 | +## What's happening under the hood |
| 52 | + |
| 53 | +When you click Run: |
| 54 | + |
| 55 | +1. The frontend sends your script to the backend API |
| 56 | +2. Backend validates it, creates an execution record, and publishes an event to Kafka |
| 57 | +3. The coordinator worker picks up the event and starts a saga |
| 58 | +4. K8s worker spins up an isolated pod with the appropriate runtime |
| 59 | +5. Pod monitor watches for completion and captures output |
| 60 | +6. Result processor stores the result and publishes it to Redis |
| 61 | +7. Your browser receives the result via Server-Sent Events |
| 62 | + |
| 63 | +All of this happens in a few seconds. The event-driven architecture means you can scale each component independently and replay events for debugging. |
| 64 | + |
| 65 | +## Explore the stack |
| 66 | + |
| 67 | +With the stack running, you can poke around: |
| 68 | + |
| 69 | +| Service | URL | What it shows | |
| 70 | +|---------|-----|---------------| |
| 71 | +| Kafdrop | [http://localhost:9000](http://localhost:9000) | Kafka topics and messages | |
| 72 | +| Grafana | [http://localhost:3000](http://localhost:3000) | Metrics dashboards (admin/admin123) | |
| 73 | +| Jaeger | [http://localhost:16686](http://localhost:16686) | Distributed traces | |
| 74 | + |
| 75 | +## Troubleshooting |
| 76 | + |
| 77 | +**CPU/memory metrics show as `null`** |
| 78 | + |
| 79 | +The metrics server isn't installed by default in most local Kubernetes setups. Enable it: |
| 80 | + |
| 81 | +```bash |
| 82 | +kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml |
| 83 | +``` |
| 84 | + |
| 85 | +**Certificate warnings in browser** |
| 86 | + |
| 87 | +Expected - the stack uses self-signed certs for local development. Accept the warning and continue. |
| 88 | + |
| 89 | +**Services failing to start** |
| 90 | + |
| 91 | +Check logs for the specific service: `docker compose logs backend` or `docker compose logs kafka`. Most issues are either port conflicts (something else using 443, 5001, or 9092) or Docker running out of resources. |
| 92 | + |
| 93 | +**Kafka connection errors** |
| 94 | + |
| 95 | +Kafka takes longer to initialize than most services. Give it a minute after `deploy.sh dev` finishes, or watch `docker compose logs kafka` until you see "started" messages. |
| 96 | + |
| 97 | +## Stop the stack |
| 98 | + |
| 99 | +```bash |
| 100 | +./deploy.sh down |
| 101 | +``` |
| 102 | + |
| 103 | +To also remove persistent data (MongoDB, Redis volumes): |
| 104 | + |
| 105 | +```bash |
| 106 | +docker compose down -v |
| 107 | +``` |
| 108 | + |
| 109 | +## Next steps |
| 110 | + |
| 111 | +- [Architecture Overview](architecture/overview.md) - How the pieces fit together |
| 112 | +- [Deployment](operations/deployment.md) - Production deployment with Helm |
| 113 | +- [API Reference](reference/api-reference.md) - Full endpoint documentation |
| 114 | +- [Environment Variables](reference/environment-variables.md) - Configuration options |
0 commit comments