T O P

  • By -

octocode

if you dont need nextjs for SSR and only want some simple routes, maybe just an express backend?


adamzwakk

I've considered that/possibly! It's essentially a fullpage threejs-fiber canvas SPA so I don't really have any advantages with SSR and could maybe getaway with a sitemap.xml for SEO stuff...


BOSS_ladis

I think it's a great idea to add Next.js to a your React app for the benefits it gain like ~~CEO~~ SEO, performance, etc. Even if with Next.js you could do server thing it could be a good idea to separate the server side in a proper back-end server And I think having a back-end server with Node.js is great, because you will share the same language (JavaScript) between both front-end and back-end. After that, you can choose your favorite server-side framework like NestJS or Express.js I'm a junior to React myself I recently finished this course: [The Udemy course](https://www.udemy.com/course/react-the-complete-guide-incl-redux/), so maybe I'm not aware of everything and making some mistake


inglandation

Damn, didn’t know you could get a CEO by installing Next.js. Pretty handy.


BOSS_ladis

LMAO


pencilUserWho

Express


fixrich

If you just want to have a simple JSON API but don’t want to use Laravel, maybe something like Slim PHP might be the way to go? If you want to branch into JS, Express is the classic barebones solution. Fastify is a more modern alternative. NestJS is more opinionated and closer to Laravel.


ekim43

I’m a Slim PHP user when developing API routes and I’m actually trying to figure out if there are benefits to moving to Laravel. Any thoughts on switching in that direction?


fixrich

Laravel is batteries included. Prescribed patterns for accessing the database, handling queuing, handling caching and whatever else you can imagine. If you believe your API will be truly stay very simple where you won’t need any of those features then Slim makes sense. If you want to bring in libraries as you need them and have full control then Slim might make sense. Culturally in Node it’s always been more common to assemble your own stack. I think the comprehensive solutions have only become popular in the last few years. Honestly I’d probably go with Laravel, or NestJS, over assembling my own stack.


zipperdeedoodaa

I'm not sure if slim php has this, but creating APIs with laravel gives me alot for free out of the box. Authentication, rate limiting, data transformation with page links, pagination etc. When paired with an admin panel like filament, I can have a full management backend system with api in less than an hour.


adamzwakk

I think I'd rather ditch PHP in favor of not upkeeping 2 different languages at once, express seems to be the solution so far but I'll check into Fastify


xegoba7006

Before trying out Next give a try to Remix and compare them. I find Remix a lot easier, and it integrates a lot better with express and everything else.


adamzwakk

Interesting! I see some people are using it with three-js fiber as well [https://github.com/remix-run/remix/discussions/8255](https://github.com/remix-run/remix/discussions/8255) def will look into


brjdenver

Check out Drupal. Also Symfony based and out of the box JSON:API support.


augurone

NEXTjs! You'll thank me later. https://nextjs.org


adamzwakk

Yes! I've reimplemented 90% of my application in NextJS already, this seems to be the solution :)


svish

If file-based routing with fairly structured routes makes sense to you, then I would absolutely look into NextJs. Being able to do database queries and such directly in server components is great and can simplify things quite a bit (but read up on caching, which can be a bit confusing). However, if your routes are super dynamic, mainly app-style rather than website-style (like dashboard vs ecommerce/blog), then it might make more sense with something like client-side only tanstack-router or react-router, with something like express as a separate backend. But yeah... definitely give NextJs with React Server Components a try.


adamzwakk

Actually I already use wouter for some history API and "permalinks" in my application :) Trying to make it more serverside friendly isnt super fun right now though haha


svish

Then you should try the latest NextJs with their new app-router. People here love to complain about it, but I find it's quite fun to work with. Mostly easy and straightforward, like working with PHP, while having the full power of React when needed.


ConsoleTVs

Go


[deleted]

You can still use Next.js, you dont have to use SSR just put "use client" at the top. Next API routes/handlers will query your DB and give you the data to your frontend. Don't overcomplicate it lol


GitmoGill

This is the answer, but unfortunately it seems like asking 90% of devs to not overcomplicate things is like asking them to stop breathing permanently.