go-ddd-starter

module
v0.0.0-...-1d59ede Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: MIT

README

Go DDD Starter Template

A production-ready Go project template that follows Domain-Driven Design (DDD) principles to create clean, maintainable, and scalable applications.

Using This Template

  1. Click the "Use this template" button at the top of this repository
  2. Name your new repository and create it
  3. Clone your new repository locally
  4. Update the following files with your project details:
    • go.mod: Change the module name to your project's module path
    • .env-dev: Configure with your local development settings
    • README.md: Update with your project-specific information

Features

  • 🪟 Domain-Driven Design architecture
  • 🔒 Clean separation of concerns
  • 🛠 Built-in development tools (hot reload, testing)
  • 📦 Docker support for local development
  • 🗄 PostgreSQL integration ready
  • ⚡️ Modern Go practices and patterns
  • ✨ MDC Files for AI agents

Development Workflow

Prerequisites
  • Mise
  • Docker and Docker Compose
  • Make
Initial Setup
  1. Create your repository from this template
  2. Clone your new repository
  3. Copy the environment file: cp .env-dev .env
  4. Configure your environment variables in .env
  5. Install development tools:
    make setup
    
  6. Compile the project:
    make compile
    
Running Dependencies
  1. Start the database:
    docker-compose up -d
    
  2. Load environment variables:
    set -a && source .env && set +a
    
  3. Run migrations:
    make migration/up
    
Development
Hot Reload

For development convenience, we use Air for hot reloading:

air
Testing

Run the test suite with:

make test
API Documentation

The API is documented using OpenAPI 3.0. You can find the specification in openapi.yaml.

To view the interactive API documentation:

  1. Start the service
  2. Visit /api/v1/docs endpoint

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

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

Directories

Path Synopsis
app
cli
gateways
pg
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL