A curated collection of example projects demonstrating how to build production-style services with the Keel framework and the Keel CLI.
Each example is small, focused, and self-contained — you can run any of them independently in under a minute.
Keel is a modular Go framework for building web services. It provides:
- Structured modules, controllers, and services
- Built-in health checks, request logging, and OpenAPI docs
- Composable middleware and guards
- Scheduler, event bus, and tracing hooks
- First-class validation via struct tags
If you are new to Keel, work through the examples in order:
| Step | Example | Concept |
|---|---|---|
| 1 | 01-hello-world | Bootstrap a Keel app and define a route |
| 2 | 02-config-env | Load configuration from environment variables |
| 3 | 03-health-check | Add custom health checkers |
| 4 | 04-rest-crud | Build a complete CRUD REST service |
| 5 | 05-validation | Validate request bodies with struct tags |
| 6 | 06-middleware | Write and apply custom middleware |
| 7 | 07-jwt-auth | Protect routes with JWT authentication |
| 8 | 08-gorm-postgres | Persist data with GORM and PostgreSQL |
| 9 | 09-scheduler-cron | Schedule background jobs with cron |
| 10 | 10-addon-example | Integrate a Keel addon |
Minimal Keel app with a single GET /hello route. The starting point for every Keel service.
Structured configuration loader using environment variables with typed defaults.
Built-in /health endpoint plus a custom HealthChecker that inspects an in-memory dependency.
Full CRUD for a Task resource: list, get, create, update, and delete — all in-memory, no database required.
Shows how Keel uses validate struct tags together with ctx.ParseBody() to return structured 422 errors automatically.
Custom request middleware: correlation ID injection, response timing header, and a simple IP blocklist.
JWT-based authentication guard. Issues tokens on POST /auth/login and protects routes with a reusable middleware.
Database-backed CRUD using ss-keel-gorm with migrations, a repository pattern, and connection health checks.
Register recurring background jobs with the Keel scheduler. Includes a simple in-memory job that runs on a configurable cron expression.
Demonstrates how to consume a Keel addon installed via the Keel CLI (keel add).
Each example is an independent Go module. To run any example:
# 1. Enter the example directory
cd examples/01-hello-world
# 2. Copy the environment file
cp .env.example .env
# 3. Download dependencies
go mod download
# 4. Run the service
go run main.goThe server starts on port 7331 by default.
Open the interactive API docs at http://localhost:7331/docs.
Note: Some examples (08-gorm-postgres) require Docker. See the example README for details.
ss-keel-examples/
├── examples/ # One subdirectory per example
│ ├── 01-hello-world/
│ ├── 02-config-env/
│ └── ...
├── shared/
│ ├── docker/ # Shared Docker Compose files for dependencies
│ └── scripts/ # Helper shell scripts
└── docs/
├── learning-path.md
└── example-matrix.md
| Project | Description |
|---|---|
| ss-keel-core | The Keel framework |
| ss-keel-cli | CLI for scaffolding Keel projects |
| ss-keel-docs | Official documentation |
| ss-keel-addon-template | Template for creating Keel addons |
Examples that fix bugs, improve clarity, or add new concepts are welcome. Please open an issue first to discuss the change.
MIT — SliceSoft