# Rails 6 + Create React App Boilerplate
## Key Features
#### Rails Devise handles user authentications ð
- This allows us to utilize [Devise](https://github.com/heartcombo/devise)'s modules (Email Confirmation, Forget password, Remember Me, etc)
- Since CRA will share the same domain with Rails, it can access logged in user via cookie
#### ActiveAdmin on Rails side ð©âð¼
- [ActiveAdmin](https://activeadmin.info/) makes it simple for developers to implement beautiful and elegant admin interfaces with very little effort
#### styled-components ð
- While user authentiation pages will consume the good ol' SCSS from asset piplines (we omit webpacker from rails), the react pages will use the very best [styled-components](https://styled-components.com/) to keep the concerns of styling and element architecture separated and make components more readable.
#### Best of both worlds ð¥
- We get to keep everything that we love about [create-react-app](https://github.com/facebook/create-react-app), and the ability to scale front and back ends accordingly
#### And all the important things...
- Redux + Thunk
- React Router
- Bootstrap
- Axios
- React Toastify
## Getting Started
1. `git clone git@github.com:lirenyeo/create-react-app-with-rails-login.git` then `cd create-react-app-with-rails-login`
2. Set up PostgreSQL: `rails db:create` then `rails db:migrate`
3. Set up CRA installation: `yarn install` (This will execute `yarn --cwd client install` which does yarn install in client folder)
4. To see how everything works together, run `yarn build && rails s`
- `yarn build` trigger CRA build and copy the static files into rails `/public` folder, so we only need start Rails server for it to serve the react pages
5. To start development, run `foreman start -f Procfile.dev`
- This will start Rails on port 3000 and CRA on port 3001
- Use `localhost:3001` to develop in CRA, api calls to `/api/v1/` will be proxied to Rails (port 3000)
- Logged out users will get redirected to `localhost:3001/users/sign_in` which doesnt exist on CRA, you will need to manually change the URL to 3000 to login. But this process only needs to happen once when you log out
6. To add new JS packages, make sure to do `yarn add <package-name>` inside `/client` folder
#### Active Admin
1. Since AA is on Rails, in development, you need to visit `localhost:3000/admin`
2. run `rails db:seed` to seed a sample admin user, log in to AA dashboard with `admin@example.com` and `password`
没有合适的资源?快使用搜索试试~ 我知道了~
CRA+RailsAPI+设计登录+ActiveAdmin样板_Ruby_JavaScript_下.zip
共210个文件
rb:47个
js:47个
map:23个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 193 浏览量
2023-04-06
22:21:20
上传
评论
收藏 1.76MB ZIP 举报
温馨提示
CRA+RailsAPI+设计登录+ActiveAdmin样板_Ruby_JavaScript_下
资源推荐
资源详情
资源评论
收起资源包目录
CRA+RailsAPI+设计登录+ActiveAdmin样板_Ruby_JavaScript_下.zip (210个子文件)
bundle 3KB
2.d2f44748.chunk.css 142KB
2.11829350.chunk.css 142KB
main.5f361e03.chunk.css 943B
application.css 709B
main.5ecd60fb.chunk.css 362B
Procfile.dev 61B
credentials.yml.enc 464B
edit.html.erb 1KB
_links.html.erb 1KB
edit.html.erb 856B
new.html.erb 837B
new.html.erb 647B
new.html.erb 587B
new.html.erb 486B
new.html.erb 480B
_error_messages.html.erb 398B
reset_password_instructions.html.erb 393B
email_changed.html.erb 314B
unlock_instructions.html.erb 276B
application.html.erb 243B
mailer.html.erb 229B
confirmation_instructions.html.erb 198B
password_change.html.erb 117B
show.html.erb 97B
index.html.erb 86B
mailer.text.erb 13B
Gemfile 1KB
.gitignore 609B
index.html 2KB
index.html 2KB
404.html 2KB
422.html 2KB
500.html 2KB
favicon.ico 3KB
favicon.ico 3KB
2.908db6c8.chunk.js 216KB
2.dbe95052.chunk.js 186KB
2.bb47ea3a.chunk.js 186KB
2.d3b3746a.chunk.js 186KB
2.efa59c1f.chunk.js 185KB
2.a925df73.chunk.js 126KB
serviceWorker.js 5KB
main.b2b1a3ee.chunk.js 4KB
main.3f17c60c.chunk.js 3KB
main.44bfa049.chunk.js 3KB
main.531b8ac9.chunk.js 3KB
main.1d91dba4.chunk.js 3KB
main.baf52624.chunk.js 3KB
main.cc084dc2.chunk.js 3KB
main.932fb29d.chunk.js 3KB
main.f6a1fc34.chunk.js 3KB
main.d3a6f9e2.chunk.js 3KB
main.d2569018.chunk.js 3KB
runtime-main.09b85ec0.js 2KB
main.5d419fe9.chunk.js 1KB
service-worker.js 1KB
auth.js 1KB
HomePage.js 1KB
index.js 815B
AuthContainer.js 793B
precache-manifest.68ccfaf0522b0adb06dd1d2ac9a3a6b8.js 763B
precache-manifest.86462369e8e2058fb71669c1a0d055cc.js 752B
precache-manifest.88d71a3ab1c4bc5feffd6327bd09b7ff.js 752B
precache-manifest.3620f4e045d7efa5eb8b67b27c6c2a20.js 752B
precache-manifest.f748e7e2e6e86c556904cf142777dff7.js 752B
precache-manifest.aa4e7091b814b3758f32f9aa66b9eb3d.js 752B
precache-manifest.4211a8281fba26a0e10fb8abbc8e05f2.js 752B
precache-manifest.538999605ea9c83f03a9b3f7cb51e6b5.js 752B
precache-manifest.ec24b3816a221b26f9604418f5f59761.js 752B
precache-manifest.99655a12d4e34303f28b84441c43fce8.js 752B
precache-manifest.9f5f7c5ac3f011c8c385cfdf3c0d8e67.js 752B
precache-manifest.32eff982dceb980351bec2e978ef20eb.js 654B
global.js 545B
App.js 472B
PublicPage.js 447B
Store.js 386B
App.test.js 280B
setupTests.js 255B
theme.js 175B
manifest.js 63B
index.js 42B
active_admin.js 30B
package.json 1KB
asset-manifest.json 1KB
manifest.json 492B
manifest.json 492B
package.json 370B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
共 210 条
- 1
- 2
- 3
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功