go-boilerplate

Go REST API boilerplate with module-based architecture, testcontainers integration, JWT auth, Redis caching and comprehensive testing

goredisgolangpostgresboilerplatejwtrest-apipostgresqlmigrationtestifyzerolog

Preview

go-boilerplate preview

Overview

This Go boilerplate provides a production-ready foundation for building REST APIs with clean layered architecture. It includes JWT authentication, PostgreSQL database integration with GORM, Redis caching, structured logging with zerolog, comprehensive testing support and middleware for CORS, request logging and health checks.

Features

modular-architecturejwt-authenticationhealth-checksrequest-loggingredis-cachingunit-testingintegration-testingcors-middlewarerecovery-middlewarerequest-id-trackingstructured-loggingenvironment-configurationrequest-validationdatabase-migrations

Feature Flags

authenticationblogpaymentsauthorizationapiDocscachinghealthChecksloggingtestingdockerenvironmentConfigurationrequestValidationcorsmiddleware

Recommended Use Cases

rest-api-developmentmicroservicesbackend-servicesscalable-applications

Frontend

None

Backend

go

Auth Providers

jwt

Deployment Targets

docker

Payment Providers

None

Quick Facts

โญ Stars
44
๐Ÿด Forks
10
๐Ÿงพ License
mit
๐Ÿ”„ Active
Yes
๐Ÿ•’ Last Commit
2025-09-24T12:44:07Z

Stack

Language
go
Database
postgresql, redis
Auth
jwt
ORM
gorm
Testing
testify, testcontainers
Monitoring
health-checks
Logging
zerolog

Data Layer

Databases
postgresql, redis
ORM
gorm

UI Stack

Developer Experience

Docker
Yes
Tests
Yes
Quickstart
Yes
env.example
Yes

Pricing

Classification
free
Selected
โ€”
Notes
Open source project with MIT license
Get Started with this Boilerplate