How vivek081202/fintrack-expense_and_budget_analyzer works
Project Type and Purpose
• FinTrack is a command-line, single-executable C application that provides expense tracking, budget management, and basic analytics via file-based persistence. There is no separate frontend server or database—everything runs in one process and reads/writes flat files.
File Structure
• Top-level:
• src/ – C source and headers
• data/ – sample budgets.txt and expenses.txt
• docs/ – project synopsis and example outputs
• README.md, LICENSE
• Inside src/:
• main.c – entry point, CLI loop
• fintrack.h – core logic declarations (sorting, searching, expense & budget functions)
• output/ – compiled binaries and various user_data text files
• Persistence:
• user_data.txt, <username>_data.txt, budgets.txt, expenses.txt
Pull Key Insights from README
• Core modules: Expense Tracking, Budget Management, Data Visualization
• Algorithms: Merge Sort, Binary Search
• File-based storage for user data
• Planned enhancements: bank API integration, auth/login not yet implemented
Main Components
a. Presentation Layer (CLI UI)
• Login/Register prompts (NEW MODULE)
b. Authentication Module (NEW)
• Functions: registerUser(), loginUser()
• Reads/writes user_data.txt entries
c. Business Logic Layer
• ExpenseManager: addExpense(), listExpenses(), sort/Search
• BudgetManager: setBudget(), checkBudgetStatus()
• AnalyticsEngine: generateCharts(), calculateTrends
d. Persistence Layer
• FileStore: fileRead(), fileWrite(), temp file ops
• Data files: expenses.txt, budgets.txt, <username>_data.txt
e. (Optional) External Services
• BankAPIConnector (future) for automatic transaction import
Relationships and Data Flow
• On startup → CLI UI shows Login/Register → calls Auth Module
• Auth Module ↔ FileStore → validate or create user record
• Post-login → CLI UI presents main menu → routes commands to ExpenseManager or BudgetManager
• Managers ↔ AnalyticsEngine (for sorting/searching)
• Managers ↔ FileStore → read/write expense & budget files
• AnalyticsEngine → returns stats and chart data back to CLI UI for display
Architectural Patterns & Principles
• Modular separation by functionality (Auth, UI, Expense, Budget, Persistence, Analytics)
• Single responsibility per module
• File-based “repository” abstraction hiding raw I/O
• Procedural layering: UI → Business → Persistence
• Future-proof extension points for API integration