Introduction
GoDDD is an AI-driven lightweight enterprise REST API scaffold. By describing business requirements in natural language, godddx generates domain code for you, so developers can focus on business logic instead of boilerplate.
Design Goals
- Provide a clean architecture suitable for projects of any size.
- Provide a modular structure for quickly starting a project, focusing on business development.
- Simplify projects, making development more efficient and enjoyable.
- Keep the learning curve low, so developers can get started quickly without being DDD experts.
Modular Monolithic Architecture
Traditional MVC monolithic architectures become increasingly difficult to develop as the business grows, and new team members struggle to understand the bloated monolith. GoDDD adopts a modular monolithic architecture: the complete business is split into multiple domain modules, such as User Domain, Bank Domain, and Product Domain. Each domain has its own complete set of:
- API: Interface layer responsible for route registration and request/response handling.
- Core: Business core containing domain models and business logic.
- Store: Cache and persistence layer, exposed to Core through dependency-inversion interfaces.
Different developers or teams can work on these domain modules independently, reducing confusion and conflicts caused by adding new features. Compared to microservices, modules organized this way are smaller, cleaner, and easier to test. When the program outgrows the domain-module scale, the team can easily extract a domain module into a microservice when needed.
Quick Start
- Ensure Golang version >= 1.25.0 (Go 1.26 is recommended).
- Clone the project:
git clone github.com/ixugo/goddd && cd goddd
- Rename the module:
make rename name=github.com/name/project
- Optional: install development tools:
make init
- Build and run:
go build -o server ./main.go && ./server
- Check the health endpoint:
curl http://localhost:8080/health
Ecosystem
Learning Path
We recommend reading the documentation in this order:
- Introduction (this page)
- Request/Response Wrapping
- Error Handling and Log Sanitization
- Naming Conventions and Team Standards
- Cross-Domain Aggregation Patterns
For more details, please visit the GitHub repository.