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
- Ensure that Node.js is installed on your machine.
- Clone the repository or download it.
- Open terminal and navigate to the folder:
CalculatorReact
- Run
npm install
: This will install the dependencies. - Run
npm run dev
: This will run the app.
Publishing the Production Version
- Ensure that Node.js is installed on your machine.
- Clone the repository or download it.
- Open terminal and navigate to the folder:
CalculatorReact
- Run
npm install
: This will install the dependencies. - Run
npm run build
: This will build the deployable WebApp. -
Run
npm run preview
: This will run the app from thedist
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:
- BackEnd Documentation
- FrontEnd WebApp