Code Monkey home page Code Monkey logo

my-calculator-using-redux's Introduction

my-calculator-using-redux is a very simple calculator created using basic ReactJs and Redux.Redux is used to maintain a centralized state rather than maintaining component specific state. It makes the code clean and maintainable. The calculator supports basic mathematical operations such as addition, multiplication, subtraction and division.

Valid question pattern - (operand) (operator) (operand)

Examples : 1+2, 3*4, 3-1/2

Invalid question pattern - (operand) (operator)

Examples : 1+2*, 08*2 (since cannot start with 0)

Important points -

  1. Initially the operator buttons, equals button, delete and clear buttons are disabled because the first character that should be entered should be an operand.
  2. If any invalid input is entered e.g. 5+2* then the output "Invalid input" error is shown on the "Your result" screen.
  3. Delete button is used to delete the last character of the input.
  4. Clear is used to clear the question.

Note : The npm start script is configured to run on port 3005.

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3005 to view it in the browser.

Hosting the application to firebase

  1. Create a build of your application by running the command npm run build in your application's root directory. This will create a build folder containing your static build files along with the entry point file of your application i.e. index.html.

  2. Go to the firebase hosting steps from your firebase console and follow the instructions as below by running it in application's root directory,

    a. Install firebase commandline tools with command npm install -g firebase-tools.

    b. Login to firebase using your google account, firebase login.

    c. Initialize your firebase project, firebase init.

    d. Finally deploy the application using command firebase deploy.

  3. You can get your hosted URL from your project hosting dashboard in firebase console.

    Check my calculator - https://my-calculator-using-redux.firebaseapp.com/

my-calculator-using-redux's People

Contributors

hetalrachh avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.