A rate calculator application built with React + TypeScript (Vite) for the frontend and Express + TypeScript (better-sqlite3) for the backend.
index.html # Vite HTML entry point
vite.config.ts # Vite configuration (dev proxy → Express)
tsconfig.json # TypeScript project references
src/
main.tsx # React entry point
App.tsx # Root component (auth state)
App.css # Global styles
api/auth.ts # Fetch helpers (login, register, calculate, logs)
components/
LoginForm.tsx
RegisterForm.tsx
Calculator.tsx
LogsHistory.tsx
types/index.ts # Shared TypeScript types
utils/
calculateWithRates.ts # Pure calculation logic
server/
index.ts # Express server (auth, API, SQLite)
tests/
calculateWithRates.test.ts # Vitest unit tests
npm installnpm run dev # Vite dev server on :5173, proxies /api → :3000npm run server # Express API server on :3000npm test # Run Vitest once
npm run test:watch # Watch modenpm run build # TypeScript check + Vite build → dist/
npm run preview # Preview production build-
Clone the repository:
git clone <repository-url> cd appscript
-
Install dependencies:
npm install
-
Run the project:
npm start
Or open
index.htmldirectly in your browser for a static demo.
This project is for demonstration purposes only.