Skip to content

Commit 37b8108

Browse files
committed
Fix post section
1 parent eda43ad commit 37b8108

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

src/posts/vibe-coding.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,22 @@ Finally. Real matches. Real odds. The agent had switched APIs four times without
160160
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.
161161
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.
162162

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+
![Syncing events via the admin endpoint](/assets/images/vibe-events.jpeg)
178+
163179
## Polish that matters
164180

165181
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,
205221

206222
![Mobile responsive view](/assets/images/vibe-bet-mobile.png)
207223

208-
## The admin backdoor
209-
210-
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-
![Syncing events via the admin endpoint](/assets/images/vibe-events.jpeg)
223-
224224
## Shipping to production
225225

226226
Then, jumping straight to the plan's last phase:

src/pt-br/posts/vibe-coding.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,23 @@ Se eu tivesse gastado cinco minutos lendo a página de preços de cada API antes
165165

166166
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.
167167

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+
![Sincronizando eventos via endpoint admin](/assets/images/vibe-events.jpeg)
184+
168185
## Polimento que importa
169186

170187
É 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
212229
![Fazendo uma aposta com barra de previsão](/assets/images/vibe-bet-desktop.png)
213230

214231
![Visualização mobile responsiva](/assets/images/vibe-bet-mobile.png)
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-
![Sincronizando eventos via endpoint admin](/assets/images/vibe-events.jpeg)
231-
232232
## Enviando para produção
233233

234234
Então, pulando direto para a última fase do plano:

0 commit comments

Comments
 (0)