Hey folks! ๐
As a solo developer building for the global market, balancing performance, shipping speed, and server costs is always a tricky triangle. Recently, I launched my new AI project, wan2-7.io, and I wanted to share the exact tech stack and architecture I used to bring it to life without breaking the bank.
If you are looking to build a full-stack AI SaaS, I hope this breakdown saves you some time and headache. Let's dive in! ๐
๐ ๏ธ The Tech Stack
I needed a stack that allowed me to move fast on the frontend, handle heavy AI inference tasks smoothly on the backend, and keep hosting costs extremely low.
Frontend: Next.js (App Router) + Tailwind CSS
Backend: Python + FastAPI
Infrastructure: Hetzner Cloud + Dokploy (Self-hosted PaaS)
Database: PostgreSQL
- The Frontend: Next.js + Tailwind CSS For the user interface, Next.js is my go-to. Since wan2-7.io relies heavily on visual outputs and smooth user interactions, I needed something that handles state well while still being great for SEO.
Tailwind CSS made it incredibly fast to style the components. One of the biggest challenges in AI apps is the waiting stateโwhen the user hits "Generate", you need to keep them engaged. I used some clean Tailwind animations to build the loading skeletons.
JavaScript
// [Optional: Insert a small, cool React component snippet here,
// e.g., your loading state or how you handle the fetch request to your API]
- The Backend: FastAPI When it comes to wrapping AI models, Python is king. I chose FastAPI because it is incredibly fast, easy to write, and natively supports asynchronous programmingโwhich is mandatory when you are waiting for AI generation tasks to complete.
Instead of blocking the main thread, FastAPI handles the incoming requests, queues the tasks, and allows the Next.js frontend to poll for the result (or listen via Webhooks).
- The Secret Weapon for Solo Devs: Dokploy + Hetzner This is where I saved the most money and time. Instead of paying premium prices for Vercel, Heroku, or Render, I decided to self-host.
I spun up a cheap, high-performance VPS on Hetzner and installed Dokploy (an amazing open-source alternative to Vercel/Heroku). Dokploy connects directly to my GitHub repository. Now, whenever I push code, Dokploy automatically builds the Docker images and deploys my Next.js and FastAPI apps with zero downtime.
It gives me the "Vercel-like" developer experience but at a fraction of the cost, giving my indie hacking budget a lot more breathing room.
๐ก The Biggest Lesson Learned
The hardest part wasn't the UIโit was handling the async nature of AI generation.
Don't rely on long-polling if you can avoid it. * Always implement proper error handling on the frontend for when (not if) the AI provider times out.
Wrapping Up
Building wan2-7.io has been an awesome journey in optimizing both code and infrastructure. If you're an indie developer, I highly recommend giving the Dokploy + Hetzner combo a try for your next side project.
If you want to see how snappy this architecture feels in production, feel free to play around with the live app at wan2-7.io.
Let me know if you manage to break it, or if you have any questions about setting up Dokploy and FastAPI! I'll be hanging out in the comments. ๐
Top comments (0)