Skip to content

Commit 61da269

Browse files
committed
clean up
1 parent 46b150a commit 61da269

File tree

22 files changed

+1077
-2211
lines changed

22 files changed

+1077
-2211
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ Thumbs.db
2020

2121
# Vendor cache
2222
_vendor/
23+
temp/
24+
25+
_bmad
26+
_bmad-output
27+
.claude

content/docs/_index.zh.md

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 157 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,191 @@
11
---
2-
title: 架构
2+
title: 架构概述
33
linkTitle: 架构
44
weight: 20
55
icon: fa-solid fa-sitemap
6+
description: Piglet 里有什么,怎么组织
67
---
78

8-
## 系统架构
9+
## Piglet 是什么
910

10-
Piglet Run 基于 Pigsty 构建,提供精简的开发环境。
11+
**Piglet 是专为 AI 辅助编程设计的 Agentic Postgres 运行时。**
1112

12-
## 组件
13+
它不只是一个数据库,而是一个完整的云端开发环境:从一台 0.64 元的裸 VM,到完整的生产级网站,开箱即用。
1314

14-
| 组件 | 角色 | 端口 |
15-
|------|------|------|
16-
| **Nginx** | 反向代理,SSL 终止 | 80, 443 |
17-
| **VS Code Server** | 网页版 IDE | /code |
18-
| **JupyterLab** | 数据科学笔记本 | /jupyter |
19-
| **PostgreSQL** | 主数据库 | 5432 |
20-
| **JuiceFS** | 分布式文件系统 | - |
21-
| **VictoriaMetrics** | 指标存储 | 8428 |
22-
| **Grafana** | 监控仪表盘 | /ui |
15+
### 产品本质
2316

24-
## 网络架构
17+
Piglet 是一个"**缝合怪**"——它集成了:
18+
19+
| 能力 | 对标产品 | Piglet 提供 |
20+
|------|---------|------------|
21+
| 数据库即服务 | Neon, Supabase | PostgreSQL + PITR 时间旅行 |
22+
| 云端 IDE | GitHub Codespaces | VS Code Server + Jupyter |
23+
| AI 编程 | Cursor, Windsurf | Claude Code 原生支持 |
24+
| 应用托管 | Vercel, Railway | Nginx + Node.js + Python |
25+
| 监控可观测 | Datadog | Grafana + VictoriaMetrics |
26+
27+
**核心价值**:由生产级方案(Pigsty)改造成的个人级方案——降维打击。
28+
29+
---
30+
31+
## 核心组件
2532

2633
```
27-
Internet
28-
29-
30-
┌─────────┐
31-
│ Nginx │ :80, :443
32-
└────┬────┘
33-
34-
├──────────────┬──────────────┬──────────────┐
35-
│ │ │ │
36-
▼ ▼ ▼ ▼
37-
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
38-
│ VS Code │ │ Jupyter │ │ Grafana │ │ App │
39-
│ /code │ │/jupyter │ │ /ui │ │ /* │
40-
└─────────┘ └─────────┘ └─────────┘ └─────────┘
34+
┌─────────────────────────────────────────────────────────────────┐
35+
│ Piglet Runtime │
36+
├─────────────────────────────────────────────────────────────────┤
37+
│ │
38+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
39+
│ │ VS Code │ │ Jupyter │ │ Claude │ │ Your │ │
40+
│ │ Server │ │ Lab │ │ Code │ │ App │ │
41+
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
42+
│ │ │ │ │ │
43+
│ └─────────────┴─────────────┴─────────────┘ │
44+
│ │ │
45+
│ ┌─────┴─────┐ │
46+
│ │ Nginx │ 反向代理 + SSL │
47+
│ └─────┬─────┘ │
48+
│ │ │
49+
├──────────────────────────┼──────────────────────────────────────┤
50+
│ │ │
51+
│ ┌──────────────────────┴──────────────────────┐ │
52+
│ │ PostgreSQL 17 │ │
53+
│ │ 生产级数据库 + PITR 时间旅行 │ │
54+
│ └──────────────────────┬──────────────────────┘ │
55+
│ │ │
56+
│ ┌──────────────────────┴──────────────────────┐ │
57+
│ │ JuiceFS (PITRFS) │ │
58+
│ │ 文件系统也能时间旅行的秘密武器 │ │
59+
│ └─────────────────────────────────────────────┘ │
60+
│ │
61+
├─────────────────────────────────────────────────────────────────┤
62+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
63+
│ │ Grafana │ │ Victoria │ │ Loki │ │
64+
│ │ 监控面板 │ │ Metrics │ │ 日志 │ │
65+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
66+
└─────────────────────────────────────────────────────────────────┘
4167
```
4268

69+
### 组件清单
70+
71+
| 组件 | 角色 | 访问方式 |
72+
|------|------|---------|
73+
| **Nginx** | 反向代理,SSL 终止,静态文件托管 | :80, :443 |
74+
| **VS Code Server** | 网页版 IDE,支持远程 SSH | /code |
75+
| **JupyterLab** | 数据科学笔记本 | /jupyter |
76+
| **PostgreSQL 17** | 主数据库,带 340+ 扩展 | :5432 |
77+
| **JuiceFS** | 分布式文件系统(PITRFS) | ~/data |
78+
| **VictoriaMetrics** | 时序指标存储 | :8428 |
79+
| **Grafana** | 监控仪表盘 | /grafana |
80+
| **Loki** | 日志聚合 | - |
81+
82+
---
83+
84+
## Agentic 设计
85+
86+
Piglet 的核心设计理念是 **Human-Agent Parity**(人机对等):
87+
88+
> 人看到的 = Agent 看到的,同一套工具、同一个视角。
89+
90+
### 人机分工
91+
92+
| 角色 | 职责 |
93+
|------|------|
94+
| **你(人类)** | 提出需求、派活、验收 |
95+
| **Agent(AI)** | 利用环境里的工具实现需求 |
96+
97+
Agent 可能比很多用户更懂环境里有什么能用,但最终还是人类说了算。
98+
99+
### 用户画像
100+
101+
| 用户类型 | 他们想要什么 | Agent 扮演的角色 |
102+
|---------|-------------|-----------------|
103+
| **DBA/专家** | 利用 Agent 自动化专业任务 | 执行助手 |
104+
| **普通开发者** | 快速上线 Web 应用 | 懂行的队友 |
105+
| **小白** | 只说"我要一个 XX" | 全能代理 |
106+
107+
### Claude.md
108+
109+
Piglet 提供 `CLAUDE.md` 文件,告诉 AI Agent 环境里有什么、能做什么:
110+
111+
- 可用的数据库和连接方式
112+
- 可用的命令行工具
113+
- 文件系统结构
114+
- 部署和发布方式
115+
116+
---
117+
43118
## 存储架构
44119

45-
所有开发工作通过 JuiceFS 存储在 PostgreSQL 中:
120+
Piglet 的杀手锏是 **PITRFS**——文件系统也能像数据库一样任意时间点回滚。
46121

47122
```
48123
┌─────────────────────────────────────┐
49-
工作目录
50-
│ ~/workspace
124+
你的代码和数据
125+
│ ~/data/workspace │
51126
└──────────────┬──────────────────────┘
52127
53128
54129
┌─────────────────────────────────────┐
55130
│ JuiceFS │
56-
(POSIX 兼容文件系统)
131+
│ POSIX 兼容 + 时间旅行能力
57132
└──────────────┬──────────────────────┘
58133
59134
60135
┌─────────────────────────────────────┐
61136
│ PostgreSQL │
62-
(元数据 + 数据块)
137+
│ 元数据 + 数据块 + WAL 归档
63138
└─────────────────────────────────────┘
139+
140+
141+
任意时间点恢复 (PITR)
142+
```
143+
144+
这意味着:
145+
- **数据库可以回滚**:标准 PostgreSQL PITR
146+
- **文件系统也可以回滚**:基于 JuiceFS + PostgreSQL 的 PITRFS
147+
- **搞砸了也不怕**:误删代码?回到 10 分钟前。Agent 把数据库搞崩了?一条命令恢复。
148+
149+
---
150+
151+
## 网络架构
152+
153+
所有服务通过 Nginx 统一暴露,支持 HTTPS:
154+
64155
```
156+
Internet
157+
158+
159+
┌─────────────────────────────────────┐
160+
│ Nginx (:80, :443) │
161+
│ - SSL 终止 │
162+
│ - 反向代理 │
163+
│ - 静态文件托管 │
164+
└────┬────────┬────────┬────────┬─────┘
165+
│ │ │ │
166+
▼ ▼ ▼ ▼
167+
/code /jupyter /grafana /*
168+
VS Code Jupyter Grafana 你的应用
169+
```
170+
171+
---
172+
173+
## 与 Pigsty 的关系
174+
175+
| 维度 | Pigsty | Piglet |
176+
|------|--------|--------|
177+
| **定位** | 企业级 PostgreSQL 发行版 | 个人级 Agentic 运行时 |
178+
| **目标用户** | DBA、运维、企业 | 个人开发者、AI 编程者 |
179+
| **规模** | 多节点集群 | 单节点 |
180+
| **复杂度** | 功能完整、配置丰富 | 开箱即用、极简配置 |
181+
| **调性** | 专业、严谨、可靠 | 方便、灵活、好玩 |
182+
183+
**Piglet 是 Pigsty 的精简版**,继承了生产级的可靠性,但去掉了企业级的复杂性。
184+
185+
---
65186

66187
## 下一步
67188

68-
- 了解 [存储](/docs/concept/storage/)
69-
- 理解 [快照](/docs/concept/snapshot/)
189+
- [快速开始](/docs/tutorial/quickstart/) - 10 分钟上手
190+
- [PITRFS 原理](/docs/concept/snapshot/) - 理解时间旅行
191+
- [Agentic 设计](/docs/concept/overview/) - 深入人机协作

content/docs/reference/_index.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

content/docs/reference/_index.zh.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

content/docs/reference/cli/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The `pig` CLI provides complete control over PostgreSQL installation, extension
1818
curl -fsSL https://repo.pigsty.io/pig | bash
1919

2020
# China Mirror
21-
curl -fsSL https://repo.pigsty.cc/pig | bash
21+
curl -fsSL https://repo.pigsty.io/pig | bash
2222
```
2323

2424
Verify installation:

0 commit comments

Comments
 (0)