go-symphony Svelte Themes

Go Symphony

go-symphony is a modern CLI tool for generating Go projects that combines the Gin framework, PostgreSQL database, and SQLC for type-safe queries to build efficient API services. With built-in Supabase integration and support for SvelteKit or Next.js frontend scaffolding

go-symphony ๐ŸŽต

Inspired by go-blueprint, I aim to develop a modern CLI tool that generates Go web projects. go-symphony produces Go applications utilizing the Gin framework, PostgreSQL database, and SQLC for type-safe queries. My motivation stems from exclusively employing Gin as an API server and PostgreSQL as my database, eliminating the need for alternative options. Having recently adopted Supabase extensively, I intend to integrate its capabilities into this project. Finally, as I use SvelteKit or Next.js to build the front-end, so I incorporate it into go-symphony.

๐Ÿ“บ Demo

Check out a video walkthrough of go-symphony in action: YouTube Demo

โœจ Features

  • ๐Ÿš€ Modern Go Architecture: Clean project structure with best practices built-in
  • ๐ŸŒ Gin Framework: High-performance HTTP web framework with httprouter
  • ๐Ÿ—„๏ธ PostgreSQL Support: PostgreSQL with pgx driver for optimal performance
  • ๐Ÿ”’ Type-Safe Queries: SQLC integration for compile-time SQL validation
  • โ˜๏ธ Supabase Integration: Modern backend-as-a-service with auth and real-time features
  • ๐Ÿณ Docker Ready: Optional Docker and docker-compose configuration
  • โšก Hot Reload: Air integration for development with live reload
  • ๐Ÿงช Testing Setup: Pre-configured testing with testcontainers
  • ๐Ÿ”„ CI/CD: GitHub Actions workflows for testing and releasing
  • ๐ŸŒ Frontend Integration: Optional SvelteKit and Next.js frontend generation
  • ๐Ÿ”Œ WebSocket Support: Real-time communication capabilities

๐ŸŽฏ Project Structure

Go Symphony generates projects with this consistent structure:

your-project/
โ”œโ”€โ”€ cmd/api/main.go           # Application entry point
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ server/               # Gin server and routes
โ”‚   โ”œโ”€โ”€ database/             # Database service layer
โ”‚   โ””โ”€โ”€ db_sqlc/              # SQLC generated code (optional)
โ”œโ”€โ”€ sqlc/                     # Standard PostgreSQL setup
โ”‚   โ”œโ”€โ”€ migrations/           # SQL schema files
โ”‚   โ””โ”€โ”€ queries/              # SQL query files
โ”œโ”€โ”€ supabase/                 # Supabase setup (alternative)
โ”‚   โ””โ”€โ”€ migrations/           # Supabase migration files
โ”œโ”€โ”€ Makefile                  # Build and development commands
โ”œโ”€โ”€ .env                      # Environment configuration
โ”œโ”€โ”€ .air.toml                 # Hot reload configuration
โ””โ”€โ”€ docker-compose.yml       # Database containers (non-Supabase)

๐Ÿ“ฆ Installation

go install github.com/Tomlord1122/go-symphony@latest

Option 2: Install from Releases

Download the latest release from GitHub Releases:

Option 3: Build from Source

git clone https://github.com/Tomlord1122/go-symphony.git
cd go-symphony
go build -o go-symphony .
sudo mv go-symphony /usr/local/bin/

๐Ÿš€ Quick Start

Create a New Project

# Interactive mode (recommended for first use)
go-symphony create

Basic Usage


# Create project with advanced features
go-symphony create -a

# Create project with name my-api
go-symphony create -n my-api 

# Create project with name my-api and advanced features
go-symphony create -n my-api -a

Available Options

  • Database Drivers: postgres, supabase, none
  • Advanced Features: sqlc, docker, githubaction, websocket
  • Frontend Framework: sveltekit, nextjs, none
  • Git Options: commit, stage, skip

๐Ÿ› ๏ธ Development Workflow

After creating your project:

cd your-project

# Start PostgreSQL database (if using postgres driver)
make docker-run

# Generate SQLC code (if using SQLC)
make sqlc-generate

# Start development server with hot reload
make watch

# Run tests
make test

# Build for production
make build

๐Ÿ“‹ Prerequisites

Required

  • Go 1.24+: Download Go
  • Git: For project initialization

Optional (for specific features)

  • Docker: For database containers and containerization
  • Supabase CLI: For Supabase integration - Install Supabase CLI
  • Node.js & pnpm: For SvelteKit frontend - Install Node.js & Install pnpm
  • SQLC: Automatically installed via Makefile when needed

Create Command

go-symphony create [flags]

Flags:

  • -n, --name string: Name of project to create
  • -a, --advanced: Enable advanced features prompt

Version Command

go-symphony version

workflow

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

Top categories

Loading Svelte Themes