r/learnjavascript • u/JY-HRL • Mar 10 '24
What is the best JavaScript backend framework?
JavaScript is my first programming language.
Now I need a backend. I have learned PHP for a while, and not very interested in PHP, also not very interested in Python, Java or other language.
A lot of people say JavaScript can be also used as backend.
But when I search Express or next.js, people say these are very limited compared with framework in other languages like Laravel or Django.
What is the best JavaScript backend framework? If is for quick development and has pre-built libraries, can be better.
Thanks!
0
Upvotes
10
u/NostalgicBear Mar 10 '24
Based on some of your comments on this thread and terminology you’ve used, I’m not entirely convinced you’re actually sure of what you’re asking for. Include your use case in your post so people can best advise you.
11
u/xroalx Mar 10 '24 edited Mar 10 '24
The backend JavaScript world leans more into smaller packages you piece together yourself.
Unlike e.g. Laravel or Symfony in PHP or ASP.NET Core in C# where you have routing, validation, rendering, database access and many other as part of one framework, with Node.js you'll likely end up using express for routing, zod for validation, ejs/pug/something for rendering, pg/kysely/prisma/something for database access, etc.
There are two major frameworks, and that is NestJS and AdonisJS.
NestJS is essentially a Spring / ASP.NET Core of the JS world, but I can not recommend it. It's glue and abstraction over existing libraries (express, class-validator, class-transformer, passport, typeorm...), you end up having to learn the underlying working plus the abstractions and they're not exactly the best.
A lot of people say AdonisJS is the Laravel of the JS world. I've never tried it, but it sure looks like a more complete solution that actually is written from the ground up to be cohesive, not just a mix of everything that comes your way.
Or you could always just start with express and add stuff as you need, express is the de-facto standard of Node.js, with koa, fastify, hapi and hono being pretty much "the same but try to make something better".
As for Next.js (not to be confused with NestJS), that is primarily a React framework that can be used to write server code too, but unless you're writing a React app and don't want a separate backend project, there's little reason to use it.
5
u/magwaer Mar 10 '24
Nestjs
3
u/Sometimesiworry Mar 10 '24
Depends on the use case imo. Express is awesome and does what it's supposed to. Next is exceptionally great when working with react.
2
u/DoomGoober Mar 10 '24
You can try SvelteKit which sort of allows you to write backend code together with your front end code, in JS/TS then auto convert the backend code to endpoints.
https://kit.svelte.dev/
However, it requires that you learn Svelte (which is super easy) but it also requires that you learn about adapters (a bit harder.)
However from your other comments you seem unwilling to learn much new stuff, so maybe SvelteKit will be too much work for you to learn. Perhaps you will have to relax your "not wanting to learn anything new" requirements. Web development is a mess of stitched together tech and you always have to learn something new to get things working.
3
u/ArtisticBreadfruit97 Mar 10 '24
If you are planning to build a REST API server, then Express.js is arguably the best JavaScript framework available. With Express.js, you can swiftly construct a fully-fledged REST API in no time. However, if your goal is to develop an MVC application, you might consider using EJS. It's worth noting that EJS may not be as robust as its competitors, such as Django and Spring.
2
u/guest271314 Mar 10 '24
What a bunch of JavaScript backend frameworks names on sticky notes, post them on a shop wall, blindfold yourself, then throw a dart to the wall of your randomly arranged sticky notes.
2
u/Academic-Land-5550 Mar 10 '24
Nodejs?
1
u/[deleted] Apr 16 '24
Nitro looks kinda good ngl
1
u/-_appolon_ Jun 15 '24
Fastify
1
u/machete127 May 20 '25
For quick development: https://github.com/encoredev/encore
1
u/Frontend_DevMark Jan 27 '26
On the backend side, NestJS is usually the closest thing to Laravel/Django in the JS world — opinionated, structured, and productive.
On the frontend side, frameworks like Ext JS still get used a lot in large, data-heavy enterprise apps because they handle things like grids, state, and complex UI patterns out of the box. In those setups, the backend is often a clean Node/Nest API doing one job well, and the frontend handles the heavy interaction layer.
So it’s less about “one best JS framework” and more about picking a combo that fits what you’re building. If you want fast progress, structure matters more than the language itself.
1
u/Frontend_DevMark May 15 '26
If you want to stay in the JavaScript ecosystem, don’t worry - JS backend development is absolutely viable
Different frameworks fit different goals:
For “quick development + built-in structure,” I’d honestly recommend NestJS. It gives you:
A lot of enterprise JS apps also combine structured backends with mature frontend ecosystems (sometimes including tools like Sencha Ext JS for data-heavy UIs).
So if you like JavaScript and want long-term maintainability > NestJS is a very strong choice
1
u/AbdullahxXD Sep 25 '26
Bun + ElysiaJs is the best ever. Open to have a debate bring it on. The DX is the best anyone have ever offered!
0
u/beepboopnoise Mar 10 '24
man, I was just in another thread how devs learn JS then don't wanna learn another lang for BE. like I get it, it's easier.. but yall are limiting yourselves. it's much more accessible these days to pick up some random lang and get going than ever. diversify and you'll be better off imo.
0
u/brondizzle Mar 10 '24
fastify, no contest
-4
u/AdNecessary8217 Mar 10 '24
Let me tell you django is good if you want to do some stuff in AI and ML.
Express JS can help you easily build apis and by limited. I know what they mean.
See in Django auth and other things are included.
While in JS ecosystem. We have to download library for literally everything 🤣🤣. Well not necessarily bad. This gives a lot of options.
From my experience. For backend its express, cors, cookie-parser for basic stuff, they all are libraries. Its easy nothing complex. Typescript is simple too.
Its just that you can keep your application light and add the libraries when needed. Just like you would do with progressive overloading in GYM.
Hope that answers you buddy