You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/posts/vibe-coding.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,22 @@ Finally. Real matches. Real odds. The agent had switched APIs four times without
160
160
If I had spent five minutes reading each API's pricing page before diving in, I would've skipped the first three and saved some tokens. But this is the tradeoff with agentic engineering — the iteration speed is so fast that "just try it" is often cheaper than "research it first." Sometimes you burn some cents figuring that out.
161
161
At this point I had this user flow: open the app → see upcoming matches with real odds → pick a match → pick a prediction → place a bet → see it in the shared bet list.
162
162
163
+
## The admin backdoor
164
+
165
+
I needed a way to sync match data without exposing it to users.
166
+
167
+
> _"Let's expose administrative endpoints inside admin/ which can be only accessed using a super secret token, this is our little backdoor. Add the sync action there."_
168
+
169
+
The agent:
170
+
- Created an `AdminAuth` extractor in Rust that checks an `X-Admin-Token` header
171
+
- Moved the sync endpoint to `POST /admin/events/sync`
172
+
- Removed the old public sync route and the frontend button
173
+
- Added `ADMIN_TOKEN` to the environment variables
174
+
175
+
This was a deliberate shortcut. The plan had a whole phase for background workers — a Tokio task that would auto-sync events and resolve bets on a loop. But Render's free tier spins down after 15 minutes of inactivity, which kills any long-running process. Until I upgrade or set up cron jobs, a `curl` one-liner does the job. The endpoint is ready to be called by anything — a cron job, a Render Cron Job, or just me hitting it manually before matchday.
176
+
177
+

178
+
163
179
## Polish that matters
164
180
165
181
This is where vibe coding really shines. Instead of spending hours tweaking CSS, I just said things like:
@@ -205,22 +221,6 @@ The agent wrote ImageMagick commands to floodfill the background to transparent,
I needed a way to sync match data without exposing it to users.
211
-
212
-
> _"Let's expose administrative endpoints inside admin/ which can be only accessed using a super secret token, this is our little backdoor. Add the sync action there."_
213
-
214
-
The agent:
215
-
- Created an `AdminAuth` extractor in Rust that checks an `X-Admin-Token` header
216
-
- Moved the sync endpoint to `POST /admin/events/sync`
217
-
- Removed the old public sync route and the frontend button
218
-
- Added `ADMIN_TOKEN` to the environment variables
219
-
220
-
This was a deliberate shortcut. The plan had a whole phase for background workers — a Tokio task that would auto-sync events and resolve bets on a loop. But Render's free tier spins down after 15 minutes of inactivity, which kills any long-running process. Until I upgrade or set up cron jobs, a `curl` one-liner does the job. The endpoint is ready to be called by anything — a cron job, a Render Cron Job, or just me hitting it manually before matchday.
221
-
222
-

Copy file name to clipboardExpand all lines: src/pt-br/posts/vibe-coding.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,23 @@ Se eu tivesse gastado cinco minutos lendo a página de preços de cada API antes
165
165
166
166
Neste ponto eu tinha este fluxo de usuário: abrir o app → ver partidas futuras com odds reais → escolher uma partida → escolher um palpite → fazer uma aposta → vê-la na lista compartilhada de apostas.
167
167
168
+
169
+
## A backdoor administrativa
170
+
171
+
Eu precisava de uma forma de sincronizar dados de partidas sem expor isso aos usuários.
172
+
173
+
> _"Let's expose administrative endpoints inside admin/ which can be only accessed using a super secret token, this is our little backdoor. Add the sync action there."_
174
+
175
+
O agente:
176
+
- Criou um extrator `AdminAuth` em Rust que verifica um header `X-Admin-Token`
177
+
- Moveu o endpoint de sincronização para `POST /admin/events/sync`
178
+
- Removeu a antiga rota pública de sincronização e o botão do frontend
179
+
- Adicionou `ADMIN_TOKEN` às variáveis de ambiente
180
+
181
+
Este foi um atalho deliberado. O plano tinha uma fase inteira para workers em background — uma tarefa Tokio que faria auto-sync de eventos e resolveria apostas em loop. Mas o plano gratuito do Render desliga após 15 minutos de inatividade, o que mata qualquer processo de longa duração. Até eu fazer upgrade ou configurar cron jobs, um one-liner `curl` resolve. O endpoint está pronto para ser chamado por qualquer coisa — um cron job, um Render Cron Job, ou só eu acionando manualmente antes da rodada.
182
+
183
+

184
+
168
185
## Polimento que importa
169
186
170
187
É aqui que o vibe coding realmente brilha. Em vez de passar horas ajustando CSS, eu simplesmente dizia coisas como:
@@ -212,23 +229,6 @@ O agente escreveu comandos ImageMagick para floodfill do fundo para transparente
212
229

213
230
214
231

215
-
216
-
## A backdoor administrativa
217
-
218
-
Eu precisava de uma forma de sincronizar dados de partidas sem expor isso aos usuários.
219
-
220
-
> _"Let's expose administrative endpoints inside admin/ which can be only accessed using a super secret token, this is our little backdoor. Add the sync action there."_
221
-
222
-
O agente:
223
-
- Criou um extrator `AdminAuth` em Rust que verifica um header `X-Admin-Token`
224
-
- Moveu o endpoint de sincronização para `POST /admin/events/sync`
225
-
- Removeu a antiga rota pública de sincronização e o botão do frontend
226
-
- Adicionou `ADMIN_TOKEN` às variáveis de ambiente
227
-
228
-
Este foi um atalho deliberado. O plano tinha uma fase inteira para workers em background — uma tarefa Tokio que faria auto-sync de eventos e resolveria apostas em loop. Mas o plano gratuito do Render desliga após 15 minutos de inatividade, o que mata qualquer processo de longa duração. Até eu fazer upgrade ou configurar cron jobs, um one-liner `curl` resolve. O endpoint está pronto para ser chamado por qualquer coisa — um cron job, um Render Cron Job, ou só eu acionando manualmente antes da rodada.
229
-
230
-

231
-
232
232
## Enviando para produção
233
233
234
234
Então, pulando direto para a última fase do plano:
0 commit comments