No description
  • Scheme 91.2%
  • HCL 6.3%
  • Dockerfile 2%
  • NewLisp 0.5%
Find a file
Rolando Abarca eeb0c6f300 Switch d-scheduler and d-worker to logger egg
Replace all print-based logging with logger (d/i/w/e) for consistent
formatting, timestamps, and per-module level control. Remove ds/debug
parameter in favor of logger/set-module-level!. Add sample recurring
heartbeat job.
2026-04-04 12:01:37 -07:00
.claude Move all development into Docker — no local CHICKEN install needed 2026-03-24 19:45:16 -07:00
assets Add production deployment infrastructure 2026-02-24 08:10:01 -08:00
ops Add production deployment infrastructure 2026-02-24 08:10:01 -08:00
tests Convert route files to proper modules for build dependency resolution 2026-03-24 17:08:31 -07:00
.gitignore Migrate build system to kdp-build 2026-03-23 12:09:34 -07:00
api.routes.scm Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
app.scm fix the template 2026-02-19 19:19:33 -08:00
aws.scm Sync aws.scm improvements from other projects 2026-03-23 10:00:05 -07:00
build.lsp Migrate build system to kdp-build 2026-03-23 12:09:34 -07:00
build.worker.lsp Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
Caddyfile Add production deployment infrastructure 2026-02-24 08:10:01 -08:00
CLAUDE.md Move all development into Docker — no local CHICKEN install needed 2026-03-24 19:45:16 -07:00
d-scheduler.routes.scm Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
d-scheduler.scm Switch d-scheduler and d-worker to logger egg 2026-04-04 12:01:37 -07:00
d-worker.scm Switch d-scheduler and d-worker to logger egg 2026-04-04 12:01:37 -07:00
docker-compose.prod.yml Add production deployment infrastructure 2026-02-24 08:10:01 -08:00
docker-compose.yml Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
Dockerfile Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
dotenv.scm Replace project-specific references with generic names 2026-02-24 08:28:26 -08:00
DSCHEDULER.md Switch d-scheduler and d-worker to logger egg 2026-04-04 12:01:37 -07:00
landing.routes.scm Convert route files to proper modules for build dependency resolution 2026-03-24 17:08:31 -07:00
landing.views.scm Add horizontal scaling support to d-scheduler 2026-04-04 11:02:32 -07:00
migrations.scm fix the template 2026-02-19 19:19:33 -08:00
models.scm first commit 2026-02-19 19:05:32 -08:00
oauth-google.scm first commit 2026-02-19 19:05:32 -08:00
ORM.md first commit 2026-02-19 19:05:32 -08:00
README.md Update README with dev environment docs and fix d-scheduler 2026-03-25 20:17:44 -07:00
routes.scm Convert route files to proper modules for build dependency resolution 2026-03-24 17:08:31 -07:00
sample.jobs.scm Switch d-scheduler and d-worker to logger egg 2026-04-04 12:01:37 -07:00
setup.defaults Migrate build system to kdp-build 2026-03-23 12:09:34 -07:00
sgconfig.yml Update ast-grep-scheme skill with setup docs and add sgconfig.yml 2026-03-23 11:03:30 -07:00
utils.scm Add read-json-body helper and JSON echo endpoint 2026-02-21 18:44:48 -08:00

Schematra Starter Kit

A starter kit for building web applications in CHICKEN Scheme using the Schematra web framework. Comes with an ORM (RQLite-backed), session management, OAuth, background job processing, HTMX integration, and production deployment infrastructure out of the box.

What's Included

  • Schematra web framework with routing, middleware, and session support
  • Chiccup templating (hiccup-style HTML in Scheme) with Tailwind CSS and HTMX
  • ORM with auto-generated CRUD operations backed by RQLite
  • OAuth authentication (Google, extensible to other providers)
  • Background worker with Redis-based job scheduling and Fibonacci retry backoff
  • AWS SDK — SES (email), SSM (parameter store), S3 (object storage), STS
  • Production deployment — Terraform configs for Linode + Cloudflare DNS + Caddy reverse proxy

