<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hsu.J.Huang </title>
    <description>The latest articles on DEV Community by Hsu.J.Huang  (@jhuang_hsu_82b2c67916c343).</description>
    <link>https://dev.to/jhuang_hsu_82b2c67916c343</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3284065%2Fe1b07ab3-10d2-4741-898f-469cd7f073c9.jpg</url>
      <title>DEV Community: Hsu.J.Huang </title>
      <link>https://dev.to/jhuang_hsu_82b2c67916c343</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jhuang_hsu_82b2c67916c343"/>
    <language>en</language>
    <item>
      <title>Why I Choose Next.js + Spring Boot for My Solo SaaS Project</title>
      <dc:creator>Hsu.J.Huang </dc:creator>
      <pubDate>Sun, 22 Jun 2025 15:45:00 +0000</pubDate>
      <link>https://dev.to/jhuang_hsu_82b2c67916c343/why-i-choose-nextjs-spring-boot-for-my-solo-saas-project-399n</link>
      <guid>https://dev.to/jhuang_hsu_82b2c67916c343/why-i-choose-nextjs-spring-boot-for-my-solo-saas-project-399n</guid>
      <description>&lt;p&gt;Hey Devs 👋&lt;/p&gt;

&lt;p&gt;Over the past few months, I’ve been building my solo SaaS project and wanted to share some reflections — especially about the &lt;strong&gt;tech stack&lt;/strong&gt; I chose.&lt;/p&gt;

&lt;p&gt;While most indie hackers lean on lightweight setups like Node.js or Python, I decided to take a less-traveled path: combining &lt;strong&gt;Next.js&lt;/strong&gt; and &lt;strong&gt;Spring Boot&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here's why I went with this setup — and what I learned along the way.&lt;/p&gt;




&lt;h2&gt;
  
  
  1️⃣ Why I Still Used Full-Stack Next.js 🤗
&lt;/h2&gt;

&lt;p&gt;Even though my backend is built with Spring Boot, I still made full use of &lt;strong&gt;Next.js’s server actions&lt;/strong&gt; and full-stack features.&lt;/p&gt;

&lt;p&gt;Rather than calling the Spring Boot API directly from the browser, I routed &lt;strong&gt;all API calls through Next.js server components&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This approach gave me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Server-side execution only (no client-side leaks)&lt;/li&gt;
&lt;li&gt;✅ Invisible API calls in the browser network tab&lt;/li&gt;
&lt;li&gt;✅ No CORS headaches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helped me build a more unified and secure architecture.&lt;/p&gt;

&lt;p&gt;But of course, there’s a tradeoff:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The frontend logic became more complex, and managing cookies/headers required extra attention.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fma4uwl0hsgmpizrq29ya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fma4uwl0hsgmpizrq29ya.png" alt="API call flow between Next.js and Spring Boot" width="559" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Rough flow of how I handle requests in Next.js + Spring Boot)&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2️⃣ Why I Chose Spring Boot 🤔
&lt;/h2&gt;

&lt;p&gt;I’m fluent in both &lt;strong&gt;Java&lt;/strong&gt; and &lt;strong&gt;Python&lt;/strong&gt;, but when building a product I plan to maintain, I leaned toward a &lt;strong&gt;strongly typed&lt;/strong&gt;, structured framework.&lt;/p&gt;

&lt;p&gt;Spring Boot stood out for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Well-defined RESTful APIs&lt;/li&gt;
&lt;li&gt;✅ Industry-grade security via Spring Security&lt;/li&gt;
&lt;li&gt;✅ Easy integrations with cloud services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s not the fastest way to prototype, but the structure forced me to think deeply about architecture and domain modeling.&lt;/p&gt;

&lt;p&gt;I also modularized key logic into &lt;strong&gt;Spring Boot starters&lt;/strong&gt;, so I can reuse them in future projects regardless of this product’s outcome.&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Pitfalls Along the Way 😵
&lt;/h2&gt;

&lt;p&gt;It wasn’t all smooth sailing. Some surprises:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🍪 &lt;strong&gt;Setting cookies from Spring Boot didn’t work&lt;/strong&gt; &lt;br&gt;
I had to proxy responses through Next.js API routes to manually set JWT cookies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔁 &lt;strong&gt;Server-Sent Events (SSE)&lt;/strong&gt; support is messy in this setup&lt;br&gt;&lt;br&gt;
Not a dealbreaker, but definitely a constraint to watch out for.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4️⃣ Solo Deployment with Terraform 🧱
&lt;/h2&gt;

&lt;p&gt;I have an AWS SAA cert, but deployment is still... painful 😅&lt;/p&gt;

&lt;p&gt;To manage infra cleanly, I used &lt;strong&gt;Terraform&lt;/strong&gt;, which helped me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep dev/prod environments consistent&lt;/li&gt;
&lt;li&gt;Easily destroy and rebuild the stack (save AWS costs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I ended up putting &lt;strong&gt;Fargate tasks in a public subnet&lt;/strong&gt;, because &lt;strong&gt;VPC endpoints were too expensive&lt;/strong&gt; for my MVP.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9nga95qnruo8gav79jr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9nga95qnruo8gav79jr.png" alt="Infrastructure Diagram" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ Final Thoughts ✨
&lt;/h2&gt;

&lt;p&gt;Would I do it again? Mostly yes.&lt;/p&gt;

&lt;p&gt;But next time I’d consider simplifying the frontend architecture — especially around auth and API routing.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;p&gt;🚀 I'm building &lt;strong&gt;Fenixs&lt;/strong&gt;, an AI-powered platform for storytellers and filmmakers — helping them go from &lt;strong&gt;idea 💡 to script ✍️ to visual layout 🎞️&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Would love to hear how others have approached similar stacks or tackled API routing with hybrid architectures like this 🙌&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>springboot</category>
      <category>fullstack</category>
    </item>
  </channel>
</rss>
