How to integrate with nodejs

I am starting a new project and I was wondering how to integrate with nodeJS app. I know the “datocms-client” library I already installed it but I would like to know what’s the purpose of it. This is the first time I will use a headless cms in a real project and I want to have a wide perspective of how to do it. If I use nodeJS, the front should communicate with it and node with datocms?. I don’t really see the reason why to use nodejs, but I would like to use it. I am sorry for being not very specific, and thank you very much!

hey @benitojuanignacio welcome to Community :slight_smile:

That depends on what you need to do. You can either load content from the frontend directly using GraphQL or you can do it from the server to reduce the number of calls and maybe serve a statically rendered page?

It’s a tradeoff that depends or what you are trying to achieve. If you can provide more context I can give you my opinion :slight_smile:

Hi Mat! Thank you very much for your response and sorry for the delay.
I need to create a site that renders static information that needs to be periodically updated, adding and removing items. For that I think there is not problem. My problem is because at some point I need to create a user, I mean, authenticate a user (register, and login) and create a “collection” with all the information that was shown before. For example:
I enter to the web page, and it shows spaces: bedroom, bathroom, kitchen. Those spaces are loaded from datocms. Then depending on what space was chosen I will show a series of other information and so on. After the whole process I will create a “collection” with everything and then I create a user and assign it to that user. Is it possible to perform this entirely with datocms, or I definitely I need an api , to work in parallel with datocms? And if this is the case, what would you recommend?
Thank you. very much again,

Hey @benitojuanignacio you could use DatoCMS for most of it.

You could decide if you want to create collections and users as DatoCMS models, or maybe you can leverage a third party system like to let the users login and save their own collections outside of DatoCMS.

Does that help?