This project is a simple full-stack calculator application built by students.
The goal is to learn how frontend and backend systems work together by building a calculator from scratch using:
- Rust for the backend (API + logic)
- React for the frontend (UI)
Students will implement basic calculator operations and connect the frontend to the backend through HTTP requests.
By the end of this project, you should be able to:
- Build a REST API in Rust
- Understand how a frontend communicates with a backend
- Manage application state in React
- Handle user input and display results
- Structure a simple full-stack project
calculator-project/
│
├── backend/ # Rust API
├── frontend/ # React app
└── README.md
-
Basic arithmetic operations:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
-
Input validation
-
Error handling (e.g. divide by zero)
-
API communication between frontend and backend
git clone <repo-url>
cd calculator-project
Make sure Rust is installed:
rustc --version
Run the backend:
cd backend
cargo run
Make sure Node.js is installed:
node -v
Run the frontend:
cd frontend
npm install
npm start
Request:
{
"operation": "add",
"a": 5,
"b": 3
}Response:
{
"result": 8
}- Do NOT copy full solutions — focus on learning
- Keep code simple and readable
- Commit regularly with clear messages
- Ask questions when stuck
A working calculator where:
- The frontend sends requests
- The backend processes calculations
- The result is displayed to the user
- Add more operations (%, power, square root)
- Add history of calculations
- Improve UI design
- Add unit tests
Happy coding 🚀