🇨🇳 中文版本 • 🇺🇸 English
📖 Overview • ✨ Features • 🚀 Quick Start • 📁 Directory • 🤖 AI Guide
Dilu is a modern web rapid development framework built on top of Gin + GORM, designed specifically to enhance Go language web application development efficiency. Through long-term practice and iterative optimization, it has evolved into a stable and reliable development solution.
💡 Recommendation: Beginners are recommended to use the Dilu Ctl scaffolding tool to quickly create projects. In the AI era, Dilu All is not recommended.
go mod tidy
Edit resources/config.dev.yaml configuration file:
dbcfg:
driver: mysql
dns: root:password@tcp(127.0.0.1:3306)/dilu-db?charset=utf8mb4&parseTime=True
go run main.go start -c resources/config.dev.yaml
Access Swagger documentation at: http://localhost:7888/swagger/index.html
dilu/
├── cmd/ # Command line tool entry (start, version, etc.)
├── internal/ # Core business logic layer
│ ├── bootstrap/ # Application initialization
│ ├── common/ # Common utilities (tools, middleware, constants)
│ ├── tools/ # Code generator core implementation
│ │ ├── apis/ # API interface layer
│ │ ├── service/ # Business logic layer
│ │ ├── router/ # Router configuration layer
│ │ └── repository/ # Data access layer
│ │ ├── model/ # Model layer
│ │ └── query/ # Query layer
│ └── modules/ # Business modules
│ └── sys/ # System module (auto-generated + manual extension)
│ ├── repository/ # Data access layer (Model, Query)
│ │ ├── model/ # Model layer (*.gen.go)
│ │ └── query/ # Query layer (*.gen.go)
│ ├── apis/ # API interface layer
│ ├── service/ # Business logic layer
│ └── router/ # Router configuration layer
├── resources/ # Configuration files (different environments)
├── scripts/ # Scripts (database initialization, migration, etc.)
├── temp/ # Temporary files (logs, SQLite database, etc.)
├── docs/ # User documentation (API docs, Swagger auto-generated)
├── dev-docs/ # Development docs (design docs, AI development memory docs)
├── tests/ # Test code (unit tests, integration tests)
├── main.go # Program entry point
└── go.mod # Dependency management
docs/ - User Documentation DirectoryPublic technical documentation
dev-docs/ - Development Documentation Directory
Internal development references
tests/ - Test Code Directory
*_test.go)Dilu framework provides comprehensive AI-assisted development support to help you efficiently build enterprise-grade Go applications.
dilu-ctl gen to rapidly generate Model, Service, Api, Router code# 1. Prepare database (using SQLite)
go run scripts/init_sqlite.go
# 2. Call dilu-ctl to generate code
dilu-ctl gen -t sys_user -d "sqlite:./data/dev.db" -P . -f false
# 3. View generated files
ls internal/modules/sys/repository/model/sys_user.gen.go
ls internal/modules/sys/repository/query/sys_user.gen.go
# 4. Extend business logic in Service layer
vim internal/modules/sys/service/sys_user_extend.go
# 5. Start service
go run main.go start -c resources/config.sqlite.yaml
For detailed usage methods and best practices, please refer to the AI Development Guide documents above.
Made with ❤️ by baowk