Hey Devs ๐
Over the past few months, Iโve been building my solo SaaS project and wanted to share some reflections โ especially about the tech stack I chose.
While most indie hackers lean on lightweight setups like Node.js or Python, I decided to take a less-traveled path: combining Next.js and Spring Boot.
Here's why I went with this setup โ and what I learned along the way.
1๏ธโฃ Why I Still Used Full-Stack Next.js ๐ค
Even though my backend is built with Spring Boot, I still made full use of Next.jsโs server actions and full-stack features.
Rather than calling the Spring Boot API directly from the browser, I routed all API calls through Next.js server components.
This approach gave me:
- โ Server-side execution only (no client-side leaks)
- โ Invisible API calls in the browser network tab
- โ No CORS headaches
This helped me build a more unified and secure architecture.
But of course, thereโs a tradeoff:
The frontend logic became more complex, and managing cookies/headers required extra attention.
(Rough flow of how I handle requests in Next.js + Spring Boot)
2๏ธโฃ Why I Chose Spring Boot ๐ค
Iโm fluent in both Java and Python, but when building a product I plan to maintain, I leaned toward a strongly typed, structured framework.
Spring Boot stood out for:
- โ Well-defined RESTful APIs
- โ Industry-grade security via Spring Security
- โ Easy integrations with cloud services
Itโs not the fastest way to prototype, but the structure forced me to think deeply about architecture and domain modeling.
I also modularized key logic into Spring Boot starters, so I can reuse them in future projects regardless of this productโs outcome.
3๏ธโฃ Pitfalls Along the Way ๐ต
It wasnโt all smooth sailing. Some surprises:
๐ช Setting cookies from Spring Boot didnโt work
I had to proxy responses through Next.js API routes to manually set JWT cookies.๐ Server-Sent Events (SSE) support is messy in this setup
Not a dealbreaker, but definitely a constraint to watch out for.
4๏ธโฃ Solo Deployment with Terraform ๐งฑ
I have an AWS SAA cert, but deployment is still... painful ๐
To manage infra cleanly, I used Terraform, which helped me:
- Keep dev/prod environments consistent
- Easily destroy and rebuild the stack (save AWS costs)
I ended up putting Fargate tasks in a public subnet, because VPC endpoints were too expensive for my MVP.
5๏ธโฃ Final Thoughts โจ
Would I do it again? Mostly yes.
But next time Iโd consider simplifying the frontend architecture โ especially around auth and API routing.
Still, Iโm glad I chose this stack. It gave me deeper experience with both frameworks and left me with reusable modules for future projects.
๐ I'm building Fenixs, an AI-powered platform for storytellers and filmmakers โ helping them go from idea ๐ก to script โ๏ธ to visual layout ๐๏ธ.
Thanks for reading! Would love to hear how others have approached similar stacks or tackled API routing with hybrid architectures like this ๐


Top comments (0)