Calc React is a React 19 + TypeScript calculator built with Vite. It includes memory controls, scientific operations, localized labels and messages, and automated unit, component, and visual tests.
- Basic arithmetic, repeated equals behavior, and chained operations
- Scientific helpers such as square, cube, square root, cube root, factorial, reciprocal, percentage, and constants
- Memory controls for store, recall, and clear
- Language switching for English, Spanish, and Portuguese
- Accessible result output with a responsive layout
- React 19
- TypeScript
- Vite
- ESLint
- Prettier
- Vitest
- Playwright
- React Testing Library
yarn installyarn devyarn buildyarn previewCheck code quality with lint:
yarn lintApply safe ESLint fixes:
yarn lint:fixFormat the repository with Prettier:
yarn formatCheck formatting without writing changes:
yarn format:checkyarn testRun the test watcher while developing:
yarn test:watchGenerate the coverage report:
yarn test:coverageRun the Playwright visual regression suite:
yarn test:visualIf the UI changes intentionally, refresh the snapshots with:
yarn test:visual:updatesrc/components/contains presentational UI componentssrc/features/calculator/contains the calculator hook, reducer, and state wiringsrc/utils/contains pure math and formatting helperssrc/App.tsxandsrc/main.tsxwire the app into Vite and Reactsrc/i18n.tsstores localized messagessrc/constants.tsstores shared labels and operator symbolstests/visual/contains the Playwright visual regression suite and snapshotseslint.config.jsand.prettierrc.jsondefine linting and formatting rules
See ARCHITECTURE.md for a deeper explanation of the design.
Please read CONTRIBUTING.md before sending changes.