George Welder
George Welder

Reputation: 4045

How do React & NodeJS work together?

Can you tell me more about the relationship between the two? I want to (for example) write a little tool which plays audio files on my raspberry pi. Would I then do the player and the players interface completely in React, and then just connect to node in order to get the actual files?

Or, more generally but the same thing, if I would want to write an application that does certain things (writes files, records audio, changes system settings etc.) that would all be done in nodejs, but if I want to have an interface I would use something like React?

I am a bit confused, but I hope this question is valid!

Upvotes: 10

Views: 12907

Answers (4)

rsp
rsp

Reputation: 111268

Node and React can be used together.

There is even the MERN stack that helps with that:

MERN is a scaffolding tool which makes it easy to build universal apps using Mongo, Express, React and NodeJS. It minimises the setup time and gets you up to speed using proven technologies.

See: http://mernjs.org/

But you can use React with any other Node framework, not only with Express. React can work with any REST API so whatever you use to build a REST API can be consumed by the frontend written in React.

Some other options include: Hapi, Restify, LoopBack. For more see:

Upvotes: 8

alexb
alexb

Reputation: 277

ReactTS is a scaffolding engine for React on ASP.NET Core. Very powerful, and very fast - will generate your entire application with a single button click. You can also customize the templates. Check it out here... http://bssdev.biz/DevTools/React-Turbo-Scaffolding-Free-Download

Upvotes: 0

poletn23
poletn23

Reputation: 554

Yes, this two thinks can work together, I am currently working at such project. I will point out main think here. That is where you put your routing. Does it goes to Node.js server or to React Router. This is important because it defines where you application logic should be.

Upvotes: 0

Paul Stoner
Paul Stoner

Reputation: 1512

from the official React Documentation React is "a JavaScript library for build user interfaces". In very watered down terms (and I mean watered down) React could be thought of as a templating library (please don't shoot me for that).

What I've learned about React is it is more like the "V"iew in MVC. It provides you a way to present the user interface using JavaScript and JSX. With the little I know about from various tutorials, I really like working with React.

Upvotes: 3

Related Questions