Skip to content

About

Local-first cloud application playground with Kafka, RabbitMQ, Postgres, AWS emulation, Kubernetes, GitOps, and OpenTelemetry. Build locally, then validate briefly on real AWS through an explicit, short-lived Terraform workflow.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

my-local-platform

CI License

A local-first platform built primarily for day-to-day development and fast testing on a laptop. Docker Compose provides Kafka, RabbitMQ, Postgres, an AWS-compatible API, and an OpenTelemetry stack. A dedicated minikube profile adds the GitOps path.

Live AWS is reserved for brief validation runs when local evidence cannot answer an AWS-specific question. A guarded, short-lived Terraform workflow handles that path. Every hourly resource is disabled by default and needs an explicit owner decision before creation. relay, a webhook delivery service, is the reference application across Compose, minikube, and live AWS.

Table of contents

Quick start

The Compose path needs Docker with the Compose plugin, Go 1.27 or newer, Python 3, and GNU Make. Start Docker first, then run:

make up
make smoke

make up builds the local applications, starts every Compose profile, and seeds the local AWS-compatible resources, Kafka topics, and relay database. make smoke writes and reads back through S3, SNS to SQS, SES, Kafka, RabbitMQ, Postgres, and relay. These commands need no AWS account or credentials. A passing run ends with:

all components healthy

The defaults load from .env.example. Copy it to the ignored .env file only when you need local overrides:

cp .env.example .env

Run make urls to print service addresses. See Starting and stopping for pausing, resuming, and tearing down.

Host capacity: Kubernetes is the resource-bound path. On 2026-09-08, the current development host was a MacBook Air (Mac16,12, Apple M4, 10 cores, 16 GB, arm64) running macOS 26.6.2, with Docker assigned 10 CPUs and about 8 GB. A minimum host has not been measured. The historical estimate for the four Compose infrastructure profiles is about 1.6 GB under sustained load; the complete stack, with the application containers, has no recorded measurement. The Kubernetes test used a 4 CPU, 6 GiB minikube node; the same workload failed with 3 GiB. See the memory breakdown and evidence limits.

Starting and stopping

Compose and Kubernetes stop and start independently. Pausing keeps the containers and their volumes. Tearing down removes the containers; make clean also deletes the Compose data volumes.

Goal Command
Start the Compose stack make up, or a subset — see Profiles
Pause it, keeping containers and data docker compose ... stop — full command below
Resume it docker compose ... start with the profiles you want running
Remove the containers, keep the volumes make down
Remove the containers and delete the Compose data volumes make clean
Pause the local cluster, keeping its state make k8s-down
Resume an existing v1.35.1 cluster at that version make k8s-up MINIKUBE_K8S_VERSION=v1.35.1

make k8s-up defaults to v1.36.5 and upgrades an older profile in place. For a resume without a version change, set MINIKUBE_K8S_VERSION to that profile's installed version. See the local version guidance before upgrading or creating a separate profile.

Choose shutdown profiles to cover every service you want stopped. On resume, choose only the profiles you want running; the selections can differ. start starts every existing container in its selection, even ones you previously stopped on purpose.

The example below stops core, messaging and obs; include tools or apps if you also want those services stopped. .env is optional and gitignored, so the env file is resolved the way the Makefile resolves it:

env_file=$([ -f .env ] && echo .env || echo .env.example)
docker compose --env-file "$env_file" -f local/docker-compose.yml \
  --profile core --profile messaging --profile obs stop

Pause is the cheap path: stop leaves the containers in place, so resuming needs no rebuild or re-seed, and Kafka offsets, Postgres rows, Prometheus storage and Grafana storage survive on their volumes. make down is heavier — it removes the containers, so the next make up rebuilds from source and re-seeds.

Three things to know before you pause:

  • Process memory does not survive. The sink holds its retained deliveries, counters and its latency and fail-rate controls in memory only, so a pause discards them. The cluster's Grafana and ArgoCD port-forwards (make monitoring-ui and make argocd-ui) have to be started again too.
  • Order matters across the two stacks. The cluster's relay workloads and the KEDA scaler both reach Kafka in Compose, so delivery and lag collection stop without it: make k8s-down → stop, then start → make k8s-up.
  • make up is not always the right way back. It starts every profile including apps, whose relay-deliver joins the same Kafka consumer group as the cluster's delivery consumers. If you were running the cluster workloads, resume with start and a selection that leaves apps out. See do not run the compose apps and the cluster apps together.

