Ad

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?

Ad

Answer

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

Ad
source: stackoverflow.com
Ad