简体   繁体   中英

How do I implement Devise with react frontend folder in my project?

My project is using Rails and jbuilder with a react redux frontend. I am having a hard time figuring out how to implement devise to work with react and redux. can you pease give me some guidance. How would the routes look? I am having a hard time getting started. Any help would be greatly appreciated. so my project structure is like this.

.

PROJECT_NAME
|-- app
|-- bin
|-- config
|-- config.ru
|-- db
|-- frontend
|   |-- actions
|   |-- components
|   |-- reducers
|   |-- store
|   |-- util
| 
|-- lib
|-- listmyfolder.txt
|-- log
|-- package-lock.json
|-- package.json
|-- public
|-- storage
|-- test
|-- tmp
|-- vendor
`-- webpack.config.js

Is there a git repo with this kinda of project structure that i can reference?

it's better to not implement react inside rails and make react completely separate application this will make it easier to scale it. but if you want it inside rails to simplify the deployment you can check this https://github.com/reactjs/react-rails

Then devise integrate with react through api, so it will be better to use token-based authentication, I think this article may help you https://medium.com/@mazik.wyry/rails-5-api-jwt-setup-in-minutes-using-devise-71670fd4ed03

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM