Copy-Paste Go Backend Modules

Explicit dependencies, security-first, AI-friendly. Copy production-ready code into your project and own every line of it.

  • Code ownership
  • Security-first
  • AI-friendly

Modules

Every module ships as standalone, standard-library-first Go code. Copy what you need, adapt the config, and ship.

  • JWT

    Auth

    JWT authentication with bcrypt, rate limiting, and user enumeration prevention.

  • Generic

    CRUD

    Generic CRUD operations with pagination, sort/filter whitelist, SQL injection prevention.

  • SQL

    Database

    database/sql setup, transactions, and whitelisted query fragments.

  • HTTP

    Middleware

    Recovery, CORS, logging, timeout, request ID, body size limit.

  • Access

    RBAC

    Role-based access control with wildcard permissions and hierarchy inheritance.

  • Throttle

    Rate Limit

    Fixed window, sliding window, and token bucket algorithms with LRU eviction.

  • Input

    Validation

    Chainable request validation with regex DoS prevention and panic recovery.

  • Storage

    File Upload

    Secure file upload with magic bytes validation and path traversal prevention.

  • Probes

    Health

    Liveness/readiness probes with SSRF protection.

  • Memory

    Cache

    Generic TTL + LRU in-memory cache with background cleanup.

  • Cursor

    Pagination

    Offset/limit and cursor pagination with base64 validation.

  • SMTP

    Mail

    SMTP email with templates, header injection prevention, and async queue.

  • SQL

    Migrations

    SQL migration runner with checksums, transactions, and safe file validation.

  • Prometheus

    Metrics

    Prometheus HTTP metrics with route cardinality limits and label sanitization.

  • RFC 9457

    Problem Details

    RFC 9457 API error responses with panic recovery and safe details.

Quick Start

Install the CLI, list the registry, and graft a module straight into your project. Scion copies source files and writes .scion-module.json metadata for later comparison — it never edits your go.mod automatically.

  1. 1Install the scion CLI with go install
  2. 2Browse modules with scion list and scion info
  3. 3Copy a module in with scion add (use --dry-run to preview)
  4. 4Own the code — Scion never touches your go.mod
bash
# Install the CLI (Go 1.22+)go install github.com/DarkInno/scion/cmd/scion@latest # Browse available modulesscion listscion info auth # Preview, then copy a module into your projectscion add cache --dry-runscion add cache # Compare local copy against the upstream templatescion diff cache

Why Copy-Paste?

Backend modules share 80% of their skeleton across projects. Instead of installing a framework, copy pre-built, production-ready modules and own every line of code.

Code ownership

Every line is yours after copying. No black-box framework.

Explicit dependencies

Standard library by default; security exceptions are declared.

Security-first

Input validation, rate limiting, injection prevention built in.

AI-friendly

__llms__.md files let AI assistants understand modules quickly.