How asdhamidi/hisaab works
Project Type and Purpose
• Hisaab is a single‑page, React‑based front‑end application whose purpose is to let flatmates log, track, and settle shared expenses.
• It communicates with a remote RESTful API (hosted at https://hisaab-ashy.vercel.app/) for authentication and data persistence.
High‑Level Architecture Components
a. Client Browser
• Hosts the React SPA (public/index.html → src/index.js → App.js).
• Renders UI components, manages routing via React Router.
b. UI Component Layer
• Login/Register (Login.js)
• Navigation (Navbar.js)
• Expense Board (Board.js) & Editor (Editor.js)
• Summary (Summary.js) & OweDetails (OweDetails.js)
• Charts (Stats.js) via Canvas.js
• Activities feed (Activities.js)
• Pop‑up details (Popup.js)
c. API Handling Layer
• api‑handling.js: centralized Axios instance with baseURL and JWT interceptor.
d. Remote Backend Service
• Auth endpoints (/login, /register)
• Expense CRUD endpoints (/entries, /entries/:id)
• Summary, charts, and activity endpoints
e. Data Store (external, not in repo)
• Likely a database (MongoDB, PostgreSQL, etc.) behind the API
Relationships and Data Flows
• On user action (e.g., “Add Entry”), UI component calls api‑handling.js → Axios → remote API.
• JWT from localStorage is attached to every request (except login).
• API returns JSON payload → api‑handling resolves promise → component state updates → UI re‑renders.
• Navbar triggers CSV download by fetching month’s entries from the API.
Architectural Patterns and Design Principles
• Component‑Based Architecture: each feature is isolated in its own React component.
• Single Responsibility: api‑handling.js only handles HTTP concerns; UI components manage view logic.
• Token‑Based Authentication: JWT in localStorage + Axios interceptor.
• RESTful Integration: standard CRUD and aggregate endpoints.
• Unidirectional Data Flow: data flows from API → state → props → view.
Elements
• Component labels (e.g., Login, Board, Stats).