A
A
Alexander2016-11-20 23:44:49
React
Alexander, 2016-11-20 23:44:49

An example, a sample of how to create sites with React-Redux + laravel?

Do I understand correctly how react (react-root) will communicate with the server?:
1 - there will be a domain : site.local in which the React application will simply be located .
2 - there will be api.site.local or route-group subdomain with api prefix , which will respond to requests from the client.
I want to know what should be the folder structure for the future site. I understand that there is not a standard and everyone does as he wants and as it is more convenient for him. For example, today I saw this structure somewhere:

  • API
  • src
    • actions
    • components
    • ...

  • tests

Looks comfortable. Found another project: https://github.com/onerciller/react-redux-laravel . There the dude made a blog but, for some reason, he didn’t use the elixir that is in laravel, I don’t know if this is normal? and wrote the constants in the actions folder + constants that belong to different modules are in one file (types.js).
In general, I noticed that on sites in certain places like admin-panel, panel-control, etc. where search engine optimization is not needed, js framework is often used for without reloading the page. Could this have something to do with SEO? for example, I heard angular is bad friends with SEO and it is used where SEO is not needed. In the meantime, I'm digging into this repository.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Plisko, 2016-11-21
@kentuck1213

You can divide the application into two at once, a pure laravel api and a separate react application, without being tied to the api.
If you develop together, then you need to remember that the root document is in the public folder and the statics need to be added there. not at the root. This can be done either immediately or with a build script.
send elixir to the trash right away, use the usual tool for front-end developers - gulp or webpack, remembering the document root.
All applications generated on the client have SEO problems, they can be bypassed in different ways, google the topic. On Angular, you roll a barrel in vain, it is still made by Google developers and workarounds are thought out best of all.
Well, before it's too late, it's better to throw out react, all these components, api, action, reducer are bullshit, not application architecture. There are also normal frameworks like angular or ember.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question