Golang Starter Kit 2025
Open Source

Golang Starter Kit 2025

calendar_today 2 November 2025
visibility 140 views

A modern, production-ready Golang starter kit with best practices and essential tools for building scalable applications in 2025.

Technologies

GolangPostgreSQLGORMGinDockerJWTClean Architecture

Overview

This starter kit provides a solid foundation for building Go applications with modern architecture patterns, comprehensive testing setup, and DevOps best practices.

Features

  • Clean Architecture structure
  • PostgreSQL with GORM
  • RESTful API with Gin framework
  • JWT Authentication
  • Docker & Docker Compose setup
  • Comprehensive testing suite
  • CI/CD ready

Tech Stack

Backend

  • Golang 1.21+ - Modern Go version with latest features
  • Gin - Fast HTTP web framework
  • GORM - ORM library for Go
  • JWT - JSON Web Token authentication

Database

  • PostgreSQL - Reliable relational database
  • Redis - Caching layer (optional)

DevOps

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration
  • GitHub Actions - CI/CD pipelines

Quick Start

# Clone the repository
git clone https://github.com/RahmatRafiq/golang_strarter_kit_2025.git
cd golang_strarter_kit_2025

# Start with Docker Compose
docker-compose up -d

# Or run locally
go mod download
go run main.go

Project Structure

├── cmd/                # Application entrypoints
├── internal/           # Private application code
│   ├── domain/        # Domain models
│   ├── repository/    # Data access layer
│   ├── service/       # Business logic
│   └── handler/       # HTTP handlers
├── pkg/               # Public libraries
├── config/            # Configuration files
├── migrations/        # Database migrations
└── docker-compose.yml

Configuration

Create a .env file in the root directory:

DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=myapp
JWT_SECRET=your-secret-key

API Documentation

The API includes:

  • User authentication (register, login, logout)
  • CRUD operations with best practices
  • Middleware (auth, CORS, logging)
  • Error handling
  • Request validation

Testing

# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run specific test
go test ./internal/service/...

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.