Skip to content

About

Integr8sCode lets you run scripts online by executing them in isolated K8s pods with resource limits. Just input your code!

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Integr8sCode Logo

Integr8sCode

Ruff Status Mypy Status Security Scan Status Dead Code Check Docker Scan Status Backend Tests Frontend Tests Frontend Lint

Backend Coverage Frontend Coverage

Quality Gate Status Vulnerabilities Bugs

Integr8sCode runs your scripts online. Paste a Python, Node.js, Ruby, Bash or Go script, pick a version, and the platform runs it in its own Kubernetes pod with resource limits to keep things safe. You get the output back as soon as the pod finishes.

Note

A deployed and working version of Integr8sCode is available at https://app.integr8scode.cc/.

How to deploy

Prerequisites

  • Docker and Docker Compose
  • Kubernetes cluster (k3s, Docker Desktop K8s, or minikube) with kubectl configured

Quick start

git clone https://github.com/HardMax71/Integr8sCode.git
cd Integr8sCode
./deploy.sh dev

Secrets (MongoDB, Redis, JWT) fall back to dev defaults, so local development needs no config. For production, set SECRET_KEY, MONGO_USER, MONGO_PASSWORD and REDIS_PASSWORD as env vars, plus MONGO_MONITOR_PASSWORD with --observability.

Verify

curl -k https://localhost/api/v1/health/live

Access

Service URL Notes
Frontend https://localhost:5001 user / user123 or admin / admin123
Backend API https://localhost:443
Grafana http://localhost:3000 needs --observability; admin / admin123
Jaeger (Tracing) http://localhost:16686 needs --observability
Kafdrop (Kafka UI) http://localhost:9000 needs --debug

./deploy.sh dev --observability adds Grafana, Jaeger, Victoria Metrics, Loki and the OTel Collector. --debug adds all of those plus Kafdrop.

Self-signed TLS certs are generated automatically, so accept the browser warning.

Run tests

Unit tests need no running stack:

cd backend && uv run pytest tests/unit
cd ../frontend && npm ci && npm run test

The E2E suites need the full stack; CONTRIBUTING.md has the commands.

Stop

./deploy.sh down

See the full deployment guide for Docker build strategy, troubleshooting, pre-built images, and more.

Sample test

This script uses the type statement, which arrived in Python 3.12. Running it on two versions shows that each run gets a pod with the version you picked.

  1. Open https://localhost:5001/ and log in as user / user123. You land in the editor.
  2. Paste this script:
import platform

type Pair[T] = tuple[T, T]  # the type statement needs Python 3.12+


def swap[T](pair: Pair[T]) -> Pair[T]:
    first, second = pair
    return second, first


print(f"Hello from Python {platform.python_version()}")
print(swap((1, 2)))
print(swap(("left", "right")))
  1. Keep Python 3.14 (the default) and click Run Script. The output panel shows:
Status: completed
Output:
  Hello from Python 3.14.8
  (2, 1)
  ('right', 'left')
  1. Switch to Python 3.11 and run it again. 3.11 can't parse the type line:
Status: completed
Errors:
  File "/scripts/main.py", line 3
    type Pair[T] = tuple[T, T]  # the type statement needs Python 3.12+
         ^^^^
SyntaxError: invalid syntax

The status stays completed because the pod itself ran fine. The script's own failure shows up as stderr and a non-zero exit code.

Architecture Overview

Tip

Full documentation is available at https://hardmax71.github.io/Integr8sCode/

system diagram

A Svelte 5 frontend talks to a FastAPI backend, which keeps its state in MongoDB and Redis and publishes every execution request to Kafka. Workers take it from there: the saga orchestrator schedules the run, the k8s worker starts a locked-down pod, the pod monitor watches it, and the result processor stores the output. The frontend follows each run live over SSE.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Integr8sCode lets you run scripts online by executing them in isolated K8s pods with resource limits. Just input your code!

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages