I’m currently developing a project that involves a Go backend and I’m looking for the optimal strategy to construct the frontend. Although I’ve been utilizing Next.js, I’ve encountered challenges where I often resort to using Next API routes instead of properly interfacing with my Go server, leading to confusion and disarray.
The primary issue I face is that during client-side rendering, users experience a blank page for several seconds while the data is fetched from my Go API. Even with loading indicators, the overall user experience feels sluggish and unrefined.
I’m in search of a solution that merges the advantages of both approaches. On one hand, I require the interactive capabilities offered by JavaScript frameworks (such as handling button clicks, managing forms, and making dynamic updates). On the other hand, I want certain content to be pre-rendered on the server to ensure fast loading times for pages.
A suggestion I received was to use Vite alongside React and connect through a JSON API. However, this still presents the same delay issue. Is there a way to attain the benefits of server-side rendering while retaining React’s component structure? Perhaps similar to PHP which fully renders pages on the server before sending them to the client?
What frontend solutions are effective for integrating with Go backends in this hybrid model?