Skip to content

Commit

Permalink
updated readme and ... problem with getSlideVal...?
Browse files Browse the repository at this point in the history
  • Loading branch information
dandiflower committed Jul 13, 2018
1 parent c4d0043 commit 43be8c8
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
54 changes: 47 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
# Securing MERN Stack Web Application using Passport
# Footprint

This source code is part of [Securing MERN Stack Web Application using Passport](https://www.djamware.com/post/5a90c37980aca7059c14297a/securing-mern-stack-web-application-using-passport) tutorial.
Footprint is a React application which easily calculates a user's eco-footprint based on the user's lifestyle. People can learn how to reduce their footprint by taking the quiz and seeing how they compare to the average.

To run this source code:
## Use the app:
* [Launch app](https://infinite-badlands-27209.herokuapp.com)

* Clone this repo
* Run MongoDB server
* Run `npm npm run-script build`
* Run `npm start`
![Homepage](client/src/components/Video/assets/homepage.jpg)

## To run this source code:

* Make sure MongoDB server is running
* Run 'yarn run build' & then 'yarn start'

## Built With:

* React
* Passport
* Concurrently
* Express
* Mongoose
* React Chart.js 2
* see package.json for additional packages

## Code examples

* **Passport** - User authentification:

```
![Code](client/src/components/Video/assets/passport_auth.jpg)
```

* **Session Storage** - Creating User Session (using jQuery click event):
```
router.get('/logout', (req, res)=>{
res.localStorage.removeItem('jwtToken');
res.clearCookie("user", {path:"http://localhost:3000/"});
res.set('user', {expires: Date.now()});
res.json(true);
});
```

## Authors 🖋

* **Hannah Lim** [Hannah Lim](https://github.com/hannahlim213)
* **Jessica Brush** [Jessica Brush](https://github.com/dandiflower)

## Acknowledgments 🗣

* **A big thank you to our instructors and TA's at Berkeley's Coding bootcamp!!
4 changes: 2 additions & 2 deletions client/src/components/Quiz/QuestionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class QuestionForm extends React.Component {
// is the user authorized????
componentDidMount() {
this.getUserID()
setTimeout(() => {
// setTimeout(() => {
console.log(this.state.userId);
}, 100);
// }, 100);
axios.defaults.headers.common['Authorization'] = localStorage.getItem('jwtToken');
axios.get('/api/person')
.then(res => {
Expand Down
Binary file added client/src/components/Video/assets/homepage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 43be8c8

Please sign in to comment.