{"repo":"snykk/go-rest-boilerplate","free":true,"listed":false,"github":"https://github.com/snykk/go-rest-boilerplate","clone":"git clone https://github.com/snykk/go-rest-boilerplate.git","description":"A great starting point for building RESTful APIs in Go using Gin framework, and sqlx for connecting to a PostgreSQL database. The implementation follows Clean Architecture principles as described by Uncle Bob.","language":"Go","stars":154,"topics":["boilerplate","boilerplate-template","go-boilerplate","golang-template","rest-api","restful-api","go-rest-boilerplate","clean-architecture","clean-code","gin"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"go-rest-boilerplate A starting point for building RESTful APIs in Go using the Gin framework, sqlx for PostgreSQL, and Redis for caching. Implementation follows Clean Architecture principles as described by Uncle Bob. Features Core - Clean Architecture layering — handler → usecase → repository , no back-imports - Gin HTTP router with structured access log + request-ID middleware - PostgreSQL via sqlx, Ristretto + Redis two-tier caching - Graceful shutdown drains in-flight HTTP, mailer queue, DB, Redis, and tracer in order Authentication - JWT access tokens + refresh tokens (rotation on /auth/refresh , revocation on /auth/logout ) - HMAC signing-method check + kind claim guard against access/refresh confusion - bcrypt password hashing (configurable cost, default 12) - OTP-verified registration with brute-force lockout (configurable max attempts) - Login timing-attack mitigation (dummy bcrypt on user-not-found) Observability - Prometheus metrics: HTTP, cache (hit/miss/error per layer), mailer outcomes, DB pool stats - OpenTelemetry tracing — HTTP server spans, DB queries (otelsqlx), Redis commands (redisotel), mailer attempts - Structured request/audit logs (logrus) with X-Request-ID propagation - /health (liveness), /ready (DB + Redis probe), /metrics , /swagger Security - HSTS, CSP, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy headers - CORS origins from env (whitelist), wildcard only in dev - Per-IP rate limiting on auth endpoints - 1MB body size limit, conf","default_branch":null,"files":null,"tree":[],"storefront":"/r/snykk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/snykk/go-rest-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."}