Implementation of a calculator with a web interface in React, a service in Golang, and calculations in C++.
This project implements a web calculator with the following capabilities:
- Page navigation
- Calculation of the value of a function at a point
- Direct calculation
- Graphing functions
- Saving and using expression history
This project is a modification of the previous version of the calculator SmartCalculation-v2.0.
What was used:
- Frontend -
JS + React
- Backend -
Golang + Chi
- Core -
C++ + C
All components of the project are launched in separate docker containers and combined into one layer with
using docker-compose. Accordingly, docker
and docker-compose
are required to run this application.
The application uses the following ports:
- 3000 - frontend (main)
- 8080 - backend
Frontend has the following endpoints:
- / - home page, application navigation
- /calculator - page with a calculator
- /plot - page with plotting
- /reference - help page
Backend has the following endpoints:
- /api/calculator - calculate the value of an expression, query parameters: expression, x
- /api/plot - calculation of function values for plotting, query parameters: expression, begin, end
- /api/previous_expression - returns the previous successfully evaluated expression
- /api/clear_history - clears the history of expressions
To run the make
application to clear the cache of the docker containers make clean
.
Some examples of what the web interface looks like:
Home page
Calculator
Graphing
Reference