Skip to content

A very basic project with a Rails API and a create-react-app frontend using JWT auth

Notifications You must be signed in to change notification settings

giotiskl/basic_rails_react_jwt_auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple React - Rails JWT Authentication Example

Frontend

The frontend is built using create-react-app and server through webpack dev server. To build the dependencies:

  • cd client
  • (npm -g install yarn (if you do not have yarn already installed, you should))
  • yarn install

Backend

The backend consists of a Rails 5 API, basic user authentication with JWT. An example user must be manually created in the DB.

  • bundle install
  • rake db:migrate
  • rails c
  • User.create!(email: "[email protected]", password: "testpass")

Start the app

rake start

Running everything together

There is a small helper rake task named start that launches both the webpack-dev-server and the rails server through Foreman. The webpack-dev-server proxies all requests to the Rails API to comply with the Same-Origin Policy.

About

A very basic project with a Rails API and a create-react-app frontend using JWT auth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published