The unofficial website for Burger Barn located in Jeffersonville, Vermont
Built on the MERN stack, this app shows all the details of Burger Barn and provides a UI to edit the Burger Barn menu.
To get a local copy up and running follow these simple steps.
Install the latest version of Node.js (if you do not already have it)
- Open a new terminal
- Clone the repo
git clone https://github.com/nme077/burger-barn.git
- Navigate to the project directory in the terminal
cd burger-barn
- Install NPM packages
npm install
-
Add a
.env
file with the variables in .env.example. -
Connect to MongoDB - get started with MongoDB Atlas at https://docs.atlas.mongodb.com/getting-started/
- Obtain the unique URI to connect to your MongoDB database add it to your .env file.
URI="mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]"
-
Navigate to the
'/register'
inapp.js
. -
Comment out the code between the
// Comment out logic to test
comment and replace it with the following. This will allow an admin user to be created without a token being created by an authorized administrator.
// Unprotected registration logic for testing
User.register(new User(userInfo), req.body.password, (err) => {
if(err) return res.json({error: err.message});
passport.authenticate('local', (err, user, info) => {
if(err) return res.json({error: err});
if(!user) return res.json({error: info});
req.logIn(user, err => {
if(err) return res.json({error: err});
return res.json({success: 'You are now logged in!'});
})
})(req, res, next);
});
-
In a browser, navigate to http://localhost:3000/register and enter the required info. Note: token is required here, but you can enter any value in this intial step.
-
Revert the code we modified in step 5 to the original.
- Within the
burger-barn
directory, runnpm start
- Open a second terminal and enter
cd client
- Run
npm start
- In a browser, navigate to http://localhost:3000/admin and add some menu items.
- Navigate to http://localhost:3000/ to see the results!
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Nicholas Eveland - nicholaseveland93@gmail.com
Project Link: https://github.com/nme077/burger-barn