|
| 1 | +--- |
| 2 | +title: "Build AI Base Project with jzero in One Click" |
| 3 | +icon: emojione-v1:rocket |
| 4 | +description: "Quickly build enterprise-grade Go projects through standardized framework + AI-assisted business logic" |
| 5 | +--- |
| 6 | + |
| 7 | +## Why Do You Need an AI Base Project? |
| 8 | + |
| 9 | +### Why Do You Need an AI Base Project? |
| 10 | + |
| 11 | +- ✅ **Unified Framework**: Avoid repetitive technology selection and technical debt, ensure long-term maintainability |
| 12 | +- ✅ **Standardized Structure**: Clear layered architecture, unified code organization and engineering practices, solving code chaos and maintenance difficulties |
| 13 | +- ✅ **Quality and Efficiency**: Production-grade infrastructure including logging, monitoring, distributed tracing, rate limiting and circuit breaking out of the box, reducing 80% of repetitive work |
| 14 | +- ✅ **Team Standards**: Built-in Go best practices, AI-friendly architecture design, reduced learning costs, improved collaboration efficiency |
| 15 | + |
| 16 | +> 💡 **Core Value**: Through **standardized framework + AI-assisted business logic**, you don't need to reinvent the wheel, and AI doesn't need to "guess" framework specifications. Just focus on business logic itself! |
| 17 | +
|
| 18 | +## Quick Start |
| 19 | + |
| 20 | +### Create Project |
| 21 | + |
| 22 | +jzero provides various project templates to meet different scenario requirements: |
| 23 | + |
| 24 | +#### 1️⃣ API Project (RESTful Service) |
| 25 | + |
| 26 | +```bash |
| 27 | +jzero new myproject --frame api |
| 28 | +``` |
| 29 | + |
| 30 | +**Use Cases**: |
| 31 | +- ✅ RESTful API services |
| 32 | +- ✅ Backend services for frontend-backend separation |
| 33 | +- ✅ Mobile backend services |
| 34 | +- ✅ API gateways in microservices |
| 35 | + |
| 36 | +**Features**: |
| 37 | +- 🚀 Lightweight and high performance |
| 38 | +- 📝 Auto-generated Swagger documentation |
| 39 | +- 🔒 Built-in JWT authentication |
| 40 | +- 🎯 Comprehensive request validation |
| 41 | + |
| 42 | +#### 2️⃣ RPC Project (gRPC Service) |
| 43 | + |
| 44 | +```bash |
| 45 | +jzero new myproject --frame rpc |
| 46 | +``` |
| 47 | + |
| 48 | +**Use Cases**: |
| 49 | +- ✅ Inter-service communication in microservices |
| 50 | +- ✅ High-performance internal services |
| 51 | +- ✅ Services requiring strongly-typed interfaces |
| 52 | + |
| 53 | +**Features**: |
| 54 | +- ⚡ High-performance binary transmission |
| 55 | +- 🔄 Automatic load balancing |
| 56 | +- 📡 Service discovery |
| 57 | +- 🔐 Built-in retry and circuit breaking |
| 58 | + |
| 59 | +#### 3️⃣ Gateway Project (API Gateway) |
| 60 | + |
| 61 | +```bash |
| 62 | +jzero new myproject --frame gateway |
| 63 | +``` |
| 64 | + |
| 65 | +**Use Cases**: |
| 66 | +- ✅ Unified entry point management |
| 67 | +- ✅ Multi-service aggregation |
| 68 | +- ✅ Need to support both HTTP and gRPC |
| 69 | + |
| 70 | +**Features**: |
| 71 | +- 🌐 Support both HTTP and gRPC |
| 72 | +- 🔄 Smart routing and forwarding |
| 73 | +- ⚖️ Load balancing |
| 74 | +- 🛡️ Unified authentication and authorization |
| 75 | + |
| 76 | +### Start Service |
| 77 | + |
| 78 | +```bash |
| 79 | +cd myproject |
| 80 | + |
| 81 | +# Download dependencies |
| 82 | +go mod tidy |
| 83 | + |
| 84 | +# Start service |
| 85 | +go run main.go server |
| 86 | + |
| 87 | +# Access Swagger UI |
| 88 | +open http://localhost:8001/swagger |
| 89 | +``` |
| 90 | + |
| 91 | +## On-Demand Enablement: Optional Feature Modules |
| 92 | + |
| 93 | +Your project might need databases, caching, and other features. jzero supports **on-demand enablement**: |
| 94 | + |
| 95 | +```bash |
| 96 | +# Need database + Redis cache |
| 97 | +jzero new myproject --features model,redis |
| 98 | + |
| 99 | +# Need database + database cache |
| 100 | +jzero new myproject --features model,cache |
| 101 | + |
| 102 | +# Need database + Redis + database cache |
| 103 | +jzero new myproject --features model,redis,cache |
| 104 | +``` |
| 105 | + |
| 106 | +**Feature Description**: |
| 107 | + |
| 108 | +| Feature | Description | Use Cases | |
| 109 | +|---------|-------------|-----------| |
| 110 | +| `model` | Relational database support | Need persistent storage | |
| 111 | +| `redis` | Redis cache support | Need high-performance caching | |
| 112 | +| `cache` | Database query cache | Reduce database pressure | |
| 113 | + |
| 114 | +## 🏢 Custom Enterprise Templates |
| 115 | + |
| 116 | +jzero default templates only contain basic framework code, but enterprises typically need to include content like CI/CD pipeline integration. jzero supports custom templates to add enterprise-specific content. |
| 117 | + |
| 118 | +### Using Custom Templates |
| 119 | + |
| 120 | +```bash |
| 121 | +# Create project using enterprise custom template |
| 122 | +jzero new myproject --template https://github.com/your-org/jzero-template --branch base |
| 123 | +``` |
| 124 | + |
| 125 | +## From Base to Business: AI-Assisted Development in Action |
| 126 | + |
| 127 | +With the AI base project, you only need to focus on business logic development. Let's see how to quickly develop a user management feature: |
| 128 | + |
| 129 | +### Scenario: Develop User Registration Feature |
| 130 | + |
| 131 | +**Using jzero + AI Skills**: |
| 132 | + |
| 133 | +```bash |
| 134 | +# Just one sentence |
| 135 | +"Use jzero-skills to create user registration feature, supporting username, email, password with validation and deduplication" |
| 136 | +``` |
| 137 | + |
| 138 | +**AI Automatically Completes**: |
| 139 | + |
| 140 | +``` |
| 141 | +✅ Generate desc/api/user.api |
| 142 | +✅ Generate desc/sql/user.sql |
| 143 | +✅ Execute jzero gen to generate framework code |
| 144 | +✅ Implement Logic layer business logic |
| 145 | +✅ Include complete validation and error handling |
| 146 | +``` |
| 147 | + |
| 148 | +## Summary |
| 149 | + |
| 150 | +jzero makes Go project development easier than ever through **standardized framework + AI assistance**: |
| 151 | + |
| 152 | +1. **Quick Start**: One command to create a project base with best practices |
| 153 | +2. **Flexible Customization**: Support custom enterprise templates to ensure unified team standards |
| 154 | +3. **AI Enhanced**: AI understands framework specifications and focuses on business logic implementation |
| 155 | + |
| 156 | +**Find it useful? Please give jzero a ⭐ Star to support our continued improvement!** |
| 157 | + |
| 158 | +GitHub: [https://github.com/jzero-io/jzero](https://github.com/jzero-io/jzero) |
| 159 | +Jzero Website: [https://jzero.io](https://jzero.io) |
0 commit comments