Skip to content

zsoltime/react-calculator

Repository files navigation

React Calculator

This is my calculator for Free Code Camp's first advanced front end projects.

React calculator

Demo is available on my site: React calculator

User Stories

  • I can add, subtract, multiply and divide two numbers.
  • I can clear the input field with a clear button.
  • I can keep chaining mathematical operations together until I hit the equal button, and the calculator will tell me the correct output.

Tools Used

Install and Build

You need to have yarn installed on your computer, or you can use npm.

Clone this repo

git clone https://github.com/zsoltime/react-calculator.git
cd react-calculator

Install dependencies

yarn
# OR
npm install

Start dev server with hot reload

It builds HTML, CSS, and JavaScript bundle, starts a dev server and inject new versions of the files that you edited at runtime. Open http://localhost:3000 to view it in browser.

yarn start
# OR
npm start

Build production bundle

It builds to the dist folder. It creates the JavaScript bundle, uglifies JS, minifies CSS - ready to deploy.

yarn build
# OR
npm run build

Run unit tests

Run unit tests with Karma and Mocha

yarn test
# OR
npm run test