Skip to content
@sca-templates

sca-templates

A multi-platform ecosystem spanning client, server, architecture and self-hosted infrastructure. Vault-sealed secrets, loopback-only networking.

sca-templates

A multi-platform ecosystem spanning client, server, architecture and self-hosted infrastructure. Vault-sealed secrets, loopback-only networking, and one repo per concern.


What is this?

A batteries-included platform for building and running production-ready services:

  • Infrastructure (infra-* repos) — Docker Compose stacks for Vault, Postgres, Redis, Kafka, Consul, Prometheus, Grafana and Kong, all wired together on a shared kafka-network and bound to loopback only.
  • Microservices (nest-* repos) — Domain services built with NestJS/TypeScript and wired into the infrastructure.
  • Shared packages (@sca/*) — Zero-logic plumbing libraries (core, contracts, connections, clients) consumed by every microservice.
  • Documentation (sca-docs) — The Obsidian knowledge base that maps the entire ecosystem; topology lives here, depth lives in each repo.
  • Dev tools (local-dev-tools) — MinIO (S3) and MailHog (SMTP) for local use.

Every service follows the same pattern: own folder, own Makefile, own compose.yml, secrets from Vault via AppRole, .env generated at runtime, loopback-only ports, Consul health checks, and Prometheus scrape targets.


Naming conventions

CategoryConventionExamples
Infrastructureinfra-*infra-vault, infra-prometheus
Microservicesnest-*nest-auth, nest-notifications
Skeletonnest-templateClone this to create a new nest-* service
Shared packages@sca/*@sca/core, @sca/contracts
Documentationsca-docs
Dev toolslocal-dev-tools
Org config.github

Framework-first naming: the framework implies the platform (nest-* = backend API, react-* = frontend web, next-* = fullstack web, react-native-* = mobile).


Repository map

Infrastructure

RepoDescriptionTags
infra-vaultSecrets management with transit encryption, AppRole auth and Raft consensusvault, hashicorp, secrets, raft, approle
infra-postgres-appRelational database with vector extensions, admin UI and CDC sourcepostgres, pgvector, pgadmin, cdc, database
infra-redisIn-memory data store with persistence and password authenticationredis, cache, persistence, database
infra-kafkaEvent streaming platform with KRaft, connectors and schema registrykafka, kraft, streaming, cdc, event-driven
infra-consulService discovery with health checks and gossip-based clusteringconsul, service-discovery, health-checks, networking
infra-prometheusMetrics collection, alerting rules and PromQL queryingprometheus, metrics, alerting, tsdb
infra-grafanaDashboard visualization, provisioned data sources and alertinggrafana, dashboards, visualization, monitoring
local-dev-toolsLocal development tools — S3-compatible storage and SMTP capturedev-tools, minio, mailhog, local-development

Microservices

RepoDescriptionTags
nest-templateNestJS service skeleton with gRPC, Kafka and Vault integrationnestjs, template, skeleton, typescript
nest-authAuthentication, authorization and access control serviceauth, authentication, authorization, rbac
nest-notificationsMulti-channel notification delivery — push, email and SMSnotifications, push, email, sms
nest-loggingAudit trail and structured logging servicelogging, audit, structured-logging
py-aiAI/ML integration service with vector storageai, ml, integrations, vector

Shared packages

PackageDescriptionTags
@sca/coreUtilities, decorators and error handlingcore, utilities, decorators, error-handling
@sca/contractsgRPC and Kafka event definitionscontracts, grpc, kafka-events, schemas
@sca/connectionsDatabase, cache and message broker connectionsconnections, database, cache, broker
@sca/clientsService-to-service client wrappersclients, service-to-service, wrappers

Documentation

RepoDescriptionTags
sca-docsObsidian knowledge base — topology, contracts, ADRs and glossarydocs, obsidian, knowledge-base, architecture

Architecture

flowchart LR
subgraph Secrets
V[Vault]
end
subgraph Data
PG[(Postgres)]
RD[(Redis)]
end
subgraph Streaming
K[Kafka]
KC[Kafka Connect]
UI[Kafka UI]
end
subgraph Gateway
KO[Kong]
end
subgraph Discovery
CO[Consul]
end
subgraph Observability
P[Prometheus]
G[Grafana]
end
subgraph Dev
MI[MinIO]
MH[MailHog]
end
subgraph Services
AUTH[nest-auth]
NOTI[nest-notifications]
LOG[nest-logging]
AI[py-ai]
end
V -.->|secrets| PG
V -.->|secrets| RD
V -.->|secrets| K
V -.->|secrets| KO
K -->|CDC| KC
KC -->|captures| PG
KO -->|routes| AUTH
KO -->|routes| NOTI
KO -->|routes| LOG
KO -->|routes| AI
CO -.->|discovers| K
CO -.->|discovers| PG
CO -.->|discovers| RD
CO -.->|discovers| KO
P -->|scrapes| V
P -->|scrapes| PG
P -->|scrapes| RD
P -->|scrapes| KC
G -->|queries| P
AUTH -->|reads| RD
AUTH -->|writes| PG
NOTI -->|sends| MH
AI -->|stores| MI
Loading

Quick start

git clone https://github.com/sca-templates/infra-vault.git
cd infra-vault && make dev
git clone https://github.com/sca-templates/infra-postgres-app.git
cd infra-postgres-app && make all
git clone https://github.com/sca-templates/infra-redis.git
cd infra-redis && make all
git clone https://github.com/sca-templates/infra-kafka.git
cd infra-kafka && make all
git clone https://github.com/sca-templates/infra-consul.git
cd infra-consul && make all

Conventions

RuleDetail
One fact, one placeTopology in sca-docs, depth in each repo, READMEs point — never duplicate
English alwaysCode, commits, PRs, docs
Loopback onlyEvery port binds to 127.0.0.1; nothing exposed on LAN
Vault-seeded.env generated by make env from Vault; never commit .env or secrets
Idempotent makesmake all can be run repeatedly without side effects
Consul-registeredEvery service is in consul/scripts/services.txt with a TCP health check
Prometheus-scrapedExporters feed the central TSDB; dashboards render in Grafana
Docs-as-codeEvery change lands through a PR with review

Contributing

  1. Fork and branch off main.
  2. Follow the conventions above (Makefile targets, Vault secrets, loopback).
  3. Run make validate in your service.
  4. Open a PR and fill the checklist.

See CONTRIBUTING.md for the full definition of done.


License

MIT © sca-templates

Pinned Loading

  1. .github.githubPublic

    A multi-platform ecosystem spanning client, server, architecture and self-hosted infrastructure. Vault-sealed secrets, loopback-only networking, and one repo per concern.

  2. sca-docssca-docsPublic

    Obsidian knowledge base — topology, contracts, ADRs and glossary

Repositories

Showing 9 of 9 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…