<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nextjs on Tachera W Sasi, Backend &amp; Infra Engineer (Go, Self-Hosted, Observability)</title><link>https://tacherasasi.github.io/tags/nextjs/</link><description>Recent content in Nextjs on Tachera W Sasi, Backend &amp; Infra Engineer (Go, Self-Hosted, Observability)</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 19 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tacherasasi.github.io/tags/nextjs/index.xml" rel="self" type="application/rss+xml"/><item><title>I Moved All My React Apps Away From Next.js</title><link>https://tacherasasi.github.io/posts/i-moved-all-my-react-apps-away-from-next-js-b911eeb4809a/</link><pubDate>Mon, 19 Oct 2026 00:00:00 +0000</pubDate><guid>https://tacherasasi.github.io/posts/i-moved-all-my-react-apps-away-from-next-js-b911eeb4809a/</guid><description>&lt;p&gt;&lt;img src="https://cdn-images-1.medium.com/max/1024/1*weStifDcGA1TP8qTCCpA6g.png" alt="A React app architecture split between a plain Vite frontend and an independent backend"&gt;&lt;/p&gt;
&lt;p&gt;For a while, Next.js was &lt;em&gt;the&lt;/em&gt; framework for me.&lt;/p&gt;
&lt;p&gt;I started using it seriously toward the end of 2023. By 2024, I was deep into it. Almost every project I started was going to use Next.js, and if you asked me what framework to use for a React application, you probably already knew my answer.&lt;/p&gt;
&lt;p&gt;I really liked the App Router. I liked the file-based routing. I liked how everything fit together. Next.js was popular, the ecosystem was growing, and I was having a good time building with it.&lt;/p&gt;
&lt;p&gt;Then, somewhere after a year and a half of using it, I asked myself a question that made the whole thing a little awkward:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What am I actually using Next.js for?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The answer was mostly routing.&lt;/p&gt;
&lt;p&gt;And that was the beginning of the end.&lt;/p&gt;
&lt;h3 id="i-was-using-a-whole-framework-for-one-feature"&gt;I was using a whole framework for one feature&lt;/h3&gt;
&lt;p&gt;Let me be clear. I wasn’t struggling with Next.js. I wasn’t rage-quitting because of some mysterious hydration error at 2 AM. I genuinely enjoyed using it.&lt;/p&gt;
&lt;p&gt;But when I looked at the applications I was building, I noticed a pattern.&lt;/p&gt;
&lt;p&gt;Most of them had a React frontend and a separate backend. Sometimes the backend was written in Go. Sometimes NestJS. Sometimes something else entirely. I wanted my backend to be its own application, with its own architecture, deployment, and responsibilities.&lt;/p&gt;
&lt;p&gt;I wasn’t trying to build everything inside Next.js.&lt;/p&gt;
&lt;p&gt;I was building a frontend that talked to an API.&lt;/p&gt;
&lt;p&gt;And yet I was bringing in a framework with a whole collection of server-side features, rendering strategies, conventions, and abstractions when I wasn’t using much of them.&lt;/p&gt;
&lt;p&gt;Did I use SSR sometimes? Yes. But it wasn’t central to most of my applications.&lt;/p&gt;
&lt;p&gt;What I consistently wanted was much simpler:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;React for building the UI.&lt;/li&gt;
&lt;li&gt;File-based routing so my routes were easy to organize.&lt;/li&gt;
&lt;li&gt;A production build I could deploy as static assets.&lt;/li&gt;
&lt;li&gt;A clean way to communicate with my backend.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That was pretty much the list.&lt;/p&gt;
&lt;p&gt;I had been choosing the entire restaurant because I liked one item on the menu.&lt;/p&gt;
&lt;h3 id="enter-tanstack-router"&gt;Enter TanStack Router&lt;/h3&gt;
&lt;p&gt;Around the middle of 2025, I started experimenting with TanStack Router.&lt;/p&gt;
&lt;p&gt;My first serious use of it was &lt;a href="https://github.com/ekilie/beamdrop"&gt;BeamDrop&lt;/a&gt;, my self-hosted file storage project built around Go and React.&lt;/p&gt;
&lt;p&gt;The frontend lives in &lt;a href="https://github.com/ekilie/beamdrop/tree/main/static/frontend"&gt;static/frontend&lt;/a&gt;. That is the actual project setup, rather than some imaginary example I made for this blog.&lt;/p&gt;
&lt;p&gt;I wanted a frontend that could stay focused on the UI while the Go backend handled the application logic. TanStack Router gave me the routing experience I liked from Next.js without requiring me to adopt its entire application model.&lt;/p&gt;
&lt;p&gt;The part that immediately clicked was file-based routing.&lt;/p&gt;
&lt;p&gt;I could keep my routes organized as files, work with nested routes, and get type-safe navigation. The router plugin could generate the route tree, and automatic code splitting was available when I wanted it.&lt;/p&gt;
&lt;p&gt;All of this worked with React and Vite.&lt;/p&gt;
&lt;p&gt;The setup felt familiar, but there was less framework between me and the application I was building.&lt;/p&gt;
&lt;p&gt;And I liked that a lot.&lt;/p&gt;
&lt;h3 id="i-wanted-the-routing-not-the-whole-universe-haha"&gt;I wanted the routing, not the whole universe haha.&lt;/h3&gt;
&lt;p&gt;Here is a simplified example of the kind of route I wanted to write:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ts" data-lang="ts"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// src/routes/files.tsx
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createFileRoute&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;@tanstack/react-router&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Route&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createFileRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/files&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;component&lt;/span&gt;: &lt;span class="kt"&gt;FilesPage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;FilesPage() {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;My&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The file represents a route. The route renders a React component. Type information flows through the router, and I don’t have to maintain a massive collection of handwritten route definitions.&lt;/p&gt;
&lt;p&gt;For file-based routing, the Vite plugin handles generating the route tree:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ts" data-lang="ts"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// vite.config.ts
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;vite&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;@vitejs/plugin-react&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;tanstackRouter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;@tanstack/router-plugin/vite&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;plugins&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;tanstackRouter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;react&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;autoCodeSplitting&lt;/span&gt;: &lt;span class="kt"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is a minimal illustration of the setup, not a copy of BeamDrop’s complete configuration. The important part is that I get file-based routing and optional automatic code splitting without adopting a full-stack framework.&lt;/p&gt;
&lt;p&gt;TanStack Router also supports code-based routing, but file-based routing was the feature that initially attracted me. Its &lt;a href="https://tanstack.com/router/latest/docs/routing/file-based-routing"&gt;official routing documentation&lt;/a&gt; explains the approach in more detail.&lt;/p&gt;
&lt;p&gt;I wasn’t giving up structure. I was choosing a smaller set of tools to provide it.&lt;/p&gt;
&lt;h3 id="static-builds-are-a-feature-not-a-compromise"&gt;Static builds are a feature, not a compromise&lt;/h3&gt;
&lt;p&gt;One of my favorite parts of this setup is being able to build the frontend into static assets.&lt;/p&gt;
&lt;p&gt;For applications like BeamDrop, I don’t need the frontend to run a server-side React rendering process every time someone opens a page. I need the browser to load the application, display the interface, and communicate with the backend.&lt;/p&gt;
&lt;p&gt;Vite produces a build that can be served as ordinary HTML, CSS, and JavaScript files. Those assets can sit behind Nginx, a CDN, object storage, or whatever deployment arrangement makes sense for the project.&lt;/p&gt;
&lt;p&gt;My Go backend remains responsible for the actual application logic.&lt;/p&gt;
&lt;p&gt;That separation is useful to me. The frontend can be deployed independently, and I don’t have to run a Next.js server just to deliver a client-side application.&lt;/p&gt;
&lt;p&gt;There’s also less infrastructure to think about. I can build the frontend, serve the resulting files, and let the backend do its job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A frontend doesn’t automatically need a frontend server. Sometimes it just needs to be a folder of files.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Of course, a static build doesn’t mean the entire application is static. BeamDrop still needs its backend for things like authentication, file operations, and API requests. Static delivery simply means the frontend itself doesn’t need a runtime server to render its pages.&lt;/p&gt;
&lt;h3 id="then-i-stopped-using-nextjs-altogether"&gt;Then I stopped using Next.js altogether&lt;/h3&gt;
&lt;p&gt;After using TanStack Router on BeamDrop, I liked the experience enough that I started using the same approach on my other projects.&lt;/p&gt;
&lt;p&gt;Eventually, I stopped reaching for Next.js.&lt;/p&gt;
&lt;p&gt;Not for a week. Not for a small experiment. I haven’t used it for a project since I made that switch.&lt;/p&gt;
&lt;p&gt;Haha.&lt;/p&gt;
&lt;p&gt;I found that plain React, Vite, and TanStack Router covered what I actually needed. I could organize routes the way I wanted, keep the frontend separate from the backend, and deploy static builds without dragging along a server runtime that my applications didn’t require.&lt;/p&gt;
&lt;p&gt;My frontend development felt lighter. My applications felt responsive, and I spent less time thinking about framework-specific behavior and more time building the product.&lt;/p&gt;
&lt;p&gt;I haven’t conducted a controlled benchmark across all my projects, so I’m not going to claim that TanStack Router magically makes every application faster or uses a fixed percentage less RAM. That’s not the point.&lt;/p&gt;
&lt;p&gt;The point is that &lt;strong&gt;the simpler setup fits my applications better&lt;/strong&gt;, and the performance and resource usage I’ve observed have reinforced that choice.&lt;/p&gt;
&lt;h3 id="apparently-other-people-have-been-asking-the-same-question"&gt;Apparently, other people have been asking the same question&lt;/h3&gt;
&lt;p&gt;I thought this was mostly a personal preference until I came across other teams making similar decisions.&lt;/p&gt;
&lt;p&gt;In April 2026, Railway published &lt;a href="https://blog.railway.com/p/moving-railways-frontend-off-nextjs"&gt;a detailed account of moving its production frontend off Next.js&lt;/a&gt;. Its dashboard, canvas, and website moved to Vite and TanStack Router.&lt;/p&gt;
&lt;p&gt;Their reasons weren’t identical to mine. Railway had a much larger application, build times exceeding ten minutes, and a frontend dominated by client-side interactions and real-time features. They wanted a faster development loop and a framework that better matched the architecture of their product.&lt;/p&gt;
&lt;p&gt;They reported that builds that had taken more than ten minutes were finishing in under two minutes after the migration.&lt;/p&gt;
&lt;p&gt;That doesn’t mean every Next.js project has slow builds. It means Railway’s team found that the costs of their particular setup had stopped making sense.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://appwrite.io/blog/post/why-developers-leaving-nextjs-tanstack-start"&gt;Appwrite also discussed the growing interest in TanStack Start&lt;/a&gt;, including the desire for a lighter, more explicit development experience.&lt;/p&gt;
&lt;p&gt;These are different projects with different requirements, and Railway’s migration to TanStack Router should not be confused with Appwrite’s discussion of TanStack Start. But the broader question is familiar: are we choosing a framework because its features solve our problems, or because it has become the default answer?&lt;/p&gt;
&lt;p&gt;I don’t think Next.js is suddenly bad. I think developers are getting more comfortable questioning whether they need everything it provides.&lt;/p&gt;
&lt;p&gt;I know I did.&lt;/p&gt;
&lt;h3 id="i-dont-hate-nextjs"&gt;I don’t hate Next.js&lt;/h3&gt;
&lt;p&gt;I want to make this distinction because framework discussions can become unnecessarily religious.&lt;/p&gt;
&lt;p&gt;Next.js is a good framework. It has a large ecosystem, strong rendering capabilities, and useful conventions. If I’m building a content-heavy website that benefits from server rendering, or an application where I genuinely want React rendering and backend-for-frontend logic in one framework, Next.js can make a lot of sense.&lt;/p&gt;
&lt;p&gt;It also supports static exports, so even the idea that Next.js always requires a runtime server would be wrong. The framework offers more than one deployment model.&lt;/p&gt;
&lt;p&gt;But that doesn’t mean I need to choose it for every React application.&lt;/p&gt;
&lt;p&gt;My backend is often a separate service. My frontend is often a client-side application. My data comes from APIs, and I want to control how those APIs are designed and deployed.&lt;/p&gt;
&lt;p&gt;I don’t need to put my Go backend inside a React framework just because the framework can handle server-side work.&lt;/p&gt;
&lt;p&gt;And I don’t need to use a full-stack framework just because I want file-based routing.&lt;/p&gt;
&lt;p&gt;Those are two separate decisions.&lt;/p&gt;
&lt;p&gt;For my projects, I prefer to make them separately.&lt;/p&gt;
&lt;h3 id="my-stack-is-boring-now-and-i-like-it"&gt;My stack is boring now, and I like it&lt;/h3&gt;
&lt;p&gt;These days, the frontend stack I reach for is straightforward:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;React&lt;/strong&gt; for the UI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vite&lt;/strong&gt; for development and production builds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TanStack Router&lt;/strong&gt; for routing, navigation, and type safety.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TanStack Query&lt;/strong&gt;, when I need dedicated server-state and data-fetching management.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go, NestJS, or whatever backend fits the project.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not every project needs every item on that list. That’s the point.&lt;/p&gt;
&lt;p&gt;I can add tools when I need them instead of adopting a larger framework first and figuring out how much of it I will actually use later.&lt;/p&gt;
&lt;p&gt;There is a certain satisfaction in a stack where every dependency has a clear reason to exist. I know what handles routing. I know what builds the frontend. I know where the backend begins. When something goes wrong, I have fewer layers to investigate.&lt;/p&gt;
&lt;p&gt;It feels like I’m building an application rather than learning the rules of an application framework.&lt;/p&gt;
&lt;p&gt;And after years of building things, that feeling matters to me.&lt;/p&gt;
&lt;h3 id="maybe-react-is-enough"&gt;Maybe React is enough&lt;/h3&gt;
&lt;p&gt;The React ecosystem has spent years making it easier to build increasingly sophisticated applications. Frameworks are useful. Abstractions are useful. Server rendering, server components, and full-stack capabilities solve real problems.&lt;/p&gt;
&lt;p&gt;But sometimes we get so used to the most feature-rich option that we forget we can start smaller.&lt;/p&gt;
&lt;p&gt;If all you need is a client-side application, React and a router might be enough. Add a data-fetching library if the application needs one. Add server rendering if the requirements justify it. Use a full-stack framework when its full-stack features are actually useful to you.&lt;/p&gt;
&lt;p&gt;You don’t have to start with the biggest abstraction available.&lt;/p&gt;
&lt;p&gt;I spent more than a year deeply invested in Next.js. It helped me build projects, and I’m glad I learned it. Moving away from it wasn’t an admission that I had chosen badly. It was a consequence of understanding my own requirements better.&lt;/p&gt;
&lt;p&gt;BeamDrop was the project that made the difference for me. I tried a different setup, liked how it felt, and kept using it.&lt;/p&gt;
&lt;p&gt;That’s really all that happened.&lt;/p&gt;
&lt;p&gt;I didn’t discover the one true React stack. I just stopped using a framework for features I barely needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next.js didn’t lose me because it couldn’t do the job. TanStack Router won me over because it gave me what I actually wanted.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And so far, I haven’t had a reason to go back.&lt;/p&gt;
&lt;p&gt;Yours truly, Tach&lt;/p&gt;
&lt;p&gt;&lt;img src="https://medium.com/_/stat?event=post.clientViewed&amp;amp;referrerSource=full_rss&amp;amp;postId=b911eeb4809a" alt=""&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://medium.com/@tacherasasi/i-moved-all-my-react-apps-away-from-next-js-b911eeb4809a?source=rss-9a41d7ec29fb------2"&gt;Medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>