Skip to content

nme077/burger-barn

Repository files navigation


Burger Barn

The unofficial website for Burger Barn located in Jeffersonville, Vermont

Table of Contents

  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. Contact

About The Project

Built on the MERN stack, this app shows all the details of Burger Barn and provides a UI to edit the Burger Barn menu.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Install the latest version of Node.js (if you do not already have it)

Installation

  1. Open a new terminal
  2. Clone the repo
    git clone https://github.com/nme077/burger-barn.git
  3. Navigate to the project directory in the terminal
    cd burger-barn
  4. Install NPM packages
    npm install

Configuration

  1. Add a .env file with the variables in .env.example.

  2. 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]]"
  1. Navigate to the '/register' in app.js.

  2. 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);
    });
  1. 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.

  2. Revert the code we modified in step 5 to the original.

Running the app

  1. Within the burger-barn directory, run npm start
  2. Open a second terminal and enter cd client
  3. Run npm start
  4. In a browser, navigate to http://localhost:3000/admin and add some menu items. Add item screen
  5. Navigate to http://localhost:3000/ to see the results!

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Nicholas Eveland - nicholaseveland93@gmail.com

Project Link: https://github.com/nme077/burger-barn