@codigodoleo/wp-kit 3.5.0 → 5.0.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/lib/prompts/index.js +99 -0
- package/modules/docs/index.js +56 -1
- package/modules/docs/templates/README.md.hbs +33 -160
- package/modules/docs/templates/docs/Arquitetura.md.hbs +106 -0
- package/modules/docs/templates/docs/Deploy-Pipeline.md.hbs +85 -0
- package/modules/docs/templates/docs/Desenvolvimento.md.hbs +127 -0
- package/modules/docs/templates/docs/Getting-Started.md.hbs +83 -0
- package/modules/docs/templates/docs/Infraestrutura.md.hbs +65 -0
- package/modules/docs/templates/docs/Monitoramento.md.hbs +57 -0
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md.hbs +68 -0
- package/modules/docs/templates/docs/Troubleshooting.md.hbs +65 -0
- package/modules/mu-plugin/index.js +143 -17
- package/modules/mu-plugin/prompts.js +7 -0
- package/modules/mu-plugin/templates/acorn/.gitignore.hbs +10 -0
- package/modules/mu-plugin/templates/acorn/README.md.hbs +46 -0
- package/modules/mu-plugin/templates/acorn/app/Providers/CoreServiceProvider.php.hbs +26 -0
- package/modules/mu-plugin/templates/acorn/composer.json.hbs +31 -0
- package/modules/mu-plugin/templates/acorn/config/app.php.hbs +43 -0
- package/modules/mu-plugin/templates/acorn/config/logging.php.hbs +59 -0
- package/modules/mu-plugin/templates/acorn/plugin.php.hbs +95 -0
- package/modules/mu-plugin/templates/acorn/resources/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/cache/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/sessions/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/views/.gitkeep +0 -0
- package/modules/mu-plugin/templates/bedrock-autoloader.php +28 -0
- package/modules/sage/templates/.lando.yml.hbs +4 -1
- package/package.json +1 -1
- package/templates/.lando.yml.hbs +0 -9
- package/modules/docs/templates/docs/Arquitetura.md +0 -420
- package/modules/docs/templates/docs/Deploy-Pipeline.md +0 -127
- package/modules/docs/templates/docs/Desenvolvimento.md +0 -1139
- package/modules/docs/templates/docs/Getting-Started.md +0 -523
- package/modules/docs/templates/docs/Infraestrutura.md +0 -240
- package/modules/docs/templates/docs/Monitoramento.md +0 -340
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +0 -7
- package/modules/docs/templates/docs/Troubleshooting.md +0 -3
package/lib/prompts/index.js
CHANGED
|
@@ -14,6 +14,93 @@ function parseBooleanEnv(value) {
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
function capitalizeToken(token) {
|
|
18
|
+
if (!token) return '';
|
|
19
|
+
|
|
20
|
+
const normalized = token.toLowerCase();
|
|
21
|
+
const dictionary = {
|
|
22
|
+
wordpress: 'WordPress',
|
|
23
|
+
wp: 'WP',
|
|
24
|
+
api: 'API',
|
|
25
|
+
ui: 'UI',
|
|
26
|
+
ux: 'UX',
|
|
27
|
+
cms: 'CMS',
|
|
28
|
+
seo: 'SEO',
|
|
29
|
+
php: 'PHP',
|
|
30
|
+
js: 'JS',
|
|
31
|
+
ci: 'CI',
|
|
32
|
+
cd: 'CD',
|
|
33
|
+
qa: 'QA',
|
|
34
|
+
devops: 'DevOps',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (dictionary[normalized]) {
|
|
38
|
+
return dictionary[normalized];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return token.charAt(0).toUpperCase() + token.slice(1).toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function parseRepositoryInfo(gitRepository, projectName) {
|
|
45
|
+
const fallbackPath = `your-group/${projectName}`;
|
|
46
|
+
const fallbackHost = 'gitlab.com';
|
|
47
|
+
|
|
48
|
+
if (!gitRepository || typeof gitRepository !== 'string') {
|
|
49
|
+
return {
|
|
50
|
+
repositoryHost: fallbackHost,
|
|
51
|
+
repositoryPath: fallbackPath,
|
|
52
|
+
repositoryWebUrl: `https://${fallbackHost}/${fallbackPath}`,
|
|
53
|
+
repositoryHttpsUrl: `https://${fallbackHost}/${fallbackPath}.git`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const value = gitRepository.trim();
|
|
58
|
+
const sshMatch = value.match(/^git@([^:]+):(.+?)(?:\.git)?$/i);
|
|
59
|
+
const httpsMatch = value.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/i);
|
|
60
|
+
const matched = sshMatch || httpsMatch;
|
|
61
|
+
|
|
62
|
+
if (!matched) {
|
|
63
|
+
return {
|
|
64
|
+
repositoryHost: fallbackHost,
|
|
65
|
+
repositoryPath: fallbackPath,
|
|
66
|
+
repositoryWebUrl: `https://${fallbackHost}/${fallbackPath}`,
|
|
67
|
+
repositoryHttpsUrl: `https://${fallbackHost}/${fallbackPath}.git`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const repositoryHost = matched[1];
|
|
72
|
+
const repositoryPath = matched[2];
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
repositoryHost,
|
|
76
|
+
repositoryPath,
|
|
77
|
+
repositoryWebUrl: `https://${repositoryHost}/${repositoryPath}`,
|
|
78
|
+
repositoryHttpsUrl: `https://${repositoryHost}/${repositoryPath}.git`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function deriveProjectMetadata({ projectName, gitRepository }) {
|
|
83
|
+
const tokens = projectName.split('-').filter(Boolean);
|
|
84
|
+
const projectTitle = tokens.map(capitalizeToken).join(' ');
|
|
85
|
+
const projectPascal = tokens.map(capitalizeToken).join('');
|
|
86
|
+
const projectSnake = projectName.replace(/-/g, '_');
|
|
87
|
+
const projectConstant = projectSnake.toUpperCase();
|
|
88
|
+
const projectThemeSlug = `${projectName}-theme`;
|
|
89
|
+
const repository = parseRepositoryInfo(gitRepository, projectName);
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
projectTitle,
|
|
93
|
+
projectPascal,
|
|
94
|
+
projectSnake,
|
|
95
|
+
projectConstant,
|
|
96
|
+
projectThemeSlug,
|
|
97
|
+
projectDevDomain: `development-www.${projectName}.com`,
|
|
98
|
+
projectStagingDomain: `staging-www.${projectName}.com`,
|
|
99
|
+
projectProductionDomain: `www.${projectName}.com`,
|
|
100
|
+
...repository,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
17
104
|
export async function runPrompts({ defaults = false } = {}) {
|
|
18
105
|
const defaultsGit = getGitUserDefaults();
|
|
19
106
|
|
|
@@ -162,8 +249,14 @@ export async function runPrompts({ defaults = false } = {}) {
|
|
|
162
249
|
const enabledModules = Object.keys(modulePromptDefs).filter(
|
|
163
250
|
(mod) => defaultAnswers[`enable_${mod.replace(/-/g, '_')}`] === true
|
|
164
251
|
);
|
|
252
|
+
const derived = deriveProjectMetadata({
|
|
253
|
+
projectName: defaultAnswers.projectName,
|
|
254
|
+
gitRepository: defaultAnswers.gitRepository,
|
|
255
|
+
});
|
|
256
|
+
|
|
165
257
|
return {
|
|
166
258
|
...defaultAnswers,
|
|
259
|
+
...derived,
|
|
167
260
|
phpVersion: '8.4',
|
|
168
261
|
nodeVersion: '24',
|
|
169
262
|
enabledModules,
|
|
@@ -184,8 +277,14 @@ export async function runPrompts({ defaults = false } = {}) {
|
|
|
184
277
|
const enabledModules = Object.keys(modulePromptDefs).filter(
|
|
185
278
|
(mod) => answers[`enable_${mod.replace(/-/g, '_')}`] === true
|
|
186
279
|
);
|
|
280
|
+
const derived = deriveProjectMetadata({
|
|
281
|
+
projectName: answers.projectName,
|
|
282
|
+
gitRepository: answers.gitRepository,
|
|
283
|
+
});
|
|
284
|
+
|
|
187
285
|
return {
|
|
188
286
|
...answers,
|
|
287
|
+
...derived,
|
|
189
288
|
phpVersion: '8.4',
|
|
190
289
|
nodeVersion: '24',
|
|
191
290
|
enabledModules,
|
package/modules/docs/index.js
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stack-agnostic context derivation. Derives only what we can know from
|
|
3
|
+
* existing prompts (git_provider, useSage, repository*); everything stack-
|
|
4
|
+
* specific (cloud, orchestrator, database, monitoring) lives in `{{TODO}}`
|
|
5
|
+
* placeholders inside the generated docs for the team to fill in.
|
|
6
|
+
*/
|
|
7
|
+
function deriveDocContext(context) {
|
|
8
|
+
const isGitHub = context.gitProvider === 'github';
|
|
9
|
+
const isGitLab = context.gitProvider === 'gitlab';
|
|
10
|
+
const isBitbucket = context.gitProvider === 'bitbucket';
|
|
11
|
+
|
|
12
|
+
// Pull request terminology varies by provider; the docs reference it
|
|
13
|
+
// dozens of times so a single derived string keeps the templates clean.
|
|
14
|
+
const prTerm = isGitLab ? 'Merge Request (MR)' : 'Pull Request (PR)';
|
|
15
|
+
const prTermShort = isGitLab ? 'MR' : 'PR';
|
|
16
|
+
const ciSystem = isGitLab
|
|
17
|
+
? 'GitLab CI/CD'
|
|
18
|
+
: isBitbucket
|
|
19
|
+
? 'Bitbucket Pipelines'
|
|
20
|
+
: 'GitHub Actions';
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
...context,
|
|
24
|
+
isGitHub,
|
|
25
|
+
isGitLab,
|
|
26
|
+
isBitbucket,
|
|
27
|
+
prTerm,
|
|
28
|
+
prTermShort,
|
|
29
|
+
ciSystem,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
1
33
|
export async function setupModule(context, generator) {
|
|
2
|
-
|
|
34
|
+
const docContext = deriveDocContext(context);
|
|
35
|
+
|
|
36
|
+
// README.md lands at the docs/ entry point (not the project root README,
|
|
37
|
+
// which is generated by the kit core).
|
|
38
|
+
await generator.generateFile('README.md', docContext, 'docs', 'docs/README.md');
|
|
39
|
+
|
|
40
|
+
const docFiles = [
|
|
41
|
+
'Arquitetura.md',
|
|
42
|
+
'Deploy-Pipeline.md',
|
|
43
|
+
'Desenvolvimento.md',
|
|
44
|
+
'Getting-Started.md',
|
|
45
|
+
'Infraestrutura.md',
|
|
46
|
+
'Monitoramento.md',
|
|
47
|
+
'Sync-the-Production-DB-with-the-Staging-DB.md',
|
|
48
|
+
'Troubleshooting.md',
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
// Bug fix: the previous implementation passed `file` as the 4th arg
|
|
52
|
+
// (outputName), which dumped every doc to the project root instead of
|
|
53
|
+
// inside docs/. Removing that arg restores the template path as the
|
|
54
|
+
// output path (docs/${file}).
|
|
55
|
+
for (const file of docFiles) {
|
|
56
|
+
await generator.generateFile(`docs/${file}`, docContext, 'docs');
|
|
57
|
+
}
|
|
3
58
|
}
|
|
@@ -1,160 +1,33 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# 4. Acesse o site
|
|
36
|
-
# Frontend: https://pipefy.lndo.site
|
|
37
|
-
# Admin: https://pipefy.lndo.site/wp-admin
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## 🏗️ **Arquitetura**
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
44
|
-
│ Local │────│ Development │────│ Staging │────│ Production │
|
|
45
|
-
│ pipefy.lndo.site│ │development-www │ │ staging-www │ │ www.pipefy.com │
|
|
46
|
-
│ │ │ .pipefy.com │ │ .pipefy.com │ │ │
|
|
47
|
-
└─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
48
|
-
│ │ │ │
|
|
49
|
-
└───────────────────────┼───────────────────────┼───────────────────────┘
|
|
50
|
-
│ │
|
|
51
|
-
┌─────────────────┐ ┌─────────────────┐
|
|
52
|
-
│ GitLab CI/CD │ │ Kubernetes │
|
|
53
|
-
│ Pipelines │ │ + CloudFlare │
|
|
54
|
-
└─────────────────┘ └─────────────────┘
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 🛠️ **Stack Tecnológico**
|
|
58
|
-
|
|
59
|
-
| Categoria | Tecnologia |
|
|
60
|
-
|-----------|------------|
|
|
61
|
-
| **CMS** | WordPress (customizado) |
|
|
62
|
-
| **Tema** | Pipefy 2020 (custom theme) |
|
|
63
|
-
| **Frontend** | PHP, JavaScript, Sass, Gutenberg Blocks |
|
|
64
|
-
| **Containerização** | Docker, Lando |
|
|
65
|
-
| **Orquestração** | Kubernetes, Helm |
|
|
66
|
-
| **CI/CD** | GitLab CI/CD |
|
|
67
|
-
| **Infraestrutura** | Terraform, OCI (Oracle Cloud) |
|
|
68
|
-
| **CDN/DNS** | CloudFlare |
|
|
69
|
-
| **Monitoramento** | Custom health checks |
|
|
70
|
-
|
|
71
|
-
## 📁 **Estrutura do Projeto**
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
pipefy-website/
|
|
75
|
-
├── 📂 dist/ # WordPress core + customizações
|
|
76
|
-
│ └── 📂 wp-content/
|
|
77
|
-
│ ├── 📂 themes/pipefy-2020/ # Tema principal
|
|
78
|
-
│ ├── 📂 plugins/ # Plugins WordPress
|
|
79
|
-
│ └── 📂 mu-plugins/ # Must-use plugins
|
|
80
|
-
├── 📂 development/ # Scripts e config. desenvolvimento
|
|
81
|
-
├── 📂 helm/ # Charts Kubernetes
|
|
82
|
-
├── 📂 k8s/ # Manifests Kubernetes
|
|
83
|
-
├── 📂 terraform/ # Infraestrutura como código
|
|
84
|
-
├── 📂 .gitlab/ # Templates GitLab CI/CD
|
|
85
|
-
├── 📄 .lando.yml # Configuração ambiente local
|
|
86
|
-
├── 📄 .gitlab-ci.yml # Pipeline CI/CD
|
|
87
|
-
└── 📄 CHANGELOG.md # Histórico de mudanças
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## 🌍 **Ambientes**
|
|
91
|
-
|
|
92
|
-
| Ambiente | URL | Branch | Namespace K8s | Finalidade |
|
|
93
|
-
|----------|-----|--------|---------------|------------|
|
|
94
|
-
| **Local** | `pipefy.lndo.site` | `feature/*` | - | Desenvolvimento local |
|
|
95
|
-
| **Development** | `development-www.pipefy.com` | `development` | `website-dev` | Testes contínuos |
|
|
96
|
-
| **Staging** | `staging-www.pipefy.com` | `staging` | `website-stg` | Homologação |
|
|
97
|
-
| **Production** | `www.pipefy.com` | `master` | `website-prod` | Site oficial |
|
|
98
|
-
|
|
99
|
-
## 🔄 **Workflow de Desenvolvimento**
|
|
100
|
-
|
|
101
|
-
```mermaid
|
|
102
|
-
graph LR
|
|
103
|
-
A[Feature Branch] --> B[Pull Request]
|
|
104
|
-
B --> C[Code Review]
|
|
105
|
-
C --> D[Merge to Development]
|
|
106
|
-
D --> E["🚀 development-www.pipefy.com"]
|
|
107
|
-
E --> F[Merge to Staging]
|
|
108
|
-
F --> G["🔍 staging-www.pipefy.com"]
|
|
109
|
-
G --> H[Tests + QA]
|
|
110
|
-
H --> I[Merge to Master]
|
|
111
|
-
I --> J["✅ www.pipefy.com"]
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## 📚 **Documentação Principal**
|
|
115
|
-
|
|
116
|
-
### 🚀 **Para Desenvolvedores**
|
|
117
|
-
- [Getting Started](Getting-Started) - Setup completo do ambiente
|
|
118
|
-
- [Arquitetura](Arquitetura) - Estrutura técnica detalhada
|
|
119
|
-
- [Desenvolvimento](Desenvolvimento) - Guias de desenvolvimento
|
|
120
|
-
- [Deploy Pipeline](Deploy-Pipeline) - Processo de deploy
|
|
121
|
-
|
|
122
|
-
### 🔧 **Para DevOps**
|
|
123
|
-
- [Infraestrutura](Infraestrutura) - Kubernetes, Terraform, AWS
|
|
124
|
-
- [Monitoramento](Monitoramento) - Health checks e observabilidade
|
|
125
|
-
- [Troubleshooting](Troubleshooting) - Resolução de problemas
|
|
126
|
-
|
|
127
|
-
### 📦 **Para Gestão**
|
|
128
|
-
- [Plugins & Integrações](Plugins-Integracoes) - Componentes externos
|
|
129
|
-
- [Changelog](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CHANGELOG.md) - Histórico de versões
|
|
130
|
-
- [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS) - Responsabilidades
|
|
131
|
-
|
|
132
|
-
## 🆘 **Precisa de Ajuda?**
|
|
133
|
-
|
|
134
|
-
### 🐛 **Problemas Comuns**
|
|
135
|
-
- [Troubleshooting](Troubleshooting) - Guia de resolução
|
|
136
|
-
- [FAQ](FAQ) - Perguntas frequentes
|
|
137
|
-
|
|
138
|
-
### 📞 **Contatos**
|
|
139
|
-
- **Equipe**: @Approvers (conforme [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS))
|
|
140
|
-
- **Issues**: [GitLab Issues](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues)
|
|
141
|
-
- **Pipefy Cards**: Vinculados no [CHANGELOG.md](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CHANGELOG.md)
|
|
142
|
-
|
|
143
|
-
## 🎯 **Links Importantes**
|
|
144
|
-
|
|
145
|
-
| Recurso | Link | Ambiente |
|
|
146
|
-
|---------|------|----------|
|
|
147
|
-
| **Site Produção** | [www.pipefy.com](https://www.pipefy.com) | 🔴 Production |
|
|
148
|
-
| **Site Staging** | [staging-www.pipefy.com](https://staging-www.pipefy.com) | 🟡 Staging |
|
|
149
|
-
| **Site Development** | [development-www.pipefy.com](https://development-www.pipefy.com) | 🟠 Development |
|
|
150
|
-
| **Site Local** | [pipefy.lndo.site](https://pipefy.lndo.site) | 🔵 Local |
|
|
151
|
-
| **GitLab Project** | [pipefy/wordpress/pipefy-website](https://gitlab.com/pipefy/wordpress/pipefy-website) | - |
|
|
152
|
-
| **CI/CD Pipelines** | [Pipelines](https://gitlab.com/pipefy/wordpress/pipefy-website/-/pipelines) | - |
|
|
153
|
-
| **Kubernetes Dashboards** | *[Links internos conforme ambiente]* | - |
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
📝 **Última atualização**: Junho 2025
|
|
158
|
-
🔄 **Versão da documentação**: 1.1
|
|
159
|
-
✨ **Criado com**: Análise automatizada do projeto + GitHub Copilot
|
|
160
|
-
🌐 **Ambientes atualizados**: Local, Development, Staging, Production
|
|
1
|
+
# {{projectTitle}} — Documentation
|
|
2
|
+
|
|
3
|
+
Project documentation lives in this directory. Each file is a starting
|
|
4
|
+
point — fill in stack-specific details (cloud provider, orchestrator,
|
|
5
|
+
monitoring tools) as your infrastructure decisions get made.
|
|
6
|
+
|
|
7
|
+
## Index
|
|
8
|
+
|
|
9
|
+
| Document | Purpose |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [Getting-Started](./Getting-Started.md) | Local environment setup |
|
|
12
|
+
| [Desenvolvimento](./Desenvolvimento.md) | Workflow, branching, commit hygiene |
|
|
13
|
+
| [Arquitetura](./Arquitetura.md) | High-level technical architecture |
|
|
14
|
+
| [Infraestrutura](./Infraestrutura.md) | Cloud / network / runtime topology |
|
|
15
|
+
| [Deploy-Pipeline](./Deploy-Pipeline.md) | CI/CD flow and environments |
|
|
16
|
+
| [Monitoramento](./Monitoramento.md) | Observability stack and alerts |
|
|
17
|
+
| [Sync-the-Production-DB-with-the-Staging-DB](./Sync-the-Production-DB-with-the-Staging-DB.md) | Database refresh procedure |
|
|
18
|
+
| [Troubleshooting](./Troubleshooting.md) | Common issues and recovery steps |
|
|
19
|
+
|
|
20
|
+
## Conventions
|
|
21
|
+
|
|
22
|
+
- **TODO markers** (`{{ "{{TODO: …}}" }}`) flag sections that depend on stack
|
|
23
|
+
decisions this scaffold can't make for you. Replace them as decisions
|
|
24
|
+
are finalised.
|
|
25
|
+
- Diagrams use [Mermaid](https://mermaid.js.org/) so they render inline
|
|
26
|
+
in GitHub, GitLab, and most static-site generators.
|
|
27
|
+
- Keep this index up to date when adding new docs.
|
|
28
|
+
|
|
29
|
+
## Quick links
|
|
30
|
+
|
|
31
|
+
- Repository: [{{repositoryPath}}]({{repositoryWebUrl}})
|
|
32
|
+
- Local dev: see [Getting-Started](./Getting-Started.md)
|
|
33
|
+
- CI/CD: {{ciSystem}} — see [Deploy-Pipeline](./Deploy-Pipeline.md)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Arquitetura
|
|
2
|
+
|
|
3
|
+
High-level technical architecture of **{{projectTitle}}**.
|
|
4
|
+
|
|
5
|
+
> This document covers what is *known* from the scaffold (local dev,
|
|
6
|
+
> repository, build pipeline). Production-side details (cloud provider,
|
|
7
|
+
> orchestrator, database, CDN) are marked `{{ "{{TODO}}" }}` and must be
|
|
8
|
+
> filled in as those decisions are made.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
```mermaid
|
|
13
|
+
graph TB
|
|
14
|
+
subgraph "Developer"
|
|
15
|
+
DEV[Engineers]
|
|
16
|
+
LOCAL[{{projectDomain}}<br/>Lando + Docker]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
subgraph "CI / CD"
|
|
20
|
+
REPO[{{repositoryHost}}<br/>{{repositoryPath}}]
|
|
21
|
+
CI[{{ciSystem}}]
|
|
22
|
+
REG[{{ "{{TODO: container registry}}" }}]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
subgraph "Runtime"
|
|
26
|
+
EDGE[{{ "{{TODO: CDN / Edge}}" }}]
|
|
27
|
+
APP[{{ "{{TODO: app runtime}}" }}]
|
|
28
|
+
DB[(Database)]
|
|
29
|
+
STORE[{{ "{{TODO: object storage}}" }}]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
DEV --> LOCAL
|
|
33
|
+
DEV --> REPO
|
|
34
|
+
REPO --> CI
|
|
35
|
+
CI --> REG
|
|
36
|
+
REG --> APP
|
|
37
|
+
EDGE --> APP
|
|
38
|
+
APP --> DB
|
|
39
|
+
APP --> STORE
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
### Application layer
|
|
45
|
+
|
|
46
|
+
| Component | Technology | Notes |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| CMS | WordPress {{wpCoreVersion}} | Composer-managed via Roots Bedrock layout |
|
|
49
|
+
{{#if useSage}}| Theme | Sage {{sageVersion}} + Acorn | Blade templating, Vite assets |
|
|
50
|
+
{{/if}}| Language runtime | PHP {{phpVersion}} | |
|
|
51
|
+
| Build pipeline | Node.js {{nodeVersion}} + Vite | |
|
|
52
|
+
|
|
53
|
+
### Persistence
|
|
54
|
+
|
|
55
|
+
| Component | Technology | Notes |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| Database | `{{ "{{TODO: MySQL / MariaDB / managed service}}" }}` | Local dev uses MariaDB via Lando |
|
|
58
|
+
| Object storage | `{{ "{{TODO: S3 / GCS / Azure Blob / NFS}}" }}` | For uploads, backups |
|
|
59
|
+
| Cache | `{{ "{{TODO: Redis / Memcached / none}}" }}` | Object cache, sessions |
|
|
60
|
+
|
|
61
|
+
### Edge / delivery
|
|
62
|
+
|
|
63
|
+
| Component | Technology | Notes |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| CDN | `{{ "{{TODO}}" }}` | |
|
|
66
|
+
| DNS | `{{ "{{TODO}}" }}` | |
|
|
67
|
+
| TLS termination | `{{ "{{TODO}}" }}` | |
|
|
68
|
+
| WAF | `{{ "{{TODO}}" }}` | |
|
|
69
|
+
|
|
70
|
+
### Build / deploy
|
|
71
|
+
|
|
72
|
+
| Component | Technology | Notes |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| CI/CD | {{ciSystem}} | Pipelines defined in `.github/`, `.gitlab/`, or `bitbucket-pipelines.yml` |
|
|
75
|
+
| Container registry | `{{ "{{TODO}}" }}` | |
|
|
76
|
+
| Runtime platform | `{{ "{{TODO: Kubernetes / ECS / Fargate / nomad / SSH}}" }}` | |
|
|
77
|
+
| Infrastructure as code | `{{ "{{TODO: Terraform / Pulumi / CloudFormation / none}}" }}` | |
|
|
78
|
+
|
|
79
|
+
## Environments
|
|
80
|
+
|
|
81
|
+
| Environment | URL | Purpose |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| Local | https://{{projectDomain}} | Day-to-day development |
|
|
84
|
+
| Development | https://{{projectDevDomain}} | Integration / QA |
|
|
85
|
+
| Staging | https://{{projectStagingDomain}} | Pre-production validation |
|
|
86
|
+
| Production | https://{{projectProductionDomain}} | Live |
|
|
87
|
+
|
|
88
|
+
Each non-local environment auto-deploys from a long-lived git branch —
|
|
89
|
+
see [Deploy-Pipeline](./Deploy-Pipeline.md).
|
|
90
|
+
|
|
91
|
+
## Decision log
|
|
92
|
+
|
|
93
|
+
When making a stack decision, record it as an ADR (Architecture Decision
|
|
94
|
+
Record) under `docs/decisions/`. Each ADR captures **context, options
|
|
95
|
+
considered, decision, trade-offs, and revisit criteria**. ADRs let
|
|
96
|
+
future you understand *why* the architecture looks the way it does.
|
|
97
|
+
|
|
98
|
+
`{{ "{{TODO: create docs/decisions/ and add ADR-001 for the first major decision}}" }}`
|
|
99
|
+
|
|
100
|
+
## Cross-cutting concerns
|
|
101
|
+
|
|
102
|
+
- **Authentication / authorization**: `{{ "{{TODO}}" }}`
|
|
103
|
+
- **Background jobs**: `{{ "{{TODO: Action Scheduler / queue worker / cron}}" }}`
|
|
104
|
+
- **Search**: `{{ "{{TODO: native MySQL / Elasticsearch / Algolia}}" }}`
|
|
105
|
+
- **Email**: `{{ "{{TODO: SMTP provider / transactional service}}" }}`
|
|
106
|
+
- **Secrets management**: `{{ "{{TODO: env vars / Vault / cloud secret manager}}" }}`
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Deploy Pipeline
|
|
2
|
+
|
|
3
|
+
CI/CD flow for **{{projectTitle}}** — what runs on each push, where it
|
|
4
|
+
deploys, and how to debug a failed run.
|
|
5
|
+
|
|
6
|
+
## Stack
|
|
7
|
+
|
|
8
|
+
- **CI/CD platform**: {{ciSystem}}
|
|
9
|
+
- **Repository**: [{{repositoryPath}}]({{repositoryWebUrl}})
|
|
10
|
+
- **Deploy strategy**: `{{ "{{TODO: Docker push + remote pull / SSH rsync / Kubernetes apply / serverless deploy}}" }}`
|
|
11
|
+
|
|
12
|
+
## Environments and triggers
|
|
13
|
+
|
|
14
|
+
| Branch | Environment | URL | Auto-deploy |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| `development` | Development | https://{{projectDevDomain}} | Yes |
|
|
17
|
+
| `staging` | Staging | https://{{projectStagingDomain}} | Yes |
|
|
18
|
+
| `main` | Production | https://{{projectProductionDomain}} | `{{ "{{TODO: yes / requires manual approval}}" }}` |
|
|
19
|
+
|
|
20
|
+
Tags (`vX.Y.Z`) cut releases. `{{ "{{TODO: clarify whether tags promote to production or just create artefacts}}" }}`
|
|
21
|
+
|
|
22
|
+
## Pipeline stages
|
|
23
|
+
|
|
24
|
+
```mermaid
|
|
25
|
+
graph LR
|
|
26
|
+
A[Push / {{prTermShort}}] --> B[Lint]
|
|
27
|
+
B --> C[Test]
|
|
28
|
+
C --> D[Build]
|
|
29
|
+
D --> E{Branch?}
|
|
30
|
+
E -- development --> F[Deploy dev]
|
|
31
|
+
E -- staging --> G[Deploy staging]
|
|
32
|
+
E -- main --> H[Deploy production]
|
|
33
|
+
F --> I[Smoke check]
|
|
34
|
+
G --> I
|
|
35
|
+
H --> I
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Lint
|
|
39
|
+
|
|
40
|
+
- ESLint, Stylelint, Prettier (from the `lint` module of wp-kit).
|
|
41
|
+
{{#if useSage}}- Laravel Pint on the Sage theme.
|
|
42
|
+
{{/if}}- Commitlint on the {{prTermShort}} title and commits.
|
|
43
|
+
|
|
44
|
+
### Test
|
|
45
|
+
|
|
46
|
+
- `{{ "{{TODO: Pest / PHPUnit suite}}" }}`
|
|
47
|
+
- Playwright E2E specs under `tests/e2e/`.
|
|
48
|
+
|
|
49
|
+
### Build
|
|
50
|
+
|
|
51
|
+
- `composer install --no-dev --optimize-autoloader`
|
|
52
|
+
{{#if useSage}}- `npm ci && npm run build` inside `content/themes/{{projectName}}`
|
|
53
|
+
{{/if}}- Image build: `{{ "{{TODO: docker build / no image, deploy artefact directly}}" }}`
|
|
54
|
+
|
|
55
|
+
### Deploy
|
|
56
|
+
|
|
57
|
+
`{{ "{{TODO: describe deploy mechanism per environment. Examples:}}" }}`
|
|
58
|
+
|
|
59
|
+
- *Docker push + remote pull*: build, push to `{{ "{{TODO: registry}}" }}`, SSH to remote, `docker compose pull && docker compose up -d`.
|
|
60
|
+
- *Kubernetes*: `kubectl apply -f k8s/<env>/` (or `helm upgrade --install`).
|
|
61
|
+
- *Cloud-managed (ECS / Cloud Run / App Runner)*: trigger service update with new image tag.
|
|
62
|
+
- *SSH rsync*: `rsync -av --delete ./ user@host:/var/www/{{projectName}}/`.
|
|
63
|
+
|
|
64
|
+
## Secrets
|
|
65
|
+
|
|
66
|
+
`{{ "{{TODO: list secret variable names used by the pipeline and where they live (GitHub Secrets / GitLab CI variables / Vault / cloud secret manager). Do NOT paste secret values into this file.}}" }}`
|
|
67
|
+
|
|
68
|
+
## Debugging a failed run
|
|
69
|
+
|
|
70
|
+
1. Open the run in {{ciSystem}}.
|
|
71
|
+
2. Find the first failing step — later steps usually fail as a consequence.
|
|
72
|
+
3. For test/lint failures: reproduce locally with the same command from the workflow file.
|
|
73
|
+
4. For deploy failures: check the target environment's logs (`{{ "{{TODO: link to log dashboard}}" }}`).
|
|
74
|
+
5. For flaky failures: re-run the failed job. If it passes, file a ticket — flakiness compounds.
|
|
75
|
+
|
|
76
|
+
## Rolling back
|
|
77
|
+
|
|
78
|
+
`{{ "{{TODO: describe rollback procedure. Common patterns:}}" }}`
|
|
79
|
+
|
|
80
|
+
- Re-run the deploy job pinned to the previous tag / image SHA.
|
|
81
|
+
- Re-deploy by clicking "redeploy" on the prior successful run in {{ciSystem}}.
|
|
82
|
+
- `kubectl rollout undo deployment/<name>` for Kubernetes.
|
|
83
|
+
- Restore from the most recent database backup if the rollback also reverts data.
|
|
84
|
+
|
|
85
|
+
Document the rollback you actually used in the post-mortem.
|