Skip to main content

Examples

Runnable Rank programs organized by theme. Each example lives in the examples/ directory of the repository.

Use this page when you want runnable reference programs for typed configuration, provider-backed reads and writes, external inputs, manifests, and HTTP workflows.

If you want the fastest language tour, start with Hello Config, then Functions and Lifting, then Pipes and Collections, and then Env Inputs.

Language features

ExampleWhat it shows
Hello ConfigType aliases, literal unions, @constraint, with, pub main
Types and GenericsType aliases, constrained/defaulted generics, utility types, field annotations, match exhaustiveness
Functions and LiftingNamed functions, object lifting, zipped list lifting, with patch
Pipes and Collectionsmap, filter, reduce, groupBy, sortBy, pipe operator `

Platform manifests and CI/CD

ExampleWhat it shows
Kubernetes AppOne typed app definition emitting Deployment, Service, ConfigMap, Ingress, and HPA YAML
Service CatalogOne typed service list emitting service summary, CI matrix, public endpoints, Compose, and deployment metadata
Static Site Deploy PlanTyped pages and redirects emitting upload metadata, redirect rules, and deploy planning artifacts
Docker ComposeTyped service definitions, Env inputs, dev/prod overrides, Emit::manifest(...)
GitHub ActionsWorkflow YAML generation, lifting over a node version matrix, Emit::manifest(...)
GitLab CIPipeline YAML, reusable job templates as functions, rule-based conditions

Data generation and multi-environment

ExampleWhat it shows
Test FixturesFaker provider, range + map to generate N records, deterministic seeds
Faker DatasetCorrelated Person/Location projections, all generator kinds, refDate anchoring
Multi-env AppEnv input, base + environment-specific with overrides, multi-file modules
Feature Flag MatrixTyped environment and plan combinations emitting a matrix plus per-plan flag bundles
Tenant Config GeneratorOne tenant list emitting per-tenant runtime configs and a shared tenant index

External data sources

ExampleWhat it shows
Env Inputsstd::Env typed schema, field-level @sensitive, Decode<T> at the env boundary, defaults, with
Dotenv ConfigFile::Read with format: dotenv, boundary Decode<T>, typed defaults, and explicit file provenance
File-driven ConfigFile::Read YAML loading, typed schema, reshaping with stdlib
HTTP FetchHTTP::Fetch with cacheKey, typed response schema, transform to manifest
HTTP Plus Files BundleCombine a local YAML file and an HTTP fetch into one bundled JSON and YAML output
Secrets-Backed Configaws::SecretsManager::Secret<T>, RANK_ENV, base + secret merge, LocalStack-backed provider flow
LocalStack BootstrapMutation::plan, aws::DynamoDB::Put, aws::S3::Put, and LocalStack-backed resource seeding
DynamoDB ReportTyped DynamoDB item reads, collection reductions, and a static JSON report artifact
Provider ComparisonNormalize environment, file, HTTP, and S3 inputs into one shared output schema

HTTP server

ExampleWhat it shows
S3 Logsrank serve, aws::S3::Object<T>, parse string patterns, LocalStack-backed log inspection
Serve — Dockerrank serve, HTTP::Route, pub config, containerized deployment
Serve — LambdaLambda Web Adapter, READINESS_CHECK_PATH, same app code locally and on Lambda