How sankarapubalaji/expensive-tracker-frontend works
Project type and purpose
• This is a Single-Page Application (SPA) built with React (Create React App).
• It serves as a personal finance dashboard: users can register/login, track budgets and transactions, and view reports.
• There is no embedded backend code here—network calls go out to external HTTP APIs for auth, budgeting and reporting.
File structure
Top level:
– public/ → static HTML, manifest, robots.txt
– src/ → all client-side logic
• components/ (UI components grouped by feature: budgets, transactions, reports, common)
• pages/ (route-level containers for each screen)
• context/ (React Context providers: AuthContext, BudgetContext, TransactionContext, ThemeContext, FinanceCoordinator)
• services/ (API abstraction layers: api.js, auth.js)
• utils/, styles/ (helpers and styling)
– root package.json, build scripts for webpack, Babel, etc.
Readme insights
• Bootstrapped with CRA; no custom architecture notes.
• Assumes standard React build → deploy pipeline.
Main components and relationships
a. Browser / Frontend
• Entry point: index.js / App.js
• Routes: ProtectedRoute wraps pages (Home, Dashboard, BudgetsPage, TransactionsPage, ReportsPage, Profile, Settings, Login, Register, ForgotPassword)
• UI component tree: pages → skeleton components → feature components → common controls (Button, Input, Modal, Loader, Navbar)
b. State management layer
• Context providers wrap App:
– AuthContext handles login state & tokens
– BudgetContext manages budgets data cache
– TransactionContext manages transaction list & operations
– ThemeContext controls theming
– FinanceCoordinator can orchestrate cross-slice operations
c. Service / API layer
• src/services/api.js sets up Axios/fetch base URL, interceptors
• auth.js exposes login/register/forgot-password endpoints
• other endpoints implied (budgets, transactions, reports)
d. External systems
• Authentication & data REST API server (hosted elsewhere)
• Optionally: third-party charting or analytics (if used)
Architectural patterns & principles
• Component-based UI (React)
• Context API for global state (avoiding Redux)
• Separation of concerns:
– UI layer (components/pages)
– State layer (contexts)
– Data layer (services)
• Protected routes for auth gating
• Modals handled at component and utils level