Development Environment

The entire dev loop — compiler, dependencies, database, Redis — runs inside Docker. You edit source files on your host with whatever editor you prefer; everything else happens in containers.

Why Docker-only:

  • Zero local setup — no need to install CHICKEN Scheme, egg dependencies, or kdp-build on your machine. The dev image has everything.
  • Reproducible — every developer gets the exact same toolchain, no "works on my machine" issues.
  • Isolated infrastructure — RQLite and Redis run inside the compose network with no ports exposed to the host. Multiple Schematra projects can run simultaneously without port conflicts (use APP_PORT to pick different host ports).
  • Same base as production — the dev image is the same Dockerfile stage that production builds extend, so you're always building against the real thing.

Want to run outside Docker? The Dockerfile is the canonical reference for setting up CHICKEN, kdp-build, and all dependencies. Follow the base stage step by step to replicate the environment on your host.

Getting Started

If you have Claude Code installed, run this one-liner to download the skill and create a new project:

claude --allowedTools 'Bash(curl *)' 'Bash(git *)' 'Bash(mkdir *)' 'Write' \
  -p 'use curl to download the skill definition from https://forgejo.rolando.cl/cpm/schematra-starter-kit/raw/branch/main/.claude/skills/schematra-app/SKILL.md and run /schematra-app <my-project>'

This fetches the /schematra-app skill, clones the starter kit, and initializes a fresh git repo. Then follow the instructions to continue setup in the new project directory with /schematra-app continue, which walks you through installing dependencies, configuring services, and running the app.

Once your project is set up, use /schematra-deploy to configure production infrastructure.

Manual Setup

All development happens inside Docker — no local CHICKEN install needed.

# Clone and initialize
git clone https://forgejo.rolando.cl/cpm/schematra-starter-kit my-project
cd my-project
rm -rf .git && git init && git add -A && git commit -m "Initial commit"

# Create a .env file
cat > .env <<EOF
APP_URL=http://localhost:8080
EOF

# Build the dev image (installs CHICKEN, kdp-build, and all dependencies)
docker compose build dev

# Start dev container with RQLite and Redis
docker compose run --rm --service-ports dev

Inside the container:

kdp-build -j $(nproc)    # build modules
csi                       # start REPL

Inside the REPL:

,l app.scm

Visit http://localhost:8080 to confirm the app is running.

Development Workflow

After making changes, rebuild and reload:

kdp-build -j $(nproc)   # in a separate terminal/container
,l app.scm        ;; in the running REPL

To use a different host port (e.g. for multiple projects):

APP_PORT=9090 docker compose run --rm --service-ports dev

Project Structure

app.scm                 # Web application entry point
d-worker.scm            # Background worker entry point
d-scheduler.scm         # Redis-based job scheduler
routes.scm              # Main routes
*.routes.scm            # Feature-specific routes
*.views.scm             # View modules (Chiccup components)
models.scm              # Model definitions (auto-runs migrations)
migrations.scm          # Database schema migrations
dotenv.scm              # Environment variable loader
utils.scm               # Shared utilities
aws.scm                 # AWS SDK (SES, SSM, S3, STS)
assets/                 # Static assets (served at /assets)
ops/                    # Terraform deployment configs
build.lsp               # kdp-build spec (web)
build.worker.lsp        # kdp-build spec (worker)
CLAUDE.md               # Full API reference and coding patterns
ORM.md                  # ORM documentation

Documentation

  • CLAUDE.md — Complete API reference: routing, request handling, responses, views, middleware, sessions, authentication, coding patterns
  • ORM.md — Database model definitions, migrations, and query API
  • DSCHEDULER.md — Background job scheduler documentation

Prerequisites

  • Docker (everything runs inside Docker — no local CHICKEN install needed)