How ismaelmarot/cash-counter works
Project Type & Purpose
• This is a frontend-only, single-page web application (SPA) built with React, TypeScript, and Vite.
• Purpose: Provide a quick, responsive UI to input bill denominations, calculate totals, and optionally export to PDF.
High-Level Components
a. User’s Browser (Client)
b. React Application Layer
• App Shell (src/App.tsx & main.tsx)
• UI Components (BillInput, Totals, Footer, LegalModal, TermsModal)
• Shared Utilities (constants, helpers)
• Styling (styled-components)
c. Build & Bundling (Vite)
d. Static Assets (public folder, screenshots, index.html)
e. Deployment Platform (GitHub Pages)
Relationships & Data Flows
• User → Browser → React App (initial page load via index.html)
• BillInput component emits events (onChange) → App state (useState in App.tsx)
• App state → Totals component (props) → UI update
• App state → optional export → jsPDF library (PDF generation)
• Build process: Vite reads src/ and public/, outputs static bundle → GitHub Pages hosting
Architectural Patterns & Design Principles
• Component-based architecture: each UI piece is isolated (BillInput, Totals, etc.)
• Unidirectional data flow: parent (App) holds state, passes props down, child events bubble up
• Separation of concerns:
– src/components (UI logic)
– src/constants (domain data: denominations)
– src/helpers (utilities, e.g., getCurrentYear)
– Styling is managed per-component (styled-components)
• Build-time tooling: Vite for fast HMR and bundling