MCPcopy Index your code
hub / github.com/baowk/dilu

github.com/baowk/dilu @v1.2.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.6 ↗ · + Follow
155 symbols 359 edges 36 files 49 documented · 32% updated 3mo agov1.2.6 · 2026-03-21★ 731 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dilu - Go Web Rapid Development Framework

Dilu Logo

Modern Web Development Framework Based on Gin + GORM

🇨🇳 中文版本 • 🇺🇸 English

📖 Overview✨ Features🚀 Quick Start📁 Directory🤖 AI Guide

GitHub stars Go Report Card

📖 Project Overview

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.

🔧 Version Information

  • Dilu Core: Core simplified version focusing on basic web development functions
  • Dilu Ctl: Scaffolding tool for rapid project creation

💡 Recommendation: Beginners are recommended to use the Dilu Ctl scaffolding tool to quickly create projects. In the AI era, Dilu All is not recommended.

✨ Core Features

🚀 Technical Architecture

  • Core Framework: Gin + GORM combination with excellent performance and mature ecosystem
  • Code Generation: Built-in command-line code generator supporting rapid CRUD development
  • SaaS Design: Multi-tenant architecture support with flexible permission management system
  • Modern Approach: Frontend-backend separation architecture based on Vue3 + Element Plus

🛠️ Key Features

  • ⚡ High-performance HTTP service engine
  • 🗃️ Comprehensive database ORM operations
  • 🔐 JWT authentication and permission control
  • 📊 Automatic Swagger API documentation generation
  • 🐳 Docker containerized deployment support
  • 📱 RESTful API design standards
  • 🤖 AI-Assisted Development - Full support for Lingma, GitHub Copilot and other AI tools

🚀 Quick Start

Install Dependencies

go mod tidy

Configure Database

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

Start Service

go run main.go start -c resources/config.dev.yaml

Access Swagger documentation at: http://localhost:7888/swagger/index.html

📁 Directory Structure

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

📂 Important Directories

  • docs/ - User Documentation Directory
  • API Documentation (Swagger auto-generated)
  • User manuals
  • Deployment guides
  • Public technical documentation

  • dev-docs/ - Development Documentation Directory

  • System design documents
  • Architecture design documents
  • Necessary memory documents during AI development process
  • Technical specification documents
  • Internal development references

  • tests/ - Test Code Directory

  • Unit tests (*_test.go)
  • Integration tests
  • Performance tests
  • Test data and Mock objects

🤖 AI Development Guide

Dilu framework provides comprehensive AI-assisted development support to help you efficiently build enterprise-grade Go applications.

📋 AI Code Specifications

  • CLAUDE.md - AI collaboration rules (auto-loaded by Claude Code)

Read AI Development Guides

Core AI Development Capabilities

  • Intelligent Code Generation - Use dilu-ctl gen to rapidly generate Model, Service, Api, Router code
  • API Development Assistant - AI-assisted RESTful API design with automatic Swagger documentation
  • Database Design - AI-assisted table structure design, GORM model and migration script generation
  • Frontend Development - AI generates Vue3 components and TypeScript API wrappers
  • Test Writing - AI automatically generates unit tests and integration tests
  • Documentation - AI-assisted API documentation and technical writing

Quick Example

# 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

Extension points exported contracts — how you extend this code

OSSHandler (Interface)
OSS 对象存储接口
internal/common/third/file_store/upload.go
SmsSend (Interface)
(no doc) [1 implementers]
internal/common/third/sms/sms.go

Core symbols most depended-on inside this repo

Get
called by 33
internal/common/config/config.go
Error
called by 11
internal/common/codes/custerror.go
GenerateSmsCode
called by 7
internal/common/third/sms/sms.go
GetMonthLen
called by 6
internal/common/utils/time.go
Global
called by 5
internal/common/container/container.go
GetZoreTimeLocal
called by 4
internal/common/utils/time.go
GetWeekFirstDayLocal
called by 4
internal/common/utils/time.go
GetMonthFirstDayLocal
called by 4
internal/common/utils/time.go

Shape

Function 106
Method 35
Struct 11
Interface 2
TypeAlias 1

Languages

Go100%

Modules by API surface

internal/common/utils/time.go15 symbols
internal/common/utils/jwt.go15 symbols
internal/common/utils/files/file.go13 symbols
internal/common/third/sms/sms_test.go11 symbols
internal/common/utils/https/http.go10 symbols
internal/common/config/config.go9 symbols
internal/common/codes/custerror.go9 symbols
internal/common/utils/string.go6 symbols
internal/common/middleware/jwt.go5 symbols
cmd/start/rd.go5 symbols
internal/common/utils/time_test.go4 symbols
internal/common/third/sms/sms.go4 symbols

For agents

$ claude mcp add dilu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact