Code Monkey home page Code Monkey logo

burger-builder's Introduction

Burger Builder

This fun project was developed primarily for me to practice React, React Router, React Redux and testing with Jest and Enzyme. It allows users to dynamically customise a burger and place an order. This order is saved to a Firebase database and can be retrieved on-demand. There's a live version of the app here.

Requirements

  • Some of the libraries imported and used:
    • react
    • react-router-dom
    • react-redux
    • axios
    • enzyme
    • eslint
    • prettier

App features

  • Navbar and side drawer for navigation.
  • Saves orders to Firebase database via Axios. Orders can subsequently be retrieved.
  • Axios interceptors to handle errors on app-wide basis via a higher order component withErrorHandler.
  • Routing within SPA with React Router.
  • State management with Redux.
  • User authentication with Firebase.
  • Lazy loading higher order component asyncComponent that allows us to lazy load any component.

Getting started

  • Install Node.js and Yarn if you don't already have them installed.
  • In this directory, run yarn install.
  • You'll need to create your own file called axios-orders.js in the /src folder. See below for the code to be included.
  • You'll also need to create a .env file in the root folder. See below for the code to be included.
  • Start the React server in terminal with yarn start.
  • Run tests with yarn test.

axios-orders.js file

import axios from 'axios';

const instance = axios.create({
  baseURL: 'INSERT YOUR FIREBASE DATABASE URL HERE',
});

export default instance;

.env file

REACT_APP_FIREBASE_API_KEY = INSERT_YOUR_FIREBASE_API_KEY

Testing suite

  • Wrote a few practice tests with Enzyme and Jest (see auth reducer, BurgerBuilder component and NavigationItems component).

burger-builder's People

Contributors

juliatan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.