Which Node.js framework should I use to add a backend to my existing React project?

Viewed 52

I'm a frontend developer by trade. I have a new brand personal project that I set up with Create React App. It's running React version 18, and it's written with React hooks (duh). I'm using Base Web as the component library, although I'm not married to it. I'm using Redux for the UI state management.

Now that the UI / UX is starting to take shape, I'm getting more ambitious. I'm ready to grow this from a toy / portfolio piece into a real app. I need a database. I need to have user accounts. I'd like to do some realtime stuff with web sockets, too. I'm pretty rusty at database stuff. My most recent experience was with MongoDB. I used to use MySQL back in the day, so I know SQL basics, though I'm quite rusty. I don't have a strong opinion about SQL vs NoSQL. The nature of the app is a personal organizer with to-dos, calendars, reminders, etc. (Just so you have an idea of the kind of data I'll be working with).

I'm trying to decide on what DB to use and what Node.js framework to use. Express is familiar to me, but it seems a bit dated. I'd ideally like a solution that is "batteries included," as opposed to picking out the various pieces of the backend stack and wiring them up by hand. I'm currently researching HAPI. Given what I've described, can anyone recommend a good stack? Thank you so much!

1 Answers

Well there are a lot of things that you should consider before making a decision. I am going to try to highlight as many as possible.

Firstly, I would ask if you need SEO for your application? If yes, then you should move your react app to NextJS. It is pretty cool and offers a lot of advantages over the traditionally used react app created using create-react-app. It comes with a solution to define your own API's. And if you want to try something nee you can try the new t3 stack. You can use prisma with it for DB. Or if you would like to mysql.

If you want to continue using existing CRA app, then you can try NestJS. It uses expressJS under the hood, and as you asked, comes with "Batteries included". Advantage would be that you can write your APIs with a lot less code.

There's also an option to use cloud functions offered by Google firebase. With it you can use firebase's firestore.

Ofcourse if you want super low latency across the world, you can also use Cloudflare workers.

These are all the options that I would personally consider, it might not have all the options available. These are only that I think are good alternatives.

Related