Using Strapi with Nodejs - javascript

I am planning out my first project using a Headless CMS. I have settled on using Strapi for my project. Is it logical to use Strapi while not using SPA framework/library? I want to use express and EJS to build my website and Strapi as the backend. Is this okay to do? I assume you would use this with your node server that will make REST requests to the Strapi API. Am I glossing over anything?

It's definitely logical. Just make sure to create your own API-endpoints within Strapi and secure the data as much as possible. So try to do most logic within Node.js and not within front-end.

As far as I am concerned this is pointless to make a headless CMS like strapi, without using a library/framework. There is so many reason why this is no sense. Above of all, in react you can use reusable components, writing in jsx etc. This is something that vanilla javascript no have.
Learn how to make first blog in react and connect it to strapi would you take about 10h if you know basic of javascript, css and html. This my opinion.

Related

How can I write to my lowdb-Database from the frontend, using next.js?

I am a hobby programmer with some experience in React, primarily using Firebase for my backend. Recently, I have started using Next.js and am wondering if I can use it as a small JSON-based database for local applications on my Raspberry Pi. I have set up LowDB and can access it from server-side rendered components, but I am unsure of the best way to make them accessible from interactive frontend components, such as allowing user input and saving it to the database. I have considered using Next.js's own API endpoint, but I am unsure if this is the most efficient and desired method. It feels strange to use a DB query in server-side components but an API for data changes.
NextJs as great framework derived from React, its more for UI frontend, for interacting with DB normally you would use an NodeJS API framework like NestJs or simply Express with some kickstart templates.
You will not like use SSC since its just not the way/goal it was designed. like dentist doctor doing eye check haha
Happy coding!

Can we create CRUD web apps using next.js, mongodb and netlify?

I want to create a CRUD web app using next.js with a mongodb database which is then hosted on netlify.
Can we do that???
Or, if that's not possible, do the three things I mentioned (next.js, mongodb, netlify) have an alternative that will make it possible?
Or, if that doesn't work either, is there a solution for me to be able to create CRUD web apps using javascript which are then hosted on netlify?
I have tried looking through all the templates on netlify and found no template for building CRUD web apps using next.js and mongodb.
Maybe I missed.
Yes - You can. Please see this exhaustive tutorial from Mongodb.
https://www.mongodb.com/developer/languages/javascript/developing-web-application-netlify-serverless-functions-mongodb/
It requires the use of netlify serverless functions.
Whilst this example does not include next.js, it provides html and javascript examples that can easily be adapted to any front end framework.

NextJS as a backend JS

I got confuse while searching top JS backend framework then I found NextJS is one of the top list, I thought nextjs is just a simplify of CRA and still need like nodejs as the backend. Back to my confusion, so when we normally create a full JS app we will need frontend and backend tech like (nodejs + reactjs) so with this nextjs we can make a app just with nextjs ? **sorry for my bad English
Simply said, NextJS is basically React on wheels and has NodeJS built-in. It has lots of other features built-in so you need almost zero-configuration to build a full-stack app.
If you have 10 minutes to spare, take a look at this video
Essentially NextJS is a full-stack framework. Which means that developers can write both front-end and back-end code in a single environment. It can provide multiple benefits among various use cases. Which can be things like seo optimization, image optimization or quickly switching between different rendering methods (SSR, CSR, ISR or SSG).
As for your question "Can we make an app just with nextjs ?", you certainly can but it depends heavily on what type your app is.

React: NextJS, do I need 2 servers for deployment?

Stumbled accross NextJS in npm and tried it out. Look pretty good and relatively easy to use. However, one thing about it is still not clear to me:
Suppose I want to have also have a NodeJS (or whatever) api server in complement with the server side rendering that NextJS offers. Do I need 2 server then? For example:
Also is NextJS just a rendering server (which can render React components and creates HTML) or something else/more?
You can definitely use the same server to implement your api.
On official documentation page about Custom server and routing there are examples of integrating with popular node frameworks like express or koa - so you can use them for regular purposes.
What about nextjs itself - like it's said on official documentation page:
Next.js is a minimalistic framework for server-rendered React
applications.
So it has not only capabilities of server side rendering, but also routing (including client one), css-in-js setup and so on.

How to use Angular-fullstack without server components?

I really like the way Angular-Fullstack scaffolds the project. But I already have data served through a restful API. So I don't need any server components. Is there a way, I can only use the client part and remove the server components ?
Update: I am aware of generator-Angular scaffolding but I would like the way Fullstack scaffolds.
Thanks.
Using angular generator would be a better choice. It only deals with the front-end (such as your case).
Update
The guys behind angular-fullstack already started part of the de-coupling. check ng-component generator.

Categories

Resources