How kajjayamadithya/expense-tracker-website works
Project Type and Purpose
• This is a static, front-end only web application (“Expense Tracker Website”) built with HTML, CSS (Bootstrap), and plain JavaScript.
• Its purpose is to let users add income/expense entries, view transaction history, calculate balances in real time, and delete transactions.
High-Level File-Structure Analysis
• Top-level files:
• loginpage.html, loginpage.css, loginpage.js
• trackerpage.html, trackerpage.css, trackerpage.js
• No backend or server directory—everything runs in the browser.
• No build scripts or external services; runs by opening index.html.
Main Architectural Components
a. Browser/Client
• Hosts the UI, executes HTML/CSS/JS.
b. UI Layer
• HTML pages (Login, Tracker)
• CSS (custom + Bootstrap)
c. Controller / Business-Logic Layer
• JavaScript modules that handle:
• Event listeners (form submission, delete buttons)
• Model updates (adding/removing transactions)
• Balance calculation (income vs. expense totals)
d. View-Rendering Layer
• DOM manipulation functions that:
• Insert transaction items into the list
• Update balance, total income, total expenses fields
e. Persistence Layer
• Browser storage (e.g., localStorage) to persist transactions across reloads
f. Data Model
• In-memory array or object collection representing transactions
Relationships and Data Flows
• User interacts with UI (fills form or clicks delete) →
Controller captures event →
• Updates Data Model →
• Persists change to localStorage →
• Invokes View module to re-render transaction list and recalculated balances.
• On page load: Controller reads persisted transactions → initializes View.
Architectural Patterns and Principles
• MVC-style separation:
• Model: transaction data
• View: DOM updates & CSS styling
• Controller: event handling and business logic
• Single-page behavior for the tracker: two distinct HTML “pages” but could be treated as two views in one client app.
• Progressive enhancement: works with vanilla JS + Bootstrap, no dependencies on frameworks.
Essential Elements
• Clear, concise component labels matching actual file names/directories
• Notes on key technologies (HTML5, CSS3 with Bootstrap, ES6 JavaScript, localStorage API)