How kargilhero/financial-dashboard works
Project Type & Purpose
• This is a full-stack, monolithic web application: a Financial Dashboard built with Node.js/Express on the backend, EJS template rendering, and static front-end assets (HTML/CSS/JS) delivered from the public/ folder.
• It offers user authentication, a suite of financial calculators and planners, to-do management, real-time charts, stock/news integration, currency conversion, and an admin message panel.
High-Level Architecture Components
a. Frontend (Client Browser)
• Static assets: public/css/*.css, public/js/*.js
• EJS templates: views/*.ejs, partials like navbar.ejs
• Charting libraries (Chart.js or ApexCharts) for data visualization
b. Backend (Express Server)
• Entry point: server.js
• Middleware: express-session (session handling), bcrypt (password hashing), body parsers, static file serving
• Routing & Controllers (grouped in server.js or separate route files):
– Auth (login, register, password reset via Nodemailer)
– Dashboard & tools (net worth, loan, tax, retirement, debt)
– To-Do CRUD
– Stock & news fetch
– Contact form & admin messages
c. Data Layer
• MySQL database (users, sessions, to-dos, messages, tool inputs/results)
• ORM or raw queries in controllers/models
d. External Services
• Currency conversion API
• Stock price & news APIs
• SMTP service via Nodemailer for password recovery emails
Relationships & Data Flows
• Client → HTTP(S) GET/POST → Express routes
• Routes → Controllers → (a) MySQL for CRUD, (b) External API calls
• Controllers → Render EJS views or send JSON → Client
• Session middleware tracks login state (session cookie stored on client → server memory or DB)
• Nodemailer invoked by backend to send emails
Architectural Patterns & Principles
• MVC‐style separation:
• View: EJS templates + static assets
• Controller/Route: request handling, business logic
• Model/Data: MySQL tables accessed via queries or an ORM layer
• Layered architecture: presentation, application, data, external integration
• Single-process monolith, modularized by feature (auth, tools, to-do, admin)
• Use of middleware for cross‐cutting concerns (logging, sessions, security)
Detail & Granularity
• Every external dependency (currency API, stock API, SMTP) as its own node.
• Session store—either in-memory or in the MySQL DB—as part of the Data Layer.