Full detail, including which profile costs what, is in the local runbook under Pausing and Resetting.

What runs here

Area Local path AWS path
AWS APIs floci for S3, SNS, SQS, SES, and related APIs S3, SNS, SQS, ECR, optional SES, RDS, and EKS
Streaming Apache Kafka in KRaft mode MSK Serverless with IAM for the live relay proof
Messaging RabbitMQ Amazon MQ is outside the current Terraform scope
Database Postgres 18 RDS for PostgreSQL, opt-in
Kubernetes dedicated mlp minikube profile EKS, opt-in
Deployment ArgoCD app-of-apps the same project boundaries with ECR image digests
Telemetry OpenTelemetry Collector, Prometheus, Tempo, Grafana, and optional Datadog export OpenTelemetry Collector, Prometheus, Tempo, and Grafana

Compose and minikube run without an AWS account. Real credentials and costs begin under infra/terraform/.

Compose profiles and their commands
Command Starts
make up-core floci and Postgres
make up-messaging Kafka and RabbitMQ
make up-tools Kafka UI plus the messaging profile
make up-obs OpenTelemetry Collector, Prometheus, Tempo, and Grafana
make up-apps relay and its test sink, plus core and messaging
make up every profile

The local runbook has ports, credentials, tracing, profile measurements, and troubleshooting.

System diagram

Local platform architecture showing Compose services, the minikube GitOps workloads, ArgoCD, KEDA, and both observability stacks

Open the image for the full-size diagram. Colors distinguish applications, data services, telemetry, and deployment controls; arrows label each operation. Minikube shares Compose's Kafka, Postgres, and OpenTelemetry Collector through host.minikube.internal, and runs its own Prometheus and Grafana.

The editable draw.io source records the configured local topology from Compose, the Kubernetes manifests, and the monitoring values. Open it in draw.io to edit; export as SVG with a light background and update the image alongside it.

Relay

relay accepts tenant events, records their history in Postgres, writes them to Kafka, and delivers signed webhooks through a consumer group. It supports idempotent ingest, ordered delivery per tenant, bounded retries, dead letters, replay, metrics, and KEDA scaling from broker lag.

Run the application path without the observability profile:

make up-apps
make seed
make smoke

M0 through M3 and the locally testable M4 implementation are complete, including the one-shot runtime bootstrap packaged in issue #136. The live EKS, RDS, and MSK proof remains unverified and separately authorized. Cheap-tier staging completed on 2026-09-20 in issue #96, closed by PR #148. Issue #97 remains open. Its approved 2026-09-22 attempt failed before workload deployment because the EKS network add-on was missing. The attempt record tracks cleanup, the local repair and the qualification required before another paid run. See the staging record for the completed qualification and staged runtime source 474dca7.

The relay goal states the behavior and limits. The relay roadmap records the milestone sequence and its evidence.

Kubernetes and GitOps

Local Kubernetes uses the minikube profile mlp, which keeps it separate from other contexts. ArgoCD's root application can create child applications in argocd; workload applications can deploy only into the mlp namespace. The built-in default project has no deployment permissions.

Start the local GitOps path

This path also needs minikube, kubectl, and Helm:

make k8s-up
make echo-image
make argocd-install
make k8s-status

ArgoCD reads committed manifests from a git remote. A fork must supply its own URL with REPO_URL; a private fork also needs the read-only deploy-key setup. The Kubernetes runbook covers both cases, image loading, KEDA, monitoring, and the relay demo.

Real AWS

Use live AWS for brief, focused validation after the local checks pass. The M4 controller starts destroy at 2 hours 30 minutes and treats cleanup beyond 3 hours as a failed deadline. It keeps destroying if AWS cleanup runs long. make aws-live-run owns that clock, stays in the foreground, and enters cleanup after success, failure, interruption, or the destroy deadline. If Terraform is still applying at that deadline, the controller interrupts it before cleanup. If it cannot confirm that the apply processes have exited, it records blocked cleanup and starts no destroy; resources may keep charging until the owner completes the runbook's manual recovery.

The AWS path needs Terraform 1.10 or newer, AWS CLI v2, jq, Go 1.27 or newer, Python 3, and an AWS SSO session. The default Terraform tier contains usage-priced resources with near-zero idle cost. enable_rds, enable_eks, and enable_msk default to false because they create hourly charges.

Read the cost and teardown guide first. The AWS relay runbook owns the identity checks, guarded plan, separate authorization gates, evidence capture, abort path, and final resource audit. No real-AWS command is part of the local quick start.

The live controller uses macOS caffeinate when available. Mac model, CPU, and memory do not control the AWS duration; host availability does. Keep the Mac powered, awake, open, and online until make aws-live-status reports verified cleanup. A local controller cannot act through a power, network, or credential failure.

Terraform scope and safety boundary
  • The cheap tier contains S3, SNS, SQS, 2 ECR repositories, and optional SES.
  • A separate persistent stack owns the $5 monthly AWS Budget filtered to Project=my-local-platform, excluding tax. Dev cleanup cannot delete the alert.
  • The live relay proof adds EKS, RDS, and MSK Serverless only when their flags are enabled.
  • make aws-plan saves an exact plan and a redaction-safe summary.
  • An hourly make aws-up refuses to run outside make aws-live-run.
  • make aws-runtime-bootstrap requires that live controller, verifies the EKS context, and runs the idempotent MSK and RDS setup before workloads start.
  • make aws-down destroys the dev stack. The versioned remote-state bucket is a separate bootstrap resource; the state bucket and cost alert survive by design.

Project documentation

Need Document
Validate an application or a shared-stack change Application validation
Run or troubleshoot Compose Local runbook
Run minikube and ArgoCD Kubernetes runbook
Prepare the M4 AWS session AWS relay runbook
Understand AWS costs and teardown Cost guide
Read the relay contract and sequence Goal and roadmap
Inspect local and CI checks Repository file checks
Follow repository rules AGENTS.md

GitHub Issues and milestones hold the active backlog. The open issues are the current work queue.

Design and evidence

Each architecture decision records its verification evidence.

Architecture decision index
Decision Status
Local-first with ephemeral AWS Accepted
floci over LocalStack Accepted
OpenTelemetry-first observability Accepted
Real Kafka for local development Accepted
ArgoCD for GitOps Accepted
Kafka for relay delivery Accepted
KEDA scaling from consumer lag Accepted
In-cluster observability for the demo Accepted
Separate ArgoCD control and workload permissions Accepted
Live AWS relay validation contract Accepted

Development

Run the checks that cover your change:

make test          # race-enabled tests across 6 Go modules, then Python tests
make lint          # source, docs, infrastructure, security, and secret checks
make k8s-validate  # manifest tests and schema validation; no cluster or AWS

make k8s-validate needs Docker, Helm, and kubectl. Its first run downloads pinned validation inputs. make smoke is the local round-trip gate and needs the Compose stack running. CI runs the same core checks for pull requests; its full job inventory is in Repository file checks.

Path Contents
local/ Compose stack, profiles, configuration, and seed scripts
services/ smoke checks, echo, relay, and the test sink
k8s/ ArgoCD projects, application registrations, overlays, and validation
infra/terraform/ account bootstrap, persistent guardrails, and the guarded dev stack
docs/ runbooks, goal and roadmap documents, ADRs, and evidence
Add another application
  1. Put its code in services/<name>/.
  2. Add its local runtime and dependencies to local/docker-compose.yml.
  3. Add repeatable setup under local/bootstrap/.
  4. Put Kubernetes resources in k8s/manifests/<name>/ and register an ArgoCD Application in k8s/apps/.
  5. Add a smoke check that writes data, reads it back, and asserts the result.
  6. Add Terraform only for behavior that needs a live AWS check.

Each new application needs a bounded local rehearsal of its own behavior. Use the application validation guide to choose the checks, reuse existing platform evidence, and decide whether an AWS cheap-tier check or a staged hourly session is needed. An existing automated end-to-end check can satisfy the local rehearsal when it covers the agreed path and its dated result is recorded.

License

Licensed under the Apache License 2.0.

About

Local-first cloud application playground with Kafka, RabbitMQ, Postgres, AWS emulation, Kubernetes, GitOps, and OpenTelemetry. Build locally, then validate briefly on real AWS through an explicit, short-lived Terraform workflow.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages