A clean one-page calculator app built with Codexirra, using a React, Vite, TypeScript frontend and a FastAPI backend.
This template was generated with Codexirra, an AI development workspace for building real web applications. Codexirra helps you generate, edit, preview, and refine full web apps from simple prompts.
Want to build your own app like this?
Try Codexirra: https://codexirra.com
This project is an example of what can be created using Codexirra.
Codexirra can help generate complete web applications with:
- Frontend pages and components
- Backend API routes
- Clean UI layouts
- Forms, tables, dashboards, and app logic
- Full project structure
- Editable code and live preview
This calculator template is intentionally simple, making it a good starter example for testing a full frontend and backend app structure.
- Adds, subtracts, multiplies, divides, and calculates modulo.
- Supports decimal numbers and keyboard input.
- Shows clear loading and error states.
- Keeps the five most recent calculations on the page.
- Uses a real backend endpoint for safe expression evaluation.
/
src/ React frontend
backend/app/main.py FastAPI backend
Install dependencies:
npm installRun the frontend:
npm run devBuild the frontend:
npm run buildThe frontend API client reads VITE_API_URL or VITE_API_BASE_URL when provided. If neither is configured, it uses same-origin /api. The helper always normalizes the base so calls go to /api/calculate.
Install backend dependencies:
cd backend
pip install -r requirements.txtRun the API:
uvicorn app.main:app --reloadAvailable backend routes:
GET /api/healthPOST /api/calculate
Open the app, tap the calculator buttons, or use your keyboard:
- Number keys enter digits.
+,-,*,/,%, and.enter operators and decimals.Entersolves.Backspacedeletes one character.Escapeclears the calculator.