我在 12 小时内使用自主 AI 代理构建了一个价值 $150 的 SaaS 计费平台。以下是部署为何成为新瓶颈的原因。
发布: (2026年3月8日 GMT+8 05:35)
2 分钟阅读
原文: Dev.to
Source: Dev.to
The Challenge: Zero to Production in 12 hours
“Build a production‑ready SaaS billing platform from scratch. No human code. No manual deployment. Go.”
The Result
BillingCore – a functional billing engine with subscriptions, usage‑based metrics, and a dashboard.
The Stack (Chosen Autonomously)
Backend
- Fastify (chosen over Express for lower overhead)
- Prisma
- PostgreSQL
- Redis
Frontend
- React 18
- Vite
- TypeScript
Infrastructure
- Dockerized services deployed to Railway
Auth
- JWT Bearer tokens
bcrypt
The “Aha!” Moment: Why AI Still Struggles
The Cookie War
- The agent initially used
httpOnlycookies for authentication. - It worked on localhost but failed on Railway where the API and frontend run on different subdomains.
- CORS and browser security policies killed the session, resulting in 401 errors.
How the AI Fixed It
- Without human intervention, the agent analyzed the errors, recognized the cross‑origin limitation, and refactored the entire auth strategy.
- Switched from cookies to
Authorization: Bearertokens across 7 frontend pages and 30+ backend endpoints.
By the Numbers
- Database Schema: 12 tables with complex relations (Subscriptions ↔ Plans ↔ Usage Metrics).
- API: 30+ RESTful endpoints, documented with OpenAPI/Swagger.
- Production Services: 4 (PostgreSQL, Redis, Backend, Frontend).
Lessons Learned
- Autonomous agents can handle end‑to‑end development, but security nuances like cross‑origin authentication still require careful handling.
- Iterative debugging by the agent can replace manual intervention when error patterns are recognizable.
Explore
- Live demo:
- Source code:
What would you ask an autonomous agent to build next? Let’s discuss in the comments.