Stacktora / Templates / Event streaming (NATS)
Streaming

Event streaming (NATS) boilerplate

Go service with Postgres and NATS JetStream for messaging + worker. One click generates a complete, runnable bootstrap — docker-compose, Makefile, Dockerfile, CI and more.

Use this template Browse all templates

The stack

Go 1.26 PostgreSQL 5432 NATS 4222 Background worker

docker-compose.yml preview

# docker-compose.yml — generated by Stacktora
services:
  server:
    image: golang:1.26-alpine
    command: go run ./cmd/server
    ports:
      - "8080:8080"
    env_file: [ .env ]
  postgres:
    image: postgres:18-alpine
    ports:
      - "5432:5432"
  nats:
    image: nats:2.14-alpine
    ports:
      - "4222:4222"
      - "8222:8222"

What you get

docker-compose.ymlMakefileDockerfileREADME.md.env.example.gitignore.dockerignore.github/workflows/ci.yml.tool-versions.editorconfigProcfile … and more

Quickstart

# clone, then one command to a running stack
git clone … && cd server
$ make setup   # install toolchain + deps, build images
$ make dev     # boot the full stack
# → server live at localhost:8080

Related templates

Open Event streaming (NATS) in Stacktora