https://github.com/nikrb/auth-react-base
base for creating project that have auth using react and passport
https://github.com/nikrb/auth-react-base
Last synced: 8 months ago
JSON representation
base for creating project that have auth using react and passport
- Host: GitHub
- URL: https://github.com/nikrb/auth-react-base
- Owner: nikrb
- Created: 2017-08-08T22:50:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T13:17:05.000Z (over 8 years ago)
- Last Synced: 2025-06-05T07:38:25.498Z (about 1 year ago)
- Language: JavaScript
- Size: 116 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
create a base for react authentication. [demo](https://knik-auth-react-base.herokuapp.com/)
* node.js
* react.js
* react-router-dom (react-router v4)
* mongodb & mongoose
* passport.js (passport-local)
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
Following vlad's authentication [blog](https://vladimirponomarev.com/blog/authentication-in-react-apps-jwt)
Heroku deployment taken from mars [demo](https://github.com/mars/heroku-cra-node)
with an updated version to show mongodb and websocket connection [here](https://github.com/nikrb/heroku-cra-node)
# setup
### install mongo
unixy:
```sudo apt-get install mongodb-org```
## development
1. clone repo
2. create .env file, e.g.
```
dbUri=mongodb://localhost:27017/testdb
jwtSecret=somesecretphrase
```
2. npm install (top level and client dirs)
3. startup mongo
4. npm run start-dev
## Deploy to Heroku
Create a new mongodb on mLab.
After creating the heroku app (```heroku create```) setup the environment using
the heroku dashboard.
```bash
git clone https://github.com/nikrb/auth-react-base.git
cd auth-react-base/
heroku create
git push heroku master
```