DEV Community

Discussion on: looking for answers !, strapi vs nest js for my next project

Collapse
 
brokenthorn profile image
Paul-Sebastian Manole • Edited

Strapi is a general purpose CMS with lots of plugins, which can make it good for backend data server, content server, media server, and so on (many kinds of APIs). Officially advertised as: "Open source Node.js Headless CMS to easily build customisable APIs".

NestJS is an MVC framework which handles the lowest levels of serving content/data in something like a CMS, or a custom application. Officially advertised as: "A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8)".

Strapi is written in JavaScript and is venture capital funded.

NestJS is written in TypeScript and is very robust and very flexible and has a few very well written plugins, microframeworks and solutions, or "extensions", like for example nestjxs/crud which instantly gives you a well designed OpenAPI REST server. These provide scaffolds to build custom solutions on. In the end you can achieve something like Strapi but be a lot more flexible and robust, albeit at the cost of more development time.

Also with Strapi you can build your API graphically (or not), with NestJS you need to do it programmatically (with code).

If you're building a general purpose app, or you're a very small shop, or a small company looking to replace WordPress, choose Strapi, it's faster to get going. (this doesn't mean Strapi is not good for large companies, but very much depends on what you're building)

If you're very serious about your applications, you prefer code to a graphical UI, and you're building some very custom solution that needs to be extended over time, needs to be very robust, and follow a strong and well understood application architecture (MVC, NestJS looks a lot like Angular), can't have (many) runtime errors, needs to stay performant always, think large enterprise stuff, then you're probably better off choosing NestJS.

That's based on my personal experience and I've only just written my first backend with NestJS but previously I tried Strapi. Have to say that I prefer NestJS even if this is a personal project. It's a lot more flexible and robust (for example I can better enforce referential integrity, which is something you can't do with Strapi. This can lead to less headaches down the road.).

Collapse
 
warriordev profile image
warrior.dev

Thank you very much! Very good answer! It helps me to clarify the picture a lot!

Collapse
 
brokenthorn profile image
Paul-Sebastian Manole • Edited

Thank you. Glad I could help. I hope I didn't paint Strapi in a bad light. Maybe I should have said that what took me a few days to write in NestJS, only took me a few minutes to bootstrap in Strapi using the GUI. But like I said, with NestJS I have more control at the finger tips and more power (which I cared for a lot more, like writing my database schema such that referential integrity gets built into the database schema, and not left over to the client or backend service to enforce with application logic which adds the need to write more unit tests).

Collapse
 
mdmajidali profile image
Mohammed Majid Ali

1000 Likes!