c4-gen 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/banner.svg +107 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/src/generator.js +8 -8
- package/doc/system_architecture.md +0 -6833
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<svg width="1200" height="300" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#667eea;stop-opacity:1" />
|
|
5
|
+
<stop offset="100%" style="stop-color:#764ba2;stop-opacity:1" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="grad2" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" style="stop-color:#f093fb;stop-opacity:0.3" />
|
|
9
|
+
<stop offset="100%" style="stop-color:#f5576c;stop-opacity:0.3" />
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- Background -->
|
|
14
|
+
<rect width="1200" height="300" fill="url(#grad1)"/>
|
|
15
|
+
|
|
16
|
+
<!-- Decorative circles -->
|
|
17
|
+
<circle cx="100" cy="50" r="80" fill="url(#grad2)" opacity="0.3"/>
|
|
18
|
+
<circle cx="1100" cy="250" r="100" fill="url(#grad2)" opacity="0.3"/>
|
|
19
|
+
<circle cx="950" cy="80" r="60" fill="url(#grad2)" opacity="0.2"/>
|
|
20
|
+
|
|
21
|
+
<!-- Main content container -->
|
|
22
|
+
<g>
|
|
23
|
+
<!-- Icon/Logo area -->
|
|
24
|
+
<g transform="translate(80, 80)">
|
|
25
|
+
<!-- Architecture icon -->
|
|
26
|
+
<rect x="0" y="0" width="40" height="40" rx="5" fill="white" opacity="0.9"/>
|
|
27
|
+
<rect x="50" y="0" width="40" height="40" rx="5" fill="white" opacity="0.8"/>
|
|
28
|
+
<rect x="25" y="50" width="40" height="40" rx="5" fill="white" opacity="0.7"/>
|
|
29
|
+
<line x1="20" y1="20" x2="70" y2="20" stroke="white" stroke-width="3" opacity="0.9"/>
|
|
30
|
+
<line x1="45" y1="40" x2="45" y2="50" stroke="white" stroke-width="3" opacity="0.9"/>
|
|
31
|
+
</g>
|
|
32
|
+
|
|
33
|
+
<!-- Title -->
|
|
34
|
+
<text x="220" y="120" font-family="'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
35
|
+
font-size="72" font-weight="800" fill="white" letter-spacing="-2">
|
|
36
|
+
c4-gen
|
|
37
|
+
</text>
|
|
38
|
+
|
|
39
|
+
<!-- Emoji -->
|
|
40
|
+
<text x="480" y="120" font-size="60">🏗️</text>
|
|
41
|
+
|
|
42
|
+
<!-- Subtitle -->
|
|
43
|
+
<text x="220" y="165" font-family="'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
44
|
+
font-size="28" font-weight="400" fill="white" opacity="0.95">
|
|
45
|
+
AI-Powered C4 Architecture Documentation Generator
|
|
46
|
+
</text>
|
|
47
|
+
|
|
48
|
+
<!-- Features -->
|
|
49
|
+
<g transform="translate(220, 200)">
|
|
50
|
+
<text x="0" y="0" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
51
|
+
font-size="18" font-weight="500" fill="white" opacity="0.9">
|
|
52
|
+
⚡ Instant Documentation
|
|
53
|
+
</text>
|
|
54
|
+
<text x="220" y="0" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
55
|
+
font-size="18" font-weight="500" fill="white" opacity="0.9">
|
|
56
|
+
🤖 Google Gemini AI
|
|
57
|
+
</text>
|
|
58
|
+
<text x="420" y="0" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
59
|
+
font-size="18" font-weight="500" fill="white" opacity="0.9">
|
|
60
|
+
📊 Beautiful Diagrams
|
|
61
|
+
</text>
|
|
62
|
+
<text x="630" y="0" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
63
|
+
font-size="18" font-weight="500" fill="white" opacity="0.9">
|
|
64
|
+
🌍 13+ Languages
|
|
65
|
+
</text>
|
|
66
|
+
</g>
|
|
67
|
+
|
|
68
|
+
<!-- Author badge -->
|
|
69
|
+
<g transform="translate(220, 245)">
|
|
70
|
+
<rect x="0" y="0" width="180" height="35" rx="17.5" fill="white" opacity="0.15"/>
|
|
71
|
+
<text x="18" y="23" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
72
|
+
font-size="16" font-weight="600" fill="white">
|
|
73
|
+
👨💻 by haodq4
|
|
74
|
+
</text>
|
|
75
|
+
</g>
|
|
76
|
+
|
|
77
|
+
<!-- NPM badge -->
|
|
78
|
+
<g transform="translate(420, 245)">
|
|
79
|
+
<rect x="0" y="0" width="140" height="35" rx="17.5" fill="white" opacity="0.15"/>
|
|
80
|
+
<text x="18" y="23" font-family="'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
81
|
+
font-size="16" font-weight="600" fill="white">
|
|
82
|
+
📦 npm install
|
|
83
|
+
</text>
|
|
84
|
+
</g>
|
|
85
|
+
</g>
|
|
86
|
+
|
|
87
|
+
<!-- Code snippet decoration -->
|
|
88
|
+
<g transform="translate(900, 100)">
|
|
89
|
+
<rect x="0" y="0" width="250" height="150" rx="10" fill="white" opacity="0.1"/>
|
|
90
|
+
<text x="20" y="35" font-family="'Fira Code', 'Courier New', monospace"
|
|
91
|
+
font-size="14" fill="white" opacity="0.8">
|
|
92
|
+
$ npm i -g c4-gen
|
|
93
|
+
</text>
|
|
94
|
+
<text x="20" y="65" font-family="'Fira Code', 'Courier New', monospace"
|
|
95
|
+
font-size="14" fill="white" opacity="0.8">
|
|
96
|
+
$ c4-gen init
|
|
97
|
+
</text>
|
|
98
|
+
<text x="20" y="95" font-family="'Fira Code', 'Courier New', monospace"
|
|
99
|
+
font-size="14" fill="white" opacity="0.8">
|
|
100
|
+
$ c4-gen generate
|
|
101
|
+
</text>
|
|
102
|
+
<text x="20" y="125" font-family="'Fira Code', 'Courier New', monospace"
|
|
103
|
+
font-size="14" fill="#4ade80" opacity="0.9">
|
|
104
|
+
✨ Done!
|
|
105
|
+
</text>
|
|
106
|
+
</g>
|
|
107
|
+
</svg>
|
package/README.md
CHANGED
package/package.json
CHANGED
package/src/generator.js
CHANGED
|
@@ -209,7 +209,7 @@ Hãy trả về JSON với format CHI TIẾT:
|
|
|
209
209
|
{
|
|
210
210
|
"systemName": "Tên CHÍNH XÁC từ package.json",
|
|
211
211
|
"description": "Mô tả ĐẦY ĐỦ dựa trên phân tích code (3-5 câu)",
|
|
212
|
-
"businessContext": "Domain nghiệp vụ CHI TIẾT (VD:
|
|
212
|
+
"businessContext": "Domain nghiệp vụ CHI TIẾT (VD: Library management system with inventory tracking, book lending, and user management)",
|
|
213
213
|
"purpose": "Mục đích CỤTH (liệt kê 3-5 mục đích chính)",
|
|
214
214
|
"stakeholders": [
|
|
215
215
|
{
|
|
@@ -376,8 +376,8 @@ Hãy trả về JSON CHI TIẾT:
|
|
|
376
376
|
"type": "Type CỤ THỂ (Web Application/API Server/Database/Cache/Message Queue...)",
|
|
377
377
|
"technology": "Tech + version CHÍNH XÁC (Express.js 4.18.2, React 18.2.0, PostgreSQL 14.5...)",
|
|
378
378
|
"description": "Mô tả ĐẦY ĐỦ responsibilities và purpose",
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
"responsibilities": [
|
|
380
|
+
"LIỆT KÊ TẤT CẢ responsibilities từ code (Xử lý yêu cầu API, Quản lý kho, Quản lý logistics, Quản lý thư viện...)"
|
|
381
381
|
],
|
|
382
382
|
"port": "Port CHÍNH XÁC hoặc 'Not specified'",
|
|
383
383
|
"replicas": "Số instances (1, 3, auto-scale...)",
|
|
@@ -579,8 +579,8 @@ Hãy trả về JSON CHI TIẾT:
|
|
|
579
579
|
"layer": "Layer CỤ THỂ",
|
|
580
580
|
"technology": "Technology stack (Express, Sequelize, TypeORM...)",
|
|
581
581
|
"description": "Mô tả ĐẦY ĐỦ purpose và functionality",
|
|
582
|
-
|
|
583
|
-
|
|
582
|
+
"responsibilities": [
|
|
583
|
+
"LIỆT KÊ TẤT CẢ responsibilities từ methods (Quản lý kho, Quản lý logistics, Quản lý thư viện, Xử lý yêu cầu API...)"
|
|
584
584
|
],
|
|
585
585
|
"files": [
|
|
586
586
|
"TẤT CẢ file paths liên quan"
|
|
@@ -697,12 +697,12 @@ QUAN TRỌNG: Phải ĐỌC TOÀN BỘ CODE và liệt kê ĐẦY ĐỦ, KHÔNG
|
|
|
697
697
|
|
|
698
698
|
1. QUÉT TẤT CẢ ROUTES/ENDPOINTS:
|
|
699
699
|
- Đọc TOÀN BỘ files trong routes/, controllers/
|
|
700
|
-
- Liệt kê TỪNG endpoint: GET /api/users, POST /api/
|
|
700
|
+
- Liệt kê TỪNG endpoint: GET /api/users, POST /api/books, PUT /api/warehouse/:id...
|
|
701
701
|
- Mỗi nhóm endpoints liên quan → 1 sequence diagram
|
|
702
702
|
- VÍ DỤ:
|
|
703
703
|
* Nhóm /api/auth/* → Authentication Flow
|
|
704
|
-
* Nhóm /api/
|
|
705
|
-
* Nhóm /api/
|
|
704
|
+
* Nhóm /api/books/* → Library Management Flow
|
|
705
|
+
* Nhóm /api/warehouse/* → Warehouse Logistics Flow
|
|
706
706
|
- PHẢI TẠO sequence diagram cho MỌI nhóm endpoints tìm được
|
|
707
707
|
|
|
708
708
|
2. TẠO SEQUENCE DIAGRAM CHO MỖI NHÓM:
|