Building a full web template with React (Beginner)

(Luohao122) #1

Hello everyone, I’m a newbies and first time come to our forum. Currently, I’m learning ReactJs for building a mobile app with my friend. But I want to learn and test it on a web template first. I have already read ReactJS tutorial on React website. So what should I do next? Can anyone give me some insight. Thank everyone. And sorry if I’m making any mistake or typo. I’m not from an English native environment.

(Andrey Kolybelnikov) #2

Hi, what do you mean by a web-template? If you need a sandbox environment, you can import React as a CDN link and start building the app locally. If you want to try to deploy it and see it online, there is a number of free resources, codepen, github etc. If you give more details, I can help you further.

(Luohao122) #3

Thank you very much. What I meant is that I want to build a website completely from scratch based on ReactJS and then I would like to use Codeigniter framework to work on back end. For example:

  1. Front End would be ReactJS. Where I specified components, HTML, CSS.
  2. Back End would be Codeigniter. Where I stored my models, controllers…etc…

So how can I interact between these two? How can I get data from Codeigniter and send it to React? Using Ajax request to send data to React and output it within React components? Or is there some other way?

Because usually when I’m building a website, I can just do the HTML seperate, and later creating view files based on them in Codeigniter project folder and do a foreach to output data from controllers.

Thanks again for replying. I’m new to all this React. And I’m still confusing.

(Andrey Kolybelnikov) #4

Hi again,

I understand your set-up. I don’t have experience in getting such a set-up to work though.

I have made a basic search and found some information on stackoverflow:

The link includes some futher links on the subject and you can try to go on from there and figure things out.

However, from the first glance it seems to me that if you’re using React.js as frontend for a Codeigniter app, you should not have to make ajax requests to fetch data.

If you had created two separate projects, one for the frontend with React.js and one for the Codeigniter backend, you would have to make fetch requests for sure, serving data from the Codeigniter as from a database.

As I say, I don’t have experience with that. You might actually consider an easier set-up with node.js and backend at firebase or comparable. There is much more useful resources for a beginner with that set-up out there.

Good luck anyways.

(Luohao122) #5

Thank you for your kind words, I have looked at the document from stackoverflow, but it seem like it is still missing the details, but again, thank you, I will try to solve it. I do loved to talk and ask about ReactJS, so if you have any way to quick reply or have a chat room, please can you give me some? I’m very grateful. Thank you again.