r/reactjs • u/acemarke • Oct 30 '17
Beginner's Thread / Easy Questions (week of 2017-10-29)
Looks like the last thread stayed open for quite a while, and had plenty of questions. Time for a new thread! (I should probably consider labeling these as monthly or something :) )
Soo... Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple.
The Reactiflux chat channels on Discord are another great place to ask for help as well.
21
Upvotes
View all comments
Show parent comment
3
u/PistachioPlz Nov 15 '17 edited Nov 15 '17
Yeah, React is designed to build UI's. I mean, there are precedents for using react as server code, but I've never done it. I'm sure you can google around or ask on stackoverflow. But it would definitely require splitting out the code, unless you do some webpack magic which I don't even know is possible.
Though I think your best bet is to not use react as a server. There are an infinite number of languages and frameworks that are designed to work as backends. React was never designed for it, and although it might work - it would probably be more work that needed.
Personally I use react for the frontend and Laravel for the backend. Laravel is super simple to learn (hard to master), but for a simple API it's absolutely amazing. You can even try Lumen - which is Laravel's version designed for API's (though the api is slightly different and some of the features aren't enabled by default). But if you don't want to learn Laravel, there's always NodeJS/Express
Though I might misunderstand what exactly you're after :P