Lab 15: Capstone — Production Platform

Time: 60 minutes | Level: Architect | Docker: golang:1.22-alpine

Overview

Production Go platform integrating all architect patterns: GMP scheduler tuning, generic repository + event bus, event sourcing (EventStore), CQRS CommandBus (3 middleware), mTLS, OpenTelemetry traces + Prometheus metrics, chacha20poly1305 + ed25519 security, actor system, table-driven tests (10+), and versioned build output.


Step 1: Project Structure

go-architect-platform/
├── cmd/
│   └── server/main.go          # Entry point + build version injection
├── internal/
│   ├── platform/
│   │   ├── repository/         # Generic Repository[T, ID]
│   │   ├── eventstore/         # Event sourcing + optimistic concurrency
│   │   ├── cqrs/               # CommandBus + QueryBus + Middleware
│   │   ├── actor/              # ActorSystem + supervision
│   │   └── resilience/         # Circuit breaker + bulkhead + retry
│   ├── security/
│   │   ├── crypto.go           # chacha20poly1305 + argon2
│   │   └── tokens.go           # Ed25519 + HMAC-SHA512
│   ├── observability/
│   │   ├── tracing.go          # OpenTelemetry SDK
│   │   └── metrics.go          # Prometheus counters/histograms
│   └── domain/
│       ├── user/               # User aggregate + commands + queries
│       └── order/              # Order aggregate + event sourcing
├── go.mod
└── go.sum

Step 2: GMP Scheduler Tuning


Step 3: Generic Repository + EventBus


Step 4: Event Sourcing


Step 5: CQRS CommandBus — 3 Middleware


Step 6: Security Layer


Step 7: Table-Driven Tests


Step 8: Capstone Integration Demo

📸 Verified Output:


Patterns Integration Summary

Lab
Pattern
This Capstone

01

GMP scheduler

GOMAXPROCS + MemStats

02

CGO interop

Platform concept

03

Generics

Repository[T,ID] + EventBus[T]

04

OpenTelemetry

Tracing middleware pattern

05

mTLS

Service mesh pattern

06

Event sourcing

EventStore + Append-only

07

CQRS

CommandBus + 3 middleware

08

Actor model

CounterActor + goroutine

09

k8s operator

Reconciler pattern

10

WASM

Build target concept

11

Security

Ed25519 sign/verify

12

Performance

Zero-alloc + sync.Pool

13

Plugins

Interface registry pattern

14

Chaos

Circuit breaker + retry

15

Capstone

All patterns integrated

Production Checklist

Last updated