trinity-method-sdk 2.0.8 → 2.1.0
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/CHANGELOG.md +235 -0
- package/README.md +34 -35
- package/dist/cli/commands/deploy/agents.js +1 -1
- package/dist/cli/commands/deploy/claude-setup.js +28 -35
- package/dist/cli/commands/deploy/index.js +1 -1
- package/dist/cli/commands/deploy/knowledge-base.js +1 -1
- package/dist/cli/commands/deploy/root-files.js +1 -1
- package/dist/cli/commands/deploy/sdk-install.js +1 -1
- package/dist/cli/commands/deploy/templates.js +29 -16
- package/dist/cli/commands/update/agents.js +1 -1
- package/dist/cli/commands/update/commands.d.ts +1 -0
- package/dist/cli/commands/update/commands.js +18 -45
- package/dist/cli/commands/update/knowledge-base.js +1 -1
- package/dist/cli/commands/update/templates.js +34 -12
- package/dist/cli/utils/deploy-linting.js +1 -1
- package/dist/cli/utils/template-processor.js +1 -1
- package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +1 -1
- package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +3 -3
- package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +6 -8
- package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +8 -8
- package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
- package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +5 -7
- package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +5 -7
- package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
- package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +7 -2
- package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +3 -4
- package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +6 -3
- package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +4 -1
- package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +11 -5
- package/dist/templates/{agents → .claude/agents}/leadership/aj-cc.md.template +7 -2
- package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +4 -0
- package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +5 -1
- package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +4 -0
- package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +4 -0
- package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +4 -0
- package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +6 -0
- package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +6 -6
- package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +5 -5
- package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +12 -11
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +8 -2
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +9 -5
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +11 -5
- package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +5 -4
- package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
- package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
- package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +144 -35
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +9 -3
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +8 -2
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +8 -2
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +8 -2
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +9 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +8 -4
- package/dist/templates/root/TRINITY.md.template +1 -1
- package/dist/templates/source/base-CLAUDE.md.template +310 -310
- package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
- package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
- package/dist/templates/source/python-CLAUDE.md.template +510 -510
- package/dist/templates/source/react-CLAUDE.md.template +513 -513
- package/dist/templates/source/rust-CLAUDE.md.template +653 -653
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +3 -3
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +3 -3
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +3 -3
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +3 -3
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +4 -3
- package/dist/templates/{documentation → trinity/templates/documentation}/SUBDIRECTORY-README.md.template +1 -1
- package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
- package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
- package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
- package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
- package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
- package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
- package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
- package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
- package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
- package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
- package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
- package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
- package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
- package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
- package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
- package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
- package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +2 -2
- package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +2 -2
- package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +2 -2
- package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +2 -2
- package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +2 -2
- package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +0 -3
- package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +0 -16
- package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +0 -16
- package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +0 -15
- package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +0 -16
- package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +0 -16
- package/package.json +1 -1
- package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2208
- /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
- /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
# Deployment Guide
|
|
2
|
+
|
|
3
|
+
This guide covers deploying {{PROJECT_NAME}} to various platforms and environments.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Before deploying, ensure:
|
|
10
|
+
|
|
11
|
+
- ✅ All tests pass: `{{TEST_COMMAND}}`
|
|
12
|
+
- ✅ Build succeeds: `{{BUILD_COMMAND}}`
|
|
13
|
+
- ✅ Environment variables configured
|
|
14
|
+
- ✅ Database migrations ready
|
|
15
|
+
- ✅ Production dependencies installed
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Environment Configuration
|
|
20
|
+
|
|
21
|
+
### Required Environment Variables
|
|
22
|
+
|
|
23
|
+
{{ENV_VARS_LIST}}
|
|
24
|
+
|
|
25
|
+
### Environment Files
|
|
26
|
+
|
|
27
|
+
**Development:** `.env.development`
|
|
28
|
+
**Staging:** `.env.staging`
|
|
29
|
+
**Production:** `.env.production`
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Build Process
|
|
34
|
+
|
|
35
|
+
### 1. Install Production Dependencies
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
{{PACKAGE_MANAGER}} install --production
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Run Build
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
{{BUILD_COMMAND}}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Build output location: `{{BUILD_OUTPUT_DIRECTORY}}`
|
|
48
|
+
|
|
49
|
+
### 3. Verify Build
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
{{BUILD_VERIFICATION_COMMAND}}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Database Migrations
|
|
58
|
+
|
|
59
|
+
{{DATABASE_MIGRATIONS}}
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Deployment Platforms
|
|
64
|
+
|
|
65
|
+
### Option 1: Heroku
|
|
66
|
+
|
|
67
|
+
#### Setup
|
|
68
|
+
|
|
69
|
+
1. Install Heroku CLI:
|
|
70
|
+
```bash
|
|
71
|
+
curl https://cli-assets.heroku.com/install.sh | sh
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. Login to Heroku:
|
|
75
|
+
```bash
|
|
76
|
+
heroku login
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
3. Create Heroku app:
|
|
80
|
+
```bash
|
|
81
|
+
heroku create {{PROJECT_NAME}}-production
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Configure Environment Variables
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
{{HEROKU_ENV_VARS}}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Deploy
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
git push heroku main
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Database Setup
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
{{HEROKU_DATABASE_SETUP}}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### View Logs
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
heroku logs --tail
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Option 2: Vercel
|
|
111
|
+
|
|
112
|
+
#### Setup
|
|
113
|
+
|
|
114
|
+
1. Install Vercel CLI:
|
|
115
|
+
```bash
|
|
116
|
+
npm install -g vercel
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
2. Login to Vercel:
|
|
120
|
+
```bash
|
|
121
|
+
vercel login
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Deploy
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
vercel --prod
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Configuration
|
|
131
|
+
|
|
132
|
+
Create `vercel.json`:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"version": 2,
|
|
137
|
+
"builds": [
|
|
138
|
+
{
|
|
139
|
+
"src": "{{MAIN_SERVER_FILE}}",
|
|
140
|
+
"use": "@vercel/node"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"routes": [
|
|
144
|
+
{
|
|
145
|
+
"src": "/(.*)",
|
|
146
|
+
"dest": "{{MAIN_SERVER_FILE}}"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"env": {{VERCEL_ENV_VARS}}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Option 3: Docker
|
|
156
|
+
|
|
157
|
+
#### Dockerfile
|
|
158
|
+
|
|
159
|
+
```dockerfile
|
|
160
|
+
FROM node:{{NODE_VERSION}}-alpine
|
|
161
|
+
|
|
162
|
+
WORKDIR /app
|
|
163
|
+
|
|
164
|
+
# Copy package files
|
|
165
|
+
COPY package*.json ./
|
|
166
|
+
|
|
167
|
+
# Install dependencies
|
|
168
|
+
RUN {{PACKAGE_MANAGER}} install --production
|
|
169
|
+
|
|
170
|
+
# Copy application code
|
|
171
|
+
COPY . .
|
|
172
|
+
|
|
173
|
+
# Build application
|
|
174
|
+
RUN {{BUILD_COMMAND}}
|
|
175
|
+
|
|
176
|
+
# Expose port
|
|
177
|
+
EXPOSE {{PORT}}
|
|
178
|
+
|
|
179
|
+
# Start application
|
|
180
|
+
CMD ["{{START_COMMAND}}"]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### docker-compose.yml
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
version: '3.8'
|
|
187
|
+
|
|
188
|
+
services:
|
|
189
|
+
app:
|
|
190
|
+
build: .
|
|
191
|
+
ports:
|
|
192
|
+
- "{{PORT}}:{{PORT}}"
|
|
193
|
+
environment:
|
|
194
|
+
{{DOCKER_ENV_VARS}}
|
|
195
|
+
depends_on:
|
|
196
|
+
- {{DATABASE_SERVICE}}
|
|
197
|
+
|
|
198
|
+
{{DATABASE_SERVICE_CONFIG}}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### Build and Run
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Build image
|
|
205
|
+
docker build -t {{PROJECT_NAME}} .
|
|
206
|
+
|
|
207
|
+
# Run container
|
|
208
|
+
docker run -p {{PORT}}:{{PORT}} {{PROJECT_NAME}}
|
|
209
|
+
|
|
210
|
+
# Or use docker-compose
|
|
211
|
+
docker-compose up -d
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### Option 4: AWS (EC2)
|
|
217
|
+
|
|
218
|
+
#### Setup
|
|
219
|
+
|
|
220
|
+
1. Launch EC2 instance (Ubuntu 20.04 LTS)
|
|
221
|
+
2. Configure security group (allow port {{PORT}})
|
|
222
|
+
3. SSH into instance
|
|
223
|
+
|
|
224
|
+
#### Install Dependencies
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Update system
|
|
228
|
+
sudo apt update && sudo apt upgrade -y
|
|
229
|
+
|
|
230
|
+
# Install Node.js
|
|
231
|
+
curl -fsSL https://deb.nodesource.com/setup_{{NODE_VERSION}}.x | sudo -E bash -
|
|
232
|
+
sudo apt install -y nodejs
|
|
233
|
+
|
|
234
|
+
# Install {{PACKAGE_MANAGER}}
|
|
235
|
+
{{PACKAGE_MANAGER_INSTALL_COMMAND}}
|
|
236
|
+
|
|
237
|
+
# Install PM2 (process manager)
|
|
238
|
+
sudo npm install -g pm2
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Deploy Application
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Clone repository
|
|
245
|
+
git clone <repository-url>
|
|
246
|
+
cd {{PROJECT_NAME}}
|
|
247
|
+
|
|
248
|
+
# Install dependencies
|
|
249
|
+
{{PACKAGE_MANAGER}} install --production
|
|
250
|
+
|
|
251
|
+
# Build application
|
|
252
|
+
{{BUILD_COMMAND}}
|
|
253
|
+
|
|
254
|
+
# Configure environment
|
|
255
|
+
cp .env.example .env
|
|
256
|
+
nano .env # Edit environment variables
|
|
257
|
+
|
|
258
|
+
# Start with PM2
|
|
259
|
+
pm2 start {{START_SCRIPT}} --name {{PROJECT_NAME}}
|
|
260
|
+
pm2 save
|
|
261
|
+
pm2 startup
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### Nginx Configuration
|
|
265
|
+
|
|
266
|
+
```nginx
|
|
267
|
+
server {
|
|
268
|
+
listen 80;
|
|
269
|
+
server_name {{DOMAIN_NAME}};
|
|
270
|
+
|
|
271
|
+
location / {
|
|
272
|
+
proxy_pass http://localhost:{{PORT}};
|
|
273
|
+
proxy_http_version 1.1;
|
|
274
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
275
|
+
proxy_set_header Connection 'upgrade';
|
|
276
|
+
proxy_set_header Host $host;
|
|
277
|
+
proxy_cache_bypass $http_upgrade;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### Option 5: DigitalOcean App Platform
|
|
285
|
+
|
|
286
|
+
#### Setup
|
|
287
|
+
|
|
288
|
+
1. Create DigitalOcean account
|
|
289
|
+
2. Navigate to App Platform
|
|
290
|
+
3. Connect GitHub repository
|
|
291
|
+
|
|
292
|
+
#### Configuration
|
|
293
|
+
|
|
294
|
+
**App Spec (`.do/app.yaml`):**
|
|
295
|
+
|
|
296
|
+
```yaml
|
|
297
|
+
name: {{PROJECT_NAME}}
|
|
298
|
+
services:
|
|
299
|
+
- name: api
|
|
300
|
+
github:
|
|
301
|
+
repo: <username>/{{PROJECT_NAME}}
|
|
302
|
+
branch: main
|
|
303
|
+
build_command: {{BUILD_COMMAND}}
|
|
304
|
+
run_command: {{START_COMMAND}}
|
|
305
|
+
http_port: {{PORT}}
|
|
306
|
+
environment_slug: node-js
|
|
307
|
+
envs:
|
|
308
|
+
{{DIGITALOCEAN_ENV_VARS}}
|
|
309
|
+
|
|
310
|
+
databases:
|
|
311
|
+
{{DIGITALOCEAN_DATABASE_CONFIG}}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### Deploy
|
|
315
|
+
|
|
316
|
+
Push to main branch to trigger automatic deployment.
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## SSL/TLS Configuration
|
|
321
|
+
|
|
322
|
+
### Let's Encrypt (Free SSL)
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Install certbot
|
|
326
|
+
sudo apt install certbot python3-certbot-nginx
|
|
327
|
+
|
|
328
|
+
# Obtain certificate
|
|
329
|
+
sudo certbot --nginx -d {{DOMAIN_NAME}}
|
|
330
|
+
|
|
331
|
+
# Auto-renewal (runs twice daily)
|
|
332
|
+
sudo systemctl enable certbot.timer
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Monitoring & Logging
|
|
338
|
+
|
|
339
|
+
### Application Monitoring
|
|
340
|
+
|
|
341
|
+
{{MONITORING_SETUP}}
|
|
342
|
+
|
|
343
|
+
### Error Tracking
|
|
344
|
+
|
|
345
|
+
{{ERROR_TRACKING_SETUP}}
|
|
346
|
+
|
|
347
|
+
### Log Aggregation
|
|
348
|
+
|
|
349
|
+
{{LOG_AGGREGATION_SETUP}}
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Performance Optimization
|
|
354
|
+
|
|
355
|
+
### Production Optimizations
|
|
356
|
+
|
|
357
|
+
1. **Enable Compression:**
|
|
358
|
+
```typescript
|
|
359
|
+
import compression from 'compression';
|
|
360
|
+
app.use(compression());
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
2. **Enable Caching:**
|
|
364
|
+
```typescript
|
|
365
|
+
app.use((req, res, next) => {
|
|
366
|
+
res.set('Cache-Control', 'public, max-age=300');
|
|
367
|
+
next();
|
|
368
|
+
});
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
3. **Connection Pooling:**
|
|
372
|
+
{{CONNECTION_POOLING_CONFIG}}
|
|
373
|
+
|
|
374
|
+
4. **Rate Limiting:**
|
|
375
|
+
```typescript
|
|
376
|
+
import rateLimit from 'express-rate-limit';
|
|
377
|
+
|
|
378
|
+
const limiter = rateLimit({
|
|
379
|
+
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
380
|
+
max: 100 // limit each IP to 100 requests per windowMs
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
app.use('/api/', limiter);
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Health Checks
|
|
389
|
+
|
|
390
|
+
### Health Check Endpoint
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
app.get('/health', (req, res) => {
|
|
394
|
+
res.json({
|
|
395
|
+
status: 'healthy',
|
|
396
|
+
timestamp: new Date().toISOString(),
|
|
397
|
+
uptime: process.uptime(),
|
|
398
|
+
database: await checkDatabaseConnection()
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Readiness Check
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
app.get('/ready', async (req, res) => {
|
|
407
|
+
const checks = {
|
|
408
|
+
database: await checkDatabaseConnection(),
|
|
409
|
+
dependencies: await checkDependencies()
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const ready = Object.values(checks).every(check => check === true);
|
|
413
|
+
res.status(ready ? 200 : 503).json(checks);
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Backup & Recovery
|
|
420
|
+
|
|
421
|
+
### Database Backups
|
|
422
|
+
|
|
423
|
+
{{DATABASE_BACKUP_INSTRUCTIONS}}
|
|
424
|
+
|
|
425
|
+
### Application Backup
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
# Backup application files
|
|
429
|
+
tar -czf {{PROJECT_NAME}}-backup-$(date +%Y%m%d).tar.gz /path/to/app
|
|
430
|
+
|
|
431
|
+
# Upload to S3 (optional)
|
|
432
|
+
aws s3 cp {{PROJECT_NAME}}-backup-$(date +%Y%m%d).tar.gz s3://backups/
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Rollback Strategy
|
|
438
|
+
|
|
439
|
+
### Quick Rollback
|
|
440
|
+
|
|
441
|
+
**Heroku:**
|
|
442
|
+
```bash
|
|
443
|
+
heroku rollback
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
**Docker:**
|
|
447
|
+
```bash
|
|
448
|
+
docker-compose down
|
|
449
|
+
docker-compose up -d <previous-image-tag>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
**PM2:**
|
|
453
|
+
```bash
|
|
454
|
+
pm2 stop {{PROJECT_NAME}}
|
|
455
|
+
git checkout <previous-commit>
|
|
456
|
+
{{PACKAGE_MANAGER}} install
|
|
457
|
+
{{BUILD_COMMAND}}
|
|
458
|
+
pm2 restart {{PROJECT_NAME}}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## CI/CD Pipeline
|
|
464
|
+
|
|
465
|
+
### GitHub Actions
|
|
466
|
+
|
|
467
|
+
**File:** `.github/workflows/deploy.yml`
|
|
468
|
+
|
|
469
|
+
```yaml
|
|
470
|
+
name: Deploy
|
|
471
|
+
|
|
472
|
+
on:
|
|
473
|
+
push:
|
|
474
|
+
branches: [main]
|
|
475
|
+
|
|
476
|
+
jobs:
|
|
477
|
+
deploy:
|
|
478
|
+
runs-on: ubuntu-latest
|
|
479
|
+
steps:
|
|
480
|
+
- uses: actions/checkout@v2
|
|
481
|
+
|
|
482
|
+
- name: Setup Node.js
|
|
483
|
+
uses: actions/setup-node@v2
|
|
484
|
+
with:
|
|
485
|
+
node-version: '{{NODE_VERSION}}'
|
|
486
|
+
|
|
487
|
+
- name: Install dependencies
|
|
488
|
+
run: {{PACKAGE_MANAGER}} install
|
|
489
|
+
|
|
490
|
+
- name: Run tests
|
|
491
|
+
run: {{TEST_COMMAND}}
|
|
492
|
+
|
|
493
|
+
- name: Build
|
|
494
|
+
run: {{BUILD_COMMAND}}
|
|
495
|
+
|
|
496
|
+
- name: Deploy
|
|
497
|
+
run: |
|
|
498
|
+
# Deployment script
|
|
499
|
+
{{CI_DEPLOY_SCRIPT}}
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## Post-Deployment Checklist
|
|
505
|
+
|
|
506
|
+
- [ ] Application is accessible at production URL
|
|
507
|
+
- [ ] Health check endpoint returns 200
|
|
508
|
+
- [ ] Database connection successful
|
|
509
|
+
- [ ] Environment variables configured correctly
|
|
510
|
+
- [ ] SSL certificate installed and valid
|
|
511
|
+
- [ ] Logs are being collected
|
|
512
|
+
- [ ] Monitoring alerts configured
|
|
513
|
+
- [ ] Backup schedule verified
|
|
514
|
+
- [ ] Performance metrics within acceptable range
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## Troubleshooting
|
|
519
|
+
|
|
520
|
+
### Application Won't Start
|
|
521
|
+
|
|
522
|
+
1. Check logs: `{{LOG_COMMAND}}`
|
|
523
|
+
2. Verify environment variables
|
|
524
|
+
3. Confirm database connection
|
|
525
|
+
4. Check port availability
|
|
526
|
+
|
|
527
|
+
### Database Connection Fails
|
|
528
|
+
|
|
529
|
+
1. Verify database credentials
|
|
530
|
+
2. Check network connectivity
|
|
531
|
+
3. Confirm database is running
|
|
532
|
+
4. Review firewall rules
|
|
533
|
+
|
|
534
|
+
### Performance Issues
|
|
535
|
+
|
|
536
|
+
1. Check application metrics
|
|
537
|
+
2. Review database query performance
|
|
538
|
+
3. Analyze resource utilization (CPU, memory)
|
|
539
|
+
4. Check for memory leaks
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
## Security Checklist
|
|
544
|
+
|
|
545
|
+
- [ ] All secrets in environment variables (not in code)
|
|
546
|
+
- [ ] HTTPS enabled
|
|
547
|
+
- [ ] Security headers configured
|
|
548
|
+
- [ ] Rate limiting enabled
|
|
549
|
+
- [ ] Input validation implemented
|
|
550
|
+
- [ ] SQL injection protection
|
|
551
|
+
- [ ] XSS protection
|
|
552
|
+
- [ ] CSRF protection
|
|
553
|
+
- [ ] Dependency vulnerabilities checked
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
## Related Documentation
|
|
558
|
+
|
|
559
|
+
- [Getting Started](./getting-started.md) - Local development setup
|
|
560
|
+
- [API Development](./api-development.md) - API development guide
|
|
561
|
+
- [Contributing](../CONTRIBUTING.md) - Code standards
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
*Last updated: {{GENERATION_DATE}}*
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Getting Started with {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Welcome to {{PROJECT_NAME}}! This guide will help you get the project running on your local machine for development.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Before you begin, ensure you have the following installed:
|
|
10
|
+
|
|
11
|
+
- **Node.js** (version 14.x or higher)
|
|
12
|
+
- **{{PACKAGE_MANAGER}}** ({{PACKAGE_MANAGER_VERSION}})
|
|
13
|
+
- **{{DATABASE}}** (if applicable)
|
|
14
|
+
- **Git** for version control
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### 1. Clone the Repository
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git clone <repository-url>
|
|
24
|
+
cd {{PROJECT_NAME}}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Install Dependencies
|
|
28
|
+
|
|
29
|
+
{{INSTALL_STEPS}}
|
|
30
|
+
|
|
31
|
+
### 3. Environment Configuration
|
|
32
|
+
|
|
33
|
+
{{ENV_SETUP_INSTRUCTIONS}}
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Running the Application
|
|
38
|
+
|
|
39
|
+
### Development Mode
|
|
40
|
+
|
|
41
|
+
Start the development server:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
{{RUN_COMMAND}}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The application will be available at: **{{DEV_SERVER_URL}}**
|
|
48
|
+
|
|
49
|
+
### Running Tests
|
|
50
|
+
|
|
51
|
+
{{TEST_INSTRUCTIONS}}
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
{{TEST_COMMAND}}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Project Structure
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
{{PROJECT_NAME}}/
|
|
63
|
+
├── {{SOURCE_DIRECTORY}}/ # Application source code
|
|
64
|
+
├── {{TEST_DIRECTORY}}/ # Test files
|
|
65
|
+
├── {{CONFIG_DIRECTORY}}/ # Configuration files
|
|
66
|
+
└── {{DOCS_DIRECTORY}}/ # Documentation
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Database Setup
|
|
72
|
+
|
|
73
|
+
{{DATABASE_SETUP_INSTRUCTIONS}}
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Verification
|
|
78
|
+
|
|
79
|
+
After completing the setup, verify everything works:
|
|
80
|
+
|
|
81
|
+
1. **Application starts:** {{RUN_COMMAND}} runs without errors
|
|
82
|
+
2. **Tests pass:** {{TEST_COMMAND}} shows all tests passing
|
|
83
|
+
3. **Database connected:** {{DATABASE_VERIFICATION}}
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Troubleshooting
|
|
88
|
+
|
|
89
|
+
### Common Issues
|
|
90
|
+
|
|
91
|
+
**Issue:** Dependencies fail to install
|
|
92
|
+
- **Solution:** Clear cache with `{{PACKAGE_MANAGER}} cache clean` and retry
|
|
93
|
+
|
|
94
|
+
**Issue:** Database connection fails
|
|
95
|
+
- **Solution:** Verify {{DATABASE}} is running and credentials in `.env` are correct
|
|
96
|
+
|
|
97
|
+
**Issue:** Port already in use
|
|
98
|
+
- **Solution:** Check if another process is using the port, or change port in `.env`
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Next Steps
|
|
103
|
+
|
|
104
|
+
- Read the [API Documentation](../api/README.md) to understand available endpoints
|
|
105
|
+
- Review [API Development Guide](./api-development.md) to learn how to add new features
|
|
106
|
+
- Check [Contributing Guidelines](../CONTRIBUTING.md) for code standards
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Need Help?
|
|
111
|
+
|
|
112
|
+
- **Documentation:** [Full documentation](../README.md)
|
|
113
|
+
- **Issues:** Report bugs via the issue tracker
|
|
114
|
+
- **Questions:** Contact the development team
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
*Last updated: {{GENERATION_DATE}}*
|
package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# API Endpoint Map Diagram Template
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
This template generates a Mermaid flowchart showing API resource hierarchy.
|
|
5
|
+
|
|
6
|
+
Variables:
|
|
7
|
+
- {{RESOURCES}}: Resource definitions with endpoints
|
|
8
|
+
- {{BASE_PATH}}: API base path (e.g., "/api/v1", "/api")
|
|
9
|
+
|
|
10
|
+
Usage: Replace variables with actual API structure before writing to docs/images/
|
|
11
|
+
|
|
12
|
+
Example RESOURCES format (Mermaid flowchart syntax):
|
|
13
|
+
API[{{BASE_PATH}}]
|
|
14
|
+
Users[Users]
|
|
15
|
+
Auth[Authentication]
|
|
16
|
+
Orders[Orders]
|
|
17
|
+
|
|
18
|
+
API --> Users
|
|
19
|
+
|
|
20
|
+
API --> Auth
|
|
21
|
+
API --> Orders
|
|
22
|
+
|
|
23
|
+
Users --> GetUsers[GET /users]
|
|
24
|
+
Users --> CreateUser[POST /users]
|
|
25
|
+
Users --> GetUser[GET /users/:id]
|
|
26
|
+
|
|
27
|
+
Auth --> Login[POST /auth/login]
|
|
28
|
+
Auth --> Logout[POST /auth/logout]
|
|
29
|
+
|
|
30
|
+
-->
|
|
31
|
+
|
|
32
|
+
```mermaid
|
|
33
|
+
flowchart TD
|
|
34
|
+
{{RESOURCES}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Description
|
|
38
|
+
|
|
39
|
+
This API endpoint map provides a visual overview of the application's REST API structure:
|
|
40
|
+
|
|
41
|
+
- **Base Path**: {{BASE_PATH}}
|
|
42
|
+
- **Resource Groups**: Logical groupings of related endpoints
|
|
43
|
+
- **HTTP Methods**: GET (retrieve), POST (create), PUT/PATCH (update), DELETE (remove)
|
|
44
|
+
|
|
45
|
+
**Benefits:**
|
|
46
|
+
|
|
47
|
+
- Quickly understand available API resources
|
|
48
|
+
- Identify endpoint patterns and conventions
|
|
49
|
+
- Plan new endpoint additions
|
|
50
|
+
- Visualize API surface area for documentation
|
|
51
|
+
|
|
52
|
+
**Navigation:**
|
|
53
|
+
|
|
54
|
+
- Top level shows the base API path
|
|
55
|
+
- Second level shows resource categories
|
|
56
|
+
- Third level shows individual endpoints with HTTP methods
|