Skip to content

Commit 09b0a55

Browse files
committed
feat(docs): add quick-start-ai-base-project
feat(docs): add quick-start-ai-base-project
1 parent d02a0e1 commit 09b0a55

2 files changed

Lines changed: 323 additions & 0 deletions

File tree

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
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)
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: "使用 jzero 一键搭建 AI 基座项目"
3+
icon: emojione-v1:rocket
4+
description: "通过标准化框架 + AI 辅助业务逻辑的方式,快速搭建企业级 Go 项目"
5+
---
6+
7+
## 为什么需要 AI 基座项目?
8+
9+
### 为什么需要 AI 基座项目?
10+
11+
-**统一框架**:避免重复选型和技术债务,确保长期可维护性
12+
-**标准化结构**:清晰的分层架构、统一的代码组织和工程实践,解决代码混乱、维护困难的问题
13+
-**质量与效率**:开箱即用的日志、监控、链路追踪、限流熔断等生产级基础设施,减少 80% 重复工作
14+
-**团队规范**:内置 Go 最佳实践,AI 友好的架构设计,降低学习成本,提升协作效率
15+
16+
> 💡 **核心价值**:通过**标准化框架 + AI 辅助业务逻辑**,你不需要重复造轮子,AI 也不需要"猜测"框架规范,只需专注于业务逻辑本身!
17+
18+
## 快速开始
19+
20+
### 创建项目
21+
22+
jzero 提供了多种项目模板,满足不同场景需求:
23+
24+
#### 1️⃣ API 项目(RESTful 服务)
25+
26+
```bash
27+
jzero new myproject --frame api
28+
```
29+
30+
**适用场景**
31+
- ✅ RESTful API 服务
32+
- ✅ 前后端分离的后端服务
33+
- ✅ 移动端后端服务
34+
- ✅ 微服务中的 API 网关
35+
36+
**特点**
37+
- 🚀 轻量级高性能
38+
- 📝 自动生成 Swagger 文档
39+
- 🔒 内置 JWT 认证
40+
- 🎯 完善的请求验证
41+
42+
#### 2️⃣ RPC 项目(gRPC 服务)
43+
44+
```bash
45+
jzero new myproject --frame rpc
46+
```
47+
48+
**适用场景**
49+
- ✅ 微服务间通信
50+
- ✅ 高性能内部服务
51+
- ✅ 需要强类型的接口
52+
53+
**特点**
54+
- ⚡ 高性能二进制传输
55+
- 🔄 自动负载均衡
56+
- 📡 服务发现
57+
- 🔐 内置重试和熔断
58+
59+
#### 3️⃣ Gateway 项目(API 网关)
60+
61+
```bash
62+
jzero new myproject --frame gateway
63+
```
64+
65+
**适用场景**
66+
- ✅ 统一入口管理
67+
- ✅ 多服务聚合
68+
- ✅ 需要同时支持 HTTP 和 gRPC
69+
70+
**特点**
71+
- 🌐 同时支持 HTTP 和 gRPC
72+
- 🔄 智能路由转发
73+
- ⚖️ 负载均衡
74+
- 🛡️ 统一认证鉴权
75+
76+
### 启动服务
77+
78+
```bash
79+
cd myproject
80+
81+
# 下载依赖
82+
go mod tidy
83+
84+
# 启动服务
85+
go run main.go server
86+
87+
# 访问 Swagger UI
88+
open http://localhost:8001/swagger
89+
```
90+
91+
## 按需启用:可选功能模块
92+
93+
你的项目可能需要数据库、缓存等功能,jzero 支持**按需启用**
94+
95+
```bash
96+
# 需要数据库 + Redis 缓存
97+
jzero new myproject --features model,redis
98+
99+
# 需要数据库 + 数据库缓存
100+
jzero new myproject --features model,cache
101+
102+
# 需要数据库 + Redis + 数据库缓存
103+
jzero new myproject --features model,redis,cache
104+
```
105+
106+
**功能说明**
107+
108+
| 功能 | 说明 | 适用场景 |
109+
|------|------|---------|
110+
| `model` | 关系型数据库支持 | 需要持久化存储 |
111+
| `redis` | Redis 缓存支持 | 需要高性能缓存 |
112+
| `cache` | 数据库查询缓存 | 减轻数据库压力 |
113+
114+
## 🏢 自定义企业级模板
115+
116+
jzero 默认模板包含标准化的框架代码和最佳实践,但企业内部通常需要添加:
117+
- 🔧 **CI/CD 流水线配置**(Jenkins)
118+
- 📊 **企业监控告警**(Prometheus、Grafana、日志规范)
119+
- 🛡️ **安全合规要求**(鉴权、审计、加密)
120+
- 🏗️ **中间件集成**(MQ、OSS、第三方服务)
121+
122+
jzero 支持自定义企业模板,让所有项目都符合企业标准:
123+
124+
### 使用自定义模板
125+
126+
```bash
127+
# 使用企业自定义模板创建项目
128+
jzero new myproject --template https://github.com/your-org/jzero-template --branch base
129+
```
130+
131+
## 从基座到业务:AI 辅助开发实战
132+
133+
有了 AI 基座项目后,你只需要专注于业务逻辑开发。让我们看看如何快速开发一个用户管理功能:
134+
135+
### 场景:开发用户注册功能
136+
137+
**使用 jzero + AI Skills**
138+
139+
```bash
140+
# 只需要一句话
141+
"用 jzero-skills 创建用户注册功能,支持用户名、邮箱、密码,需要验证和去重"
142+
```
143+
144+
**AI 自动完成**
145+
```
146+
✅ 生成 desc/api/user.api
147+
✅ 生成 desc/sql/user.sql
148+
✅ 执行 jzero gen 生成框架代码
149+
✅ 实现 Logic 层业务逻辑
150+
✅ 包含完整的验证和错误处理
151+
```
152+
153+
## 总结
154+
155+
jzero 通过**标准化框架 + AI 辅助**的方式,让 Go 项目开发变得前所未有的简单:
156+
157+
1. **快速启动**:一行命令创建包含最佳实践的项目基座
158+
2. **灵活定制**:支持自定义企业模板,确保团队规范统一
159+
3. **AI 增强**:AI 理解框架规范,专注业务逻辑实现
160+
161+
**觉得有用?请给 jzero 一个 ⭐ Star 支持我们持续改进!**
162+
163+
GitHub: [https://github.com/jzero-io/jzero](https://github.com/jzero-io/jzero)
164+
Jzero 官网: [https://jzero.io](https://jzero.io)

0 commit comments

Comments
 (0)