Interactive learning platform for Terraform and Kubernetes. Learn by fixing broken code, not by reading docs.
| Home | Progress tracking |
![]() |
![]() |
| Kubernetes exercise | Terraform exercise |
![]() |
![]() |
- Interactive exercises with a code editor (Monaco), simulated terminal (xterm.js), and instant feedback
- **Terraform module: fix provider misconfigurations, declare missing variables
- **Kubernetes module: fix invalid Pod YAML, debug CrashLoopBackOff
- **Progress tracking: exercises unlock sequentially as you complete prerequisites
- **Realistic simulation: terminal commands produce output identical to real
terraformandkubectlCLI
- Next.js 15 (App Router) + TypeScript
- Tailwind CSS 4
- SQLite via Drizzle ORM + better-sqlite3
- Monaco Editor (
@monaco-editor/react) - xterm.js (
@xterm/xterm)
- Node.js 18+
- npm
# Install dependencies
npm install
# Create the SQLite database
npm run db:seed
# Start the development server
npm run devOpen http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start development server (port 3000) |
npm run build |
Production build |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run db:seed |
Create/reset database tables |
# Install dependencies
npm ci
# Create the database
npm run db:seed
# Build the application
npm run build
# Start the production server
npm run startThe app runs on port 3000 by default. Set PORT environment variable to change it.
Production-ready Docker setup with multi-stage build, health checks, and persistent SQLite database.
# Build and run in background
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop the application
docker-compose down
# Stop and remove volumes (WARNING: deletes all data)
docker-compose down -vApp URL: http://localhost:3000 (or http://<your-host>:3000 if on a remote server).
# Build the image
docker build -t learning-platform:latest .
# Run the container with persistent database
docker run -d \
-p 3000:3000 \
-v learning-platform-data:/app/data \
--name learning-platform \
learning-platform:latest
# View logs
docker logs -f learning-platform
# Stop and remove
docker stop learning-platform
docker rm learning-platformControl the listening address and port via environment variables in docker-compose.yml:
# Use default (0.0.0.0:3000 - all interfaces)
docker-compose up -d --build
# Use specific port
PORT=8080 docker-compose up -d --build
# Use specific host and port
HOST=192.168.1.100 PORT=8080 docker-compose up -d --buildThe container listens on all interfaces (0.0.0.0) by default. Environment variables:
HOST— host interface (default0.0.0.0)PORT— port number (default3000)NODE_ENV=production— hard-coded in production builds
Multi-stage Docker build (3 stages):
- **builder: Installs build deps, compiles Next.js app, compiles
better-sqlite3(~500MB, discarded) - **db-init: Preserves database schema and dependencies (~200MB, discarded)
- **runner: Minimal Alpine base with production artifacts only (~350MB, final image)
Key features:
- Non-root user (
nextjs:1001) for security dumb-initfor proper signal handling (SIGTERM/SIGINT)scripts/seed.jsinitializes SQLite schema on container startup- SQLite WAL mode for better concurrency
- Health check runs every 30 seconds
Location in container: /app/data/learning-platform.db
Backup / restore:
# Backup the database
docker cp learning-platform:/app/data/learning-platform.db ./backup.db
# Restore the database
docker cp ./backup.db learning-platform:/app/data/learning-platform.db
docker restart learning-platformReset database (destructive):
docker-compose down -v
docker-compose up -d --buildContainer won't start:
# Check logs
docker-compose logs --tail=100 learning-platform
# If database is locked or corrupted, remove the volume
docker-compose down
docker volume rm learning-platform_learning-platform-data
docker-compose up -d --buildInspect database:
docker cp $(docker-compose ps -q learning-platform):/app/data/learning-platform.db ./backup.db
sqlite3 backup.db ".schema"Permission errors:
docker exec -it learning-platform sh
chown -R nextjs:nodejs /app/datasrc/app/: Next.js App Router pages and API routes with automatic file-based routingsrc/components/: Reusable React components organized by functional domainsrc/lib/: Core business logic: exercises, validators, database, utilities, and hooksscripts/: Helper scripts for database setup and server initialization
MIT



