{"repo":"msanvarov/gin-rest-postgres-boilerplate","free":true,"listed":false,"github":"https://github.com/msanvarov/gin-rest-postgres-boilerplate","clone":"git clone https://github.com/msanvarov/gin-rest-postgres-boilerplate.git","description":"backend with gin (golang web framework), redis, postgres, rbac, and authentication","language":"Go","stars":33,"topics":["redis","gin","docker","golang","rest-api","go","dep","postgres","postgresql"],"license":"MIT","category":"databases-storage","readme_excerpt":"gin-rest-postgres-boilerplate A production-leaning Go REST API template built around [Gin], the modern [ jackc/pgx ][pgx] Postgres driver, Redis-backed sessions, and Casbin RBAC. The boilerplate is intentionally small but exercises the practices you would expect on a real service: standard cmd/ + internal/ layout, structured logging via log/slog , graceful shutdown on SIGINT / SIGTERM , dependency injection through plain constructors, embedded SQL migrations applied on boot, and a generic worker pool that shows how to fan request work out across goroutines. [Gin]: https://github.com/gin-gonic/gin [pgx]: https://github.com/jackc/pgx Highlights - Standard project layout ( cmd/server , internal/... ). - Go modules, Go 1.22, [ log/slog ] for structured logs. - Postgres via [ pgx/v5 ][pgx] connection pool; small typed repository over a users table. - Embedded .up.sql migrations applied transactionally on startup ( schema migrations bookkeeping table). - Redis-backed sessions via gin-contrib/sessions . - Casbin v2 RBAC middleware driven by model.conf + policy.csv . - Bounded worker pool ( internal/worker ) with context cancellation, panic-safe execution, mutex-guarded close, and a race-tested suite. - Bulk-lookup endpoint demonstrates fan-out / fan-in over the pool with a per-request timeout and atomic counters. - Graceful HTTP shutdown driven by signal.NotifyContext . - Multi-stage Dockerfile (distroless nonroot), Docker Compose for local dependencies, GitHub Actions CI, golangci-","default_branch":null,"files":null,"tree":[],"storefront":"/r/msanvarov","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/msanvarov/gin-rest-postgres-boilerplate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}