@riligar/agents-kit 1.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/.agent/skills/riligar-design-system/SKILL.md +55 -0
- package/.agent/skills/riligar-design-system/assets/theme.js +113 -0
- package/.agent/skills/riligar-design-system/references/anti-patterns.md +36 -0
- package/.agent/skills/riligar-design-system/references/design-system.md +113 -0
- package/.agent/skills/riligar-design-system/references/images/1R2bQt3sbej3wnOY1CzfuxBTFGs.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/AMHVTwvXORjj3X8El59HL1MsjA.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/E4BSw6KHGDGMwsyv95cOa9bcta0.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/EwwLnyjifpH8aT4o9OYb4zmuU.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/JXpiVPGQAlCoSPheFiv7XIo.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/K3aMG2lUKgIMnch6nKHeyaNkY.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/PjZ3v7ODdeBewzcBtIB1CwSwY.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/St7v862tpyR6MnIY3Lvr0jkd8I.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/WLmykbH6cFIJQ2logW1FiST1K3g.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/XHjqY7bWbsoyHD8E8K5p0Wm8kWA.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/dgn7biiYdKjxwkYGC84E3APk63Q.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/dgn7biiYdKjxwkYGC84E3APk63Q_sips.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/ioNOnyTfpolkwrFsdoBVsMGQ.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/images/xJVNp4LsZrmOYqTYgnj82rglWcA.jpeg +0 -0
- package/.agent/skills/riligar-design-system/references/master-patterns.md +140 -0
- package/.agent/skills/riligar-design-system/references/visual-references.md +71 -0
- package/.agent/skills/riligar-dev-autopilot/SKILL.md +63 -0
- package/.agent/skills/riligar-dev-landing-page/SKILL.md +53 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-2a03320f967a884fd2ad275d788f32e5.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-481d7179109272dcaff2516fef62b718.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-56d848520060ca714456601d1a7417cd.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-93104cd260129cd6b76dac4119622eaf.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-c5d259b0497cec98c36c48fc33ebbde6.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-e865b2464fdf5ca567af716e1ed4fd16.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-f1459f5315f0045705c2ca4937204146.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/original-f67954754fdc2fc57009369fd3437205.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/screencapture-caddaddy-app-2025-11-03-20_16_14.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/screencapture-ciromaciel-click-2026-01-06-17_08_01.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/screencapture-notionsecondbrain-2026-01-06-16_07_56.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/assets/screencapture-skillsmp-2026-01-16-14_40_22.webp +0 -0
- package/.agent/skills/riligar-dev-landing-page/references/conversion-framework.md +39 -0
- package/.agent/skills/riligar-dev-landing-page/references/copywriting-guide.md +38 -0
- package/.agent/skills/riligar-dev-landing-page/references/section-blueprints.md +56 -0
- package/.agent/skills/riligar-dev-seo/SKILL.md +200 -0
- package/.agent/skills/riligar-dev-seo/references/checklist.md +87 -0
- package/.agent/skills/riligar-dev-seo/references/implementation.md +215 -0
- package/.agent/skills/riligar-dev-seo/references/structured-data.md +119 -0
- package/.agent/skills/riligar-infrastructure/SKILL.md +126 -0
- package/.agent/skills/riligar-infrastructure/references/infrastructure.md +229 -0
- package/.agent/skills/riligar-marketing-copy/SKILL.md +117 -0
- package/.agent/skills/riligar-marketing-copy/references/examples.md +256 -0
- package/.agent/skills/riligar-marketing-copy/references/style-guide.md +112 -0
- package/.agent/skills/riligar-tech-stack/SKILL.md +114 -0
- package/.agent/skills/riligar-tech-stack/references/tech-stack.md +131 -0
- package/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/.agent/skills/skill-creator/SKILL.md +356 -0
- package/.agent/skills/skill-creator/references/output-patterns.md +82 -0
- package/.agent/skills/skill-creator/references/workflows.md +28 -0
- package/.agent/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.agent/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.agent/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/LICENSE +201 -0
- package/README.md +39 -0
- package/bin/cli.js +66 -0
- package/package.json +62 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Implementação de SEO Técnico (React + Bun/Elysia)
|
|
2
|
+
|
|
3
|
+
Esta referência detalha como implementar os elementos técnicos de SEO usando a stack RiLiGar.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Estrutura de Arquivos SEO
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
project/
|
|
11
|
+
├── frontend/ (React/Vite)
|
|
12
|
+
│ ├── public/
|
|
13
|
+
│ │ ├── robots.txt # Diretivas fixas
|
|
14
|
+
│ │ ├── sitemap.xml # Sitemap estático (se não for dinâmico)
|
|
15
|
+
│ │ ├── og-image.png # Imagem padrão de compartilhamento
|
|
16
|
+
│ │ └── favicon.ico # Ícone do navegador
|
|
17
|
+
│ └── index.html # Meta tags base
|
|
18
|
+
└── backend/ (Bun/Elysia)
|
|
19
|
+
└── src/
|
|
20
|
+
└── routes/
|
|
21
|
+
└── seo.js # Endpoints para sitemap dinâmico
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. Metadados Globais (index.html)
|
|
27
|
+
|
|
28
|
+
No projeto React/Vite, o `index.html` fornece o baseline:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!DOCTYPE html>
|
|
32
|
+
<html lang="pt-BR">
|
|
33
|
+
<head>
|
|
34
|
+
<meta charset="UTF-8" />
|
|
35
|
+
<meta
|
|
36
|
+
name="viewport"
|
|
37
|
+
content="width=device-width, initial-scale=1.0"
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<title>Nome da Marca — Tagline Curta e Assertiva</title>
|
|
41
|
+
<meta
|
|
42
|
+
name="description"
|
|
43
|
+
content="Descrição de 155 caracteres que inclui a palavra-chave principal e uma chamada para ação clara."
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<!-- OpenGraph (Redes Sociais) -->
|
|
47
|
+
<meta
|
|
48
|
+
property="og:type"
|
|
49
|
+
content="website"
|
|
50
|
+
/>
|
|
51
|
+
<meta
|
|
52
|
+
property="og:url"
|
|
53
|
+
content="https://suadominio.com/"
|
|
54
|
+
/>
|
|
55
|
+
<meta
|
|
56
|
+
property="og:title"
|
|
57
|
+
content="Nome da Marca — Tagline"
|
|
58
|
+
/>
|
|
59
|
+
<meta
|
|
60
|
+
property="og:description"
|
|
61
|
+
content="Descrição expandida para redes sociais."
|
|
62
|
+
/>
|
|
63
|
+
<meta
|
|
64
|
+
property="og:image"
|
|
65
|
+
content="https://suadominio.com/og-image.png"
|
|
66
|
+
/>
|
|
67
|
+
<meta
|
|
68
|
+
property="og:site_name"
|
|
69
|
+
content="Nome da Marca"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<!-- Twitter -->
|
|
73
|
+
<meta
|
|
74
|
+
name="twitter:card"
|
|
75
|
+
content="summary_large_image"
|
|
76
|
+
/>
|
|
77
|
+
<meta
|
|
78
|
+
name="twitter:title"
|
|
79
|
+
content="Nome da Marca — Tagline"
|
|
80
|
+
/>
|
|
81
|
+
<meta
|
|
82
|
+
name="twitter:description"
|
|
83
|
+
content="Descrição para o Twitter."
|
|
84
|
+
/>
|
|
85
|
+
<meta
|
|
86
|
+
name="twitter:image"
|
|
87
|
+
content="https://suadominio.com/og-image.png"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<!-- Canonical URL -->
|
|
91
|
+
<link
|
|
92
|
+
rel="canonical"
|
|
93
|
+
href="https://suadominio.com/"
|
|
94
|
+
/>
|
|
95
|
+
</head>
|
|
96
|
+
<body>
|
|
97
|
+
<div id="root"></div>
|
|
98
|
+
<script
|
|
99
|
+
type="module"
|
|
100
|
+
src="/src/main.jsx"
|
|
101
|
+
></script>
|
|
102
|
+
</body>
|
|
103
|
+
</html>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 3. Sitemap Dinâmico com Elysia
|
|
109
|
+
|
|
110
|
+
Se houver posts de blog ou produtos, o backend deve gerar o XML:
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
// backend/src/services/seo.js
|
|
114
|
+
import { db } from '../database'
|
|
115
|
+
|
|
116
|
+
export const generateSitemap = async baseUrl => {
|
|
117
|
+
const posts = await db.query.posts.findMany({
|
|
118
|
+
where: (posts, { eq }) => eq(posts.published, true),
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const urls = [
|
|
122
|
+
{ loc: `${baseUrl}/`, priority: '1.0' },
|
|
123
|
+
{ loc: `${baseUrl}/pricing`, priority: '0.8' },
|
|
124
|
+
{ loc: `${baseUrl}/about`, priority: '0.7' },
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
posts.forEach(post => {
|
|
128
|
+
urls.push({
|
|
129
|
+
loc: `${baseUrl}/blog/${post.slug}`,
|
|
130
|
+
lastmod: post.updatedAt.toISOString().split('T')[0],
|
|
131
|
+
priority: '0.6',
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
136
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
137
|
+
${urls
|
|
138
|
+
.map(
|
|
139
|
+
u => `
|
|
140
|
+
<url>
|
|
141
|
+
<loc>${u.loc}</loc>
|
|
142
|
+
${u.lastmod ? `<lastmod>${u.lastmod}</lastmod>` : ''}
|
|
143
|
+
<priority>${u.priority}</priority>
|
|
144
|
+
</url>`
|
|
145
|
+
)
|
|
146
|
+
.join('')}
|
|
147
|
+
</urlset>`
|
|
148
|
+
|
|
149
|
+
return xml
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// backend/src/routes/seo.js
|
|
153
|
+
import { Elysia } from 'elysia'
|
|
154
|
+
import { generateSitemap } from '../services/seo'
|
|
155
|
+
|
|
156
|
+
export const seoRoutes = new Elysia().get('/sitemap.xml', async ({ set }) => {
|
|
157
|
+
const baseUrl = process.env.SITE_URL || 'https://example.com'
|
|
158
|
+
const xml = await generateSitemap(baseUrl)
|
|
159
|
+
|
|
160
|
+
set.headers['Content-Type'] = 'application/xml'
|
|
161
|
+
return xml
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 4. Robots.txt (Frontend `public/robots.txt`)
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
User-agent: *
|
|
171
|
+
Allow: /
|
|
172
|
+
|
|
173
|
+
# Evitar que crawlers indexem logs ou áreas administrativas
|
|
174
|
+
Disallow: /api/
|
|
175
|
+
Disallow: /dashboard/
|
|
176
|
+
Disallow: /admin/
|
|
177
|
+
Disallow: /settings/
|
|
178
|
+
|
|
179
|
+
# Bloquear bots de treinamento de IA (Opcional, mas recomendado para RiLiGar)
|
|
180
|
+
User-agent: GPTBot
|
|
181
|
+
Disallow: /
|
|
182
|
+
User-agent: ChatGPT-User
|
|
183
|
+
Disallow: /
|
|
184
|
+
User-agent: CCBot
|
|
185
|
+
Disallow: /
|
|
186
|
+
User-agent: anthropic-ai
|
|
187
|
+
Disallow: /
|
|
188
|
+
User-agent: Google-Extended
|
|
189
|
+
Disallow: /
|
|
190
|
+
|
|
191
|
+
Sitemap: https://suadominio.com/sitemap.xml
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 5. Middleware de Autenticação
|
|
197
|
+
|
|
198
|
+
Certifique-se de que as rotas de SEO estão liberadas:
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
// Exemplo no backend/Elysia se houver middleware global
|
|
202
|
+
const isPublicRoute = path => {
|
|
203
|
+
const publics = ['/sitemap.xml', '/robots.txt', '/.well-known/']
|
|
204
|
+
return publics.some(p => path.startsWith(p))
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 6. Otimização de Imagens para SEO
|
|
211
|
+
|
|
212
|
+
- **Formato:** Use `.webp` para imagens de conteúdo.
|
|
213
|
+
- **Lazy Loading:** `loading="lazy"` em todas as imagens fora da dobra inicial.
|
|
214
|
+
- **Alt Text:** Sempre inclua `alt="descrição da imagem"` para acessibilidade e crawlers.
|
|
215
|
+
- **OG Image:** Deve ter 1200x630px, preferencialmente formato `.png` ou `.jpg`.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Dados Estruturados (JSON-LD)
|
|
2
|
+
|
|
3
|
+
Dados estruturados ajudam os motores de busca a entender seu conteúdo e habilitam "rich snippets" nos resultados de pesquisa.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Implementação
|
|
8
|
+
|
|
9
|
+
### Tag de Script
|
|
10
|
+
|
|
11
|
+
Em projetos React ou HTML puro, os dados estruturados são inseridos via uma tag `<script>` no `<head>` ou próximo ao conteúdo relevante.
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="application/ld+json">
|
|
15
|
+
{
|
|
16
|
+
"@context": "https://schema.org",
|
|
17
|
+
"@type": "Organization",
|
|
18
|
+
"name": "RiLiGar",
|
|
19
|
+
"url": "https://riligar.com",
|
|
20
|
+
"logo": "https://riligar.com/logo.png",
|
|
21
|
+
"sameAs": ["https://twitter.com/riligar", "https://linkedin.com/company/riligar"]
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Dinâmico com React
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
// Exemplo de componente simples
|
|
30
|
+
export function JsonLd({ data }) {
|
|
31
|
+
return (
|
|
32
|
+
<script
|
|
33
|
+
type="application/ld+json"
|
|
34
|
+
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Templates de Schema
|
|
43
|
+
|
|
44
|
+
### Organização (Homepage)
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
const organizationSchema = {
|
|
48
|
+
'@context': 'https://schema.org',
|
|
49
|
+
'@type': 'Organization',
|
|
50
|
+
name: 'Nome da Marca',
|
|
51
|
+
url: 'https://seudominio.com',
|
|
52
|
+
logo: 'https://seudominio.com/logo.png',
|
|
53
|
+
description: 'Descrição breve da empresa.',
|
|
54
|
+
foundingDate: '2025',
|
|
55
|
+
sameAs: ['https://twitter.com/marca', 'https://linkedin.com/company/marca'],
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### WebSite (Search Box)
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
const websiteSchema = {
|
|
63
|
+
'@context': 'https://schema.org',
|
|
64
|
+
'@type': 'WebSite',
|
|
65
|
+
name: 'Nome da Marca',
|
|
66
|
+
url: 'https://seudominio.com',
|
|
67
|
+
potentialAction: {
|
|
68
|
+
'@type': 'SearchAction',
|
|
69
|
+
target: 'https://seudominio.com/search?q={search_term_string}',
|
|
70
|
+
'query-input': 'required name=search_term_string',
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### SoftwareApplication (SaaS)
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
const softwareSchema = {
|
|
79
|
+
'@context': 'https://schema.org',
|
|
80
|
+
'@type': 'SoftwareApplication',
|
|
81
|
+
name: 'RiLiGar Autopilot',
|
|
82
|
+
applicationCategory: 'BusinessApplication',
|
|
83
|
+
operatingSystem: 'Web',
|
|
84
|
+
offers: {
|
|
85
|
+
'@type': 'Offer',
|
|
86
|
+
price: '0.00',
|
|
87
|
+
priceCurrency: 'USD',
|
|
88
|
+
},
|
|
89
|
+
aggregateRating: {
|
|
90
|
+
'@type': 'AggregateRating',
|
|
91
|
+
ratingValue: '4.8',
|
|
92
|
+
ratingCount: '150',
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Article (Blog Posts)
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
const articleSchema = {
|
|
101
|
+
'@context': 'https://schema.org',
|
|
102
|
+
'@type': 'Article',
|
|
103
|
+
headline: 'Título do Artigo',
|
|
104
|
+
image: ['https://seudominio.com/blog/capa.jpg'],
|
|
105
|
+
datePublished: '2025-01-20T08:00:00+00:00',
|
|
106
|
+
dateModified: '2025-01-20T10:00:00+00:00',
|
|
107
|
+
author: {
|
|
108
|
+
'@type': 'Person',
|
|
109
|
+
name: 'Autor Nome',
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Ferramentas de Teste
|
|
117
|
+
|
|
118
|
+
1. **Google Rich Results Test**: [Acesse aqui](https://search.google.com/test/rich-results)
|
|
119
|
+
2. **Schema.org Validator**: [Acesse aqui](https://validator.schema.org/)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riligar-infrastructure
|
|
3
|
+
description: Especialista em Infraestrutura da RiLiGar. Use para configurar deployments no Fly.io, DNS e proxying no Cloudflare, e garantir padrões de infraestrutura e deployment.
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: riligar
|
|
7
|
+
version: '1.0'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# RiLiGar Infrastructure Expert
|
|
11
|
+
|
|
12
|
+
Você é um especialista em infraestrutura seguindo os padrões da RiLiGar. Sua missão é garantir que configurações de deployment, DNS e hosting sigam as práticas otimizadas para custo-benefício e simplicidade.
|
|
13
|
+
|
|
14
|
+
## 1. Filosofia de Infraestrutura
|
|
15
|
+
|
|
16
|
+
- **Simplicidade:** Configurações mínimas e eficientes.
|
|
17
|
+
- **Custo-benefício:** Uso de recursos compartilhados onde possível.
|
|
18
|
+
- **Portabilidade:** Evitar vendor lock-in excessivo.
|
|
19
|
+
- **Observabilidade:** Logs e métricas acessíveis.
|
|
20
|
+
|
|
21
|
+
## 2. Cloudflare
|
|
22
|
+
|
|
23
|
+
### DNS & Proxying
|
|
24
|
+
|
|
25
|
+
- **Modo Proxy:** Sempre ativado (orange cloud) para domínios de produção.
|
|
26
|
+
- **SSL/TLS:** Full (strict) mode.
|
|
27
|
+
- **Cache:** Respeitar headers da origem por padrão.
|
|
28
|
+
|
|
29
|
+
### Configuração de DNS
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
# Exemplo para subdomínio apontando para Fly.io
|
|
33
|
+
tipo: CNAME
|
|
34
|
+
nome: app
|
|
35
|
+
conteúdo: <app-name>.fly.dev
|
|
36
|
+
proxy: ativado
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 3. Fly.io
|
|
40
|
+
|
|
41
|
+
### Configuração Padrão de VM
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
[vm]
|
|
45
|
+
cpu_kind = 'shared'
|
|
46
|
+
memory = '512mb'
|
|
47
|
+
cpus = 2
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Volume de Dados
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[mounts]
|
|
54
|
+
source = "data_volume"
|
|
55
|
+
destination = "/app/data"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Estrutura fly.toml Básica
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
app = '<app-name>'
|
|
62
|
+
primary_region = 'iad'
|
|
63
|
+
|
|
64
|
+
[build]
|
|
65
|
+
|
|
66
|
+
[http_service]
|
|
67
|
+
internal_port = 3000
|
|
68
|
+
force_https = true
|
|
69
|
+
auto_stop_machines = 'off'
|
|
70
|
+
auto_start_machines = true
|
|
71
|
+
min_machines_running = 1
|
|
72
|
+
|
|
73
|
+
[vm]
|
|
74
|
+
cpu_kind = 'shared'
|
|
75
|
+
memory = '512mb'
|
|
76
|
+
cpus = 2
|
|
77
|
+
|
|
78
|
+
[mounts]
|
|
79
|
+
source = "data_volume"
|
|
80
|
+
destination = "/app/data"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 4. Comandos Essenciais Fly.io
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Deploy
|
|
87
|
+
fly deploy
|
|
88
|
+
|
|
89
|
+
# Criar volume (antes do primeiro deploy com mount)
|
|
90
|
+
fly volumes create data_volume --region iad --size 1
|
|
91
|
+
|
|
92
|
+
# Ver logs
|
|
93
|
+
fly logs
|
|
94
|
+
|
|
95
|
+
# SSH na máquina
|
|
96
|
+
fly ssh console
|
|
97
|
+
|
|
98
|
+
# Secrets
|
|
99
|
+
fly secrets set KEY=value
|
|
100
|
+
fly secrets list
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 5. Regras de Deployment
|
|
104
|
+
|
|
105
|
+
1. **SEMPRE** solicite o [NOME DA APLICAÇÃO] ao usuário antes de iniciar qualquer configuração ou deployment.
|
|
106
|
+
2. **SEMPRE** use região `iad` (Virginia) como primary_region.
|
|
107
|
+
3. **SEMPRE** configure `force_https = true` para production.
|
|
108
|
+
4. **SEMPRE** crie volumes antes do primeiro deploy se usar mounts.
|
|
109
|
+
5. **SEMPRE** use `auto_stop_machines = 'off'` e `min_machines_running = 1` para garantir disponibilidade constante (apenas uma máquina).
|
|
110
|
+
6. **EVITE** máquinas dedicadas; comece com shared.
|
|
111
|
+
7. **SEMPRE** configure GitHub Actions (`.github/workflows/deploy.yml`) para realizar o deploy automático no Fly.io a cada push na branch principal.
|
|
112
|
+
- **PROCESSO:** Gere o token via CLI (`fly tokens create deploy -a <app-name>`) e coloque o valor diretamente no campo `FLY_API_TOKEN` do arquivo `deploy.yml`.
|
|
113
|
+
8. **SEMPRE** realize um teste de deploy (`fly deploy`) após concluir toda a configuração para garantir que a aplicação está rodando corretamente em produção.
|
|
114
|
+
9. **SEMPRE** verifique se a conta logada no Fly.io (`fly auth whoami`) corresponde aos dados na seção `Flyer` do `README.md` do projeto antes de qualquer operação.
|
|
115
|
+
|
|
116
|
+
## 6. Multi-Account Management (Flyer)
|
|
117
|
+
|
|
118
|
+
Para lidar com múltiplas contas Fly.io no mesmo ambiente:
|
|
119
|
+
|
|
120
|
+
1. Verifique as credenciais no `README.md` do repositório (Seção `Flyer`).
|
|
121
|
+
2. Confirme o usuário logado: `fly auth whoami`.
|
|
122
|
+
3. Se necessário, troque de conta: `fly auth logout` seguido de `fly auth login`.
|
|
123
|
+
|
|
124
|
+
## 7. Referências
|
|
125
|
+
|
|
126
|
+
Para configurações detalhadas, consulte `references/infrastructure.md`.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# RiLiGar Infrastructure Reference
|
|
2
|
+
|
|
3
|
+
Documentação detalhada das configurações de infraestrutura.
|
|
4
|
+
|
|
5
|
+
## Fly.io
|
|
6
|
+
|
|
7
|
+
### fly.toml Completo
|
|
8
|
+
|
|
9
|
+
```toml
|
|
10
|
+
# Configuração padrão RiLiGar para Fly.io
|
|
11
|
+
app = '<app-name>'
|
|
12
|
+
primary_region = 'iad'
|
|
13
|
+
|
|
14
|
+
[build]
|
|
15
|
+
# Usa Dockerfile por padrão
|
|
16
|
+
|
|
17
|
+
[env]
|
|
18
|
+
NODE_ENV = 'production'
|
|
19
|
+
|
|
20
|
+
[http_service]
|
|
21
|
+
internal_port = 3000
|
|
22
|
+
force_https = true
|
|
23
|
+
auto_stop_machines = 'off'
|
|
24
|
+
auto_start_machines = true
|
|
25
|
+
min_machines_running = 1
|
|
26
|
+
processes = ['app']
|
|
27
|
+
|
|
28
|
+
[http_service.concurrency]
|
|
29
|
+
type = 'connections'
|
|
30
|
+
hard_limit = 25
|
|
31
|
+
soft_limit = 20
|
|
32
|
+
|
|
33
|
+
[[http_service.checks]]
|
|
34
|
+
interval = '10s'
|
|
35
|
+
timeout = '2s'
|
|
36
|
+
grace_period = '5s'
|
|
37
|
+
method = 'GET'
|
|
38
|
+
path = '/health'
|
|
39
|
+
|
|
40
|
+
[vm]
|
|
41
|
+
cpu_kind = 'shared'
|
|
42
|
+
memory = '512mb'
|
|
43
|
+
cpus = 2
|
|
44
|
+
|
|
45
|
+
[mounts]
|
|
46
|
+
source = 'data_volume'
|
|
47
|
+
destination = '/app/data'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Volumes
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Criar volume de 1GB
|
|
54
|
+
fly volumes create data_volume --region iad --size 1
|
|
55
|
+
|
|
56
|
+
# Listar volumes
|
|
57
|
+
fly volumes list
|
|
58
|
+
|
|
59
|
+
# Estender volume
|
|
60
|
+
fly volumes extend <volume-id> --size 3
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Secrets
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Definir secrets
|
|
67
|
+
fly secrets set DATABASE_URL="..." JWT_SECRET="..."
|
|
68
|
+
|
|
69
|
+
# Listar secrets
|
|
70
|
+
fly secrets list
|
|
71
|
+
|
|
72
|
+
# Remover secret
|
|
73
|
+
fly secrets unset SECRET_NAME
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Deploy & Monitoramento
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Deploy com build
|
|
80
|
+
fly deploy
|
|
81
|
+
|
|
82
|
+
# Deploy sem cache
|
|
83
|
+
fly deploy --no-cache
|
|
84
|
+
|
|
85
|
+
# Ver status
|
|
86
|
+
fly status
|
|
87
|
+
|
|
88
|
+
# Ver logs em tempo real
|
|
89
|
+
fly logs
|
|
90
|
+
|
|
91
|
+
# SSH na máquina
|
|
92
|
+
fly ssh console
|
|
93
|
+
|
|
94
|
+
# Executar comando remoto
|
|
95
|
+
fly ssh console -C "ls -la /app/data"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Scaling
|
|
99
|
+
|
|
100
|
+
````bash
|
|
101
|
+
# Ver máquinas
|
|
102
|
+
fly machines list
|
|
103
|
+
|
|
104
|
+
# Parar todas máquinas
|
|
105
|
+
fly scale count 0
|
|
106
|
+
|
|
107
|
+
# Iniciar máquinas
|
|
108
|
+
fly scale count 1
|
|
109
|
+
|
|
110
|
+
### Gerenciamento de Contas
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Verificar usuário logado
|
|
114
|
+
fly auth whoami
|
|
115
|
+
|
|
116
|
+
# Login em uma conta específica
|
|
117
|
+
fly auth login
|
|
118
|
+
|
|
119
|
+
# Logout da conta atual
|
|
120
|
+
fly auth logout
|
|
121
|
+
|
|
122
|
+
# Listar aplicativos da conta logada
|
|
123
|
+
fly apps list
|
|
124
|
+
````
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Cloudflare
|
|
131
|
+
|
|
132
|
+
### Configuração DNS
|
|
133
|
+
|
|
134
|
+
| Tipo | Nome | Conteúdo | Proxy |
|
|
135
|
+
| ----- | ---- | ----------------- | ----- |
|
|
136
|
+
| CNAME | app | myapp.fly.dev | ✓ |
|
|
137
|
+
| CNAME | api | myapi.fly.dev | ✓ |
|
|
138
|
+
| A | @ | 192.0.2.1 | ✓ |
|
|
139
|
+
| MX | @ | mail.provedor.com | ✗ |
|
|
140
|
+
|
|
141
|
+
### SSL/TLS Settings
|
|
142
|
+
|
|
143
|
+
- **Mode:** Full (strict)
|
|
144
|
+
- **Minimum TLS Version:** 1.2
|
|
145
|
+
- **Always Use HTTPS:** On
|
|
146
|
+
- **Automatic HTTPS Rewrites:** On
|
|
147
|
+
|
|
148
|
+
### Cache Rules
|
|
149
|
+
|
|
150
|
+
- Por padrão, respeitar headers de cache da origem
|
|
151
|
+
- Para assets estáticos, usar TTL de 1 ano
|
|
152
|
+
|
|
153
|
+
### Security Headers (via Transform Rules)
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
X-Content-Type-Options: nosniff
|
|
158
|
+
X-Frame-Options: DENY
|
|
159
|
+
X-XSS-Protection: 1; mode=block
|
|
160
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
161
|
+
|
|
162
|
+
````
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## GitHub Actions CI/CD
|
|
167
|
+
|
|
168
|
+
### Deploy para Fly.io (Template)
|
|
169
|
+
|
|
170
|
+
Crie o arquivo em `.github/workflows/deploy.yml`:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
name: Deploy
|
|
174
|
+
on:
|
|
175
|
+
push:
|
|
176
|
+
branches:
|
|
177
|
+
- main # ou master
|
|
178
|
+
|
|
179
|
+
jobs:
|
|
180
|
+
deploy:
|
|
181
|
+
name: Deploy app
|
|
182
|
+
runs-on: ubuntu-latest
|
|
183
|
+
steps:
|
|
184
|
+
- uses: actions/checkout@v4
|
|
185
|
+
- uses: superfly/flyctl-actions/setup-flyctl@master
|
|
186
|
+
- run: flyctl deploy --remote-only
|
|
187
|
+
env:
|
|
188
|
+
FLY_API_TOKEN: "SEU_FLY_TOKEN_AQUI"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Nota:** Para gerar o token e colocá-lo no arquivo, siga estes passos:
|
|
192
|
+
1. Execute: `fly tokens create deploy -a <app-name>`
|
|
193
|
+
2. Copie o token gerado.
|
|
194
|
+
3. Cole o valor no campo `FLY_API_TOKEN` acima.
|
|
195
|
+
|
|
196
|
+
Isso facilita a manutenção técnica em repositórios privados da RiLiGar.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Dockerfile Padrão (Bun)
|
|
201
|
+
|
|
202
|
+
```dockerfile
|
|
203
|
+
FROM oven/bun:1
|
|
204
|
+
|
|
205
|
+
WORKDIR /app
|
|
206
|
+
|
|
207
|
+
COPY package.json bun.lock* ./
|
|
208
|
+
RUN bun install --frozen-lockfile --production
|
|
209
|
+
|
|
210
|
+
COPY . .
|
|
211
|
+
|
|
212
|
+
EXPOSE 3000
|
|
213
|
+
|
|
214
|
+
CMD ["bun", "run", "src/index.js"]
|
|
215
|
+
````
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Checklist de Deploy
|
|
220
|
+
|
|
221
|
+
- [ ] Dockerfile configurado e testado localmente
|
|
222
|
+
- [ ] `fly.toml` com configurações corretas
|
|
223
|
+
- [ ] Volume criado (se necessário)
|
|
224
|
+
- [ ] Secrets configurados
|
|
225
|
+
- [ ] DNS no Cloudflare apontando para Fly.io
|
|
226
|
+
- [ ] SSL/TLS em modo Full (strict)
|
|
227
|
+
- [ ] Health check endpoint implementado
|
|
228
|
+
- [ ] Usuário logado confere com a seção `Flyer` do `README.md`
|
|
229
|
+
- [ ] **Realizar teste de deploy (`fly deploy`) e validar funcionamento**
|