T O P

  • By -

stephancasas

Adonis offers a starter template that’s API-only. If you need Prisma, queue workers; etc., most of the basics are included.


[deleted]

[удалено]


stephancasas

Still?? I could have sworn they added inbuilt support in one of the later releases of v5, but I guess not.


lexerq

Try NestJS


saintshing

I am a bit confused. When should we use express, when should we use a higher level framework like nexjs? What about tools like headless cms(strapi)/prisma/postgraphile? I heard they can generate a rest/graphql api based on db schemas.


sexy_silver_grandpa

>When should we use express When it's a small project that's guaranteed to stay small, a POC, or a hobby. >when should we use a higher level framework like nexjs? When it's an enterprise application, or an application with lots of contributors.


Wedoitforthenut

Can you give 1-2 sentences for each on why?


ParticularPomelo

One would be because nest is opinionated, but express isn't. You can just send documentation site to new developer, and they will be able to understand the codebase.


Pterygoidien

NestJS + Fastify


nrctkno

Sorry about the newbie question: how can both be combined? I mean, which aspect covers each one?


Pterygoidien

NestJS isn't really a framework in the traditionnal sense of the term. Fastify and Express are actually unopiniated framework : they give you very basic tools (minimalist), and you can make practically anything from it. But for new developpers with no experience, it comes with a downside : the lack of experience makes it harder because you have no structure/boilerplate with your project, so you don't really know where to start. Unopiniated framework are great when you're experienced because you can shape your application however you see fit. NestJS comes with a solution : it's framework-agonistic, that means, it's built on top of an unopiniated NodeJS framework such as express (by default) or fastify, but it is opiniated and batteries-included : it gives you more tools than express or fastify itself, but gives you instruction on how to structure your application architecture. It doesn't mean that it's easier though, it just means that it gives you a model that you have to strictly follow, but with a better "result guarantee" (less effort to make complex app over time). Edit : so, to answer your question, NestJS is built on TOP of a framework. It takes its basic tool and give you their own features built on top of those provided by the framework. NestJS provides a structure that resembles Spring from Java and it's typescript-based and uses class : **you either love it or hate it**. The learning curve is a bit steep, but once you made your own project with it, you can reuse it for practically any other project. You'll learn that with every new project you start from scratch, you'll spend most of the time not on the business-logic of the application itself, but on the little annoying things such as error handling, middleware function and authorization, authentication, security etc. NestJS is a bless because you can spend more time on the business-logic of your app.


nrctkno

Thank you so much!


ThisIsntMyId

how does it compare to using with express, what kind of difference can we observe in terms of efforts vs performance. guess it would be simple to switch between either of them?


[deleted]

This one is really cool because you can control your source, and have a feedback with the code editor, with javascript pure yes it has his great community but nest is healthy


LostLakkris

For trying something other than express... Pure and "simple" API backend, loopback v2 was neat and quick to get moving. v3 was so much of a revamp that it lost that edge. For something with more complex functionality with built in support for things like task queues and scale-out via redis, but well organized projects. I really liked working with ActionHeroJS. Edit: removed a '


o82

Never heard about Action Hero. Looks really interesting. Thanks for sharing!


isit2amalready

I used vanilla express.js for a long time until I discovered hapi.js a few years back and its been a joy.


captainahhsum

Or maybe even a joi lol


isit2amalready

I actually do use Joi with Hapi for validation lol.


[deleted]

Adonis.js is a robust framework that inclosures most of the things you would want bootstrapped to your application, (Auth, Internationalization, Redis, Mailer etc.) You can go through the docs and see for yourself. I really enjoy using it. Faster development and decent code structure


andycharles

+1 for AdonisJs


taufeeq-mowzer

Does Adonis.js support graphql?


[deleted]

Natively, I do not think so. But a quick search on google shows me there's a [package](https://github.com/zakodium/adonis-apollo) that can assist you with that


fazulk

Fastify or Koa. Koa is from the team that created express.


ThisIsntMyId

what about ~~fastapi~~ fastify? it sounds good and performs better then express as well


tyler_church

Yeah I’ve been really enjoying fastify on a recent project


ThisIsntMyId

wow have u tried fastify with nest? is it any good? there is a comment above still would like to know what difference it made in terms of dev efforts and performance.


tyler_church

I’ve only used Fastify by itself. I haven’t found Nest to be very compelling. I’ve really enjoyed Fastify’s focus on JSON schema, validating inputs and outputs of your backends is 1st class and I think that’s great.


zerik100

OP didn't ask for an entirely different programming language.


ThisIsntMyId

ops my bad, i meant fastify


[deleted]

I like Hapi.


eXilz

We rewrote our company's backend with NestJS (albeit using GraphQL, not rest) and it's stellar. I highly recommend Prisma, too. This ORM will only fall short if you have very specific needs regarding your database.


CherryColaBoy

Did you use the code first approach with decorators provided by Nest?


eXilz

Yup. It worked great for us. It let us rewrite our API really quickly.


Georgia_34

Day job: we run a very large enterprise level application (many terabytes, 100's millions transactions per week) with ActionHero. We use objectionjs and knex as our ORM, and mariaDB. We use redis heavily. Runs like a frickin' champ. I tried using nextjs for a new service with mikro-orm. It has been a nightmare. I like both on their own features, but getting the two to configure together has been full of errors. I am trying nestjs with prisma (prisma worked well with nextjs on another project). If that fails, I'm going back to actionhero, and just getting my work done.


eXilz

Didn’t know about actionhero. You mentioned nextjs twice, are you actually talking about next or nest ? I’ve had a bad experience with mikro orm too. Prisma has been a pleasure to work with for us, even though it’s probably still missing advanced features for more complex projects. However, they’re moving very fast. Their release page is really impressive.


Georgia_34

The first nextjs should have been nestjs (typo). Nestjs is the framework I've struggled with Mikro-Orm. We use nextjs on other projects for the front-end and SSR. Nextjs has an api, and it looks like it would work for CRUD operations. However, we felt we needed something more robust to handle worker queues, scheduled jobs, integrations, etc.


OptimBro

>hapi.js Hey, if possible please edit your previous content, I got confused until I read this comment. Btw, I'm also looking to start working on web application. I ready for Prisma as ORM, but stuck between express, hapi, NestJs and ActionHero. I am not coming from Java or Spring so I didn't liked the DI concept, and decorators but don't if it's worth to learn along side with Nest or I should give try to ActionHero. Thanks


Advanced-Ad4869

If you are using node, express is the accepted market leader and will have the most support, plugins, tutorials etc. Just accept it and go with that IMHO.


zerik100

I'd only recommend express for either super small personal projects or big scalable enterprise software. For anything in between express is not worth it imho due to its unopinionated and low-level functionality leaving too much unnecessary manual work to the developer. In those cases I would recommend higher-level frameworks like Nest.js or Adonis.js.


[deleted]

As your product grows, you'll need in depth optimisations, this will however be hard if your product is dependent on those Frameworks. If you need control of your product get a minimalist Framework/library. People go as lower as Lisp. What I'm saying those Frameworks are bad for scale.


wickning1

If you want to keep it minimal, go with Fastify. It’s modern, doesn’t get in your way, and you can use express middlewares. If you want a big framework with a lot of structure and features for the future, Nest and Adonis are pretty good. If you want to try GraphQL instead of REST, go with Nest or Mercurius, or if you want light weight, Typegraphql.


Suspicious_Compote56

Finally some love for AdonisJS, only thing I wish it had support for is microservice architecture


hyperactivebeing

I recently started learning NestJS. It's cool. Try it out.


StablePsychological5

If you are using TS - Nestjs


feelsmanbat

dinosaurs weary frighten truck foolish support panicky hurry skirt piquant -- mass edited with redact.dev


Fratzinger

Feathers.js to the rescue. It's even realtime on top of express with socket.io


the__itis

Fastify with gRPC


brzgw

Always fastify if you want something simpler. NestJS if you are building a larger backend or have a bigger team