ArithmeticCalculatorREACT

A web application for performing arithmetic calculations using a REST API.


Project Overview

This React WebApp interacts with an Arithmetic Calculator REST API. It supports operations such as:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Square root
  • Random string generation

The backend serves random strings via a webservice provided by Random.Org.


Security

Security is ensured using JWT tokens generated during user authentication, with credentials securely stored in the backend database’s User table.


Configuration

The application uses an .env file for environment-specific settings, with the VITE_BACKEND_API variable specifying the backend API URL. For development, it’s set to:

  • VITE_BACKEND_API= http://127.0.0.1:8000/v1/

Running the Development Version

  1. Ensure that Node.js is installed on your machine.
  2. Clone the repository or download it.
  3. Open terminal and navigate to the folder: CalculatorReact
  4. Run npm install: This will install the dependencies.
  5. Run npm run dev: This will run the app.

Publishing the Production Version

  1. Ensure that Node.js is installed on your machine.
  2. Clone the repository or download it.
  3. Open terminal and navigate to the folder: CalculatorReact
  4. Run npm install: This will install the dependencies.
  5. Run npm run build: This will build the deployable WebApp.
  6. Run npm run preview: This will run the app from the dist folder.

    The generated files for production will be in the dist folder. Deploy the contents of this folder to your hosting service.


LIVE VERSION

Find the running app here: