Skip to content

naldmach/PersonalFinanceTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Personal Finance Tracker

A comprehensive C# console application for tracking personal expenses, income, and budgets with data persistence and reporting features. Now fully optimized for cross-platform development with SQLite support!

πŸš€ Key Features

1. User Authentication

  • User registration and login system
  • JWT-based authentication
  • Secure password hashing with BCrypt

2. Expense Categorization

  • Pre-defined expense and income categories
  • Category-based transaction organization
  • Colorful category visualization

3. Budget Planning

  • Create and manage budgets for different categories
  • Real-time budget tracking and spending alerts
  • Budget performance analysis
  • Over-budget notifications

4. Financial Reports

  • Comprehensive financial reporting
  • Category breakdown analysis
  • Monthly spending trends
  • Budget performance reports
  • LINQ-powered data analysis

πŸ› οΈ Technologies Used

  • C# (.NET 9)
  • Entity Framework Core - Data persistence
  • SQLite - Cross-platform database (Windows, macOS, Linux)
  • LINQ - Data querying
  • JWT - Authentication
  • BCrypt - Password hashing
  • Clean Architecture - Project structure

πŸ“ Project Structure

PersonalFinanceTracker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Domain/                 # Core business entities
β”‚   β”‚   └── Entities/
β”‚   β”‚       β”œβ”€β”€ User.cs
β”‚   β”‚       β”œβ”€β”€ Transaction.cs
β”‚   β”‚       β”œβ”€β”€ Category.cs
β”‚   β”‚       └── Budget.cs
β”‚   β”œβ”€β”€ Application/            # Business logic layer
β”‚   β”‚   β”œβ”€β”€ DTOs/              # Data Transfer Objects
β”‚   β”‚   └── Services/          # Application services
β”‚   β”œβ”€β”€ Infrastructure/         # Data access layer
β”‚   β”‚   └── Data/
β”‚   β”‚       └── ApplicationDbContext.cs
β”‚   β”œβ”€β”€ WebApi/                # REST API layer
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   └── Services/
β”‚   └── ConsoleClient/         # Console application
β”‚       β”œβ”€β”€ Services/
β”‚       └── Models/

πŸ—„οΈ Database Schema

Core Entities

  • Users: User accounts with authentication
  • Categories: Expense/Income categories with colors
  • Transactions: Financial transactions linked to users and categories
  • Budgets: Budget planning with spending tracking

Key Relationships

  • Users have many Transactions and Budgets
  • Categories can have many Transactions and Budgets
  • Budgets track spending within date ranges

🎯 Features Overview

Transaction Management

  • βœ… Add income and expense transactions
  • βœ… Categorize all transactions
  • βœ… View transaction history
  • βœ… Transaction summaries with totals
  • βœ… Date-range filtering

Budget Planning

  • βœ… Create budgets for expense categories
  • βœ… Set budget periods (start/end dates)
  • βœ… Real-time spending tracking
  • βœ… Budget progress visualization
  • βœ… Over-budget alerts

Reporting & Analytics

  • βœ… Comprehensive financial reports
  • βœ… Category breakdown analysis
  • βœ… Monthly trend analysis
  • βœ… Budget performance reports
  • βœ… Visual progress bars in console

User Experience

  • βœ… Intuitive console interface
  • βœ… Color-coded displays
  • βœ… Secure authentication
  • βœ… Error handling and validation

πŸš€ Getting Started

Prerequisites

  • .NET 9 SDK
  • Cross-platform support (Windows, macOS, Linux)
  • Visual Studio, VS Code, or any .NET IDE

Setup Instructions

  1. Clone the repository

    git clone <repository-url>
    cd PersonalFinanceTracker
  2. Build the solution

    dotnet build
  3. Start the API server

    cd src/WebApi
    dotnet run --profile http

    The API will be available at http://localhost:5269

  4. Run the console client

    cd src/ConsoleClient
    dotnet run

First Run

  1. The SQLite database will be created automatically on first run
  2. Pre-defined categories will be seeded
  3. Register a new user account
  4. Start tracking your finances!

πŸ’‘ Usage Guide

Console Application Flow

  1. Authentication

    • Register new account or login
    • Secure JWT-based session management
  2. Main Menu Options

    • πŸ’° Transaction Management
    • πŸ“Š Budget Planning
    • πŸ“ˆ Financial Reports
    • 🏷️ Category Management
    • πŸ“‹ Quick Summary
  3. Transaction Management

    • Add income/expense transactions
    • Select from available categories
    • View transaction history
    • Get spending summaries
  4. Budget Planning

    • Create budgets for expense categories
    • Monitor spending against budgets
    • View budget performance
    • Get over-budget alerts
  5. Financial Reports

    • Generate comprehensive reports
    • Analyze spending by category
    • View monthly trends
    • Track budget performance

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login

Transactions

  • GET /api/transactions - Get user transactions
  • POST /api/transactions - Create transaction
  • GET /api/transactions/summary - Get transaction summary
  • DELETE /api/transactions/{id} - Delete transaction

Budgets

  • GET /api/budgets - Get user budgets
  • POST /api/budgets - Create budget
  • GET /api/budgets/active - Get active budgets
  • GET /api/budgets/summary - Get budget summary

Categories

  • GET /api/categories - Get categories
  • GET /api/categories/with-stats - Get categories with statistics

Reports

  • POST /api/reports/financial - Generate financial report
  • GET /api/reports/category-breakdown - Get category breakdown
  • GET /api/reports/monthly-trends - Get monthly trends

πŸ“Š Pre-defined Categories

Expense Categories

  • 🍽️ Food & Dining
  • πŸš— Transportation
  • πŸ›οΈ Shopping
  • 🎬 Entertainment
  • πŸ’‘ Bills & Utilities
  • πŸ₯ Health & Fitness

Income Categories

  • πŸ’Ό Salary
  • πŸ“ˆ Investment
  • πŸ’» Freelance
  • πŸ’° Other Income

πŸ”’ Security Features

  • JWT authentication with configurable expiry
  • Password hashing using BCrypt
  • User data isolation
  • Input validation and sanitization

🎨 Console UI Features

  • Color-coded transaction displays (green for income, red for expenses)
  • Progress bars for budget tracking
  • Tabular data presentation
  • Interactive menu system
  • Error handling with user-friendly messages

πŸ—οΈ Architecture Highlights

Clean Architecture

  • Domain Layer: Core business entities
  • Application Layer: Business logic and services
  • Infrastructure Layer: Data access and external services
  • Presentation Layer: Web API and Console UI

Design Patterns

  • Repository pattern via Entity Framework
  • Dependency Injection
  • DTO pattern for data transfer
  • Service layer pattern

Data Persistence

  • Entity Framework Core with SQLite
  • Cross-platform database support
  • Code-first approach with automatic database creation
  • Seed data for categories
  • Relationship management

πŸ› Recent Fixes & Improvements

βœ… All Issues Resolved!

  • Database Compatibility: Migrated from SQL Server to SQLite for cross-platform support
  • Math Function Issues: Replaced Math.Abs() and Math.Max() with SQLite-compatible alternatives
  • Enum Serialization: Fixed all CategoryType and BudgetStatus serialization issues
  • Type Conversion: Resolved JSON deserialization errors in console client
  • Dependency Injection: Fixed service registration and resolution issues
  • HTTPS Redirect: Disabled HTTPS redirect for development environment

πŸ”§ Technical Improvements

  • SQLite Database: Lightweight, file-based database that works on all platforms
  • LINQ Translation: All queries now properly translate to SQLite
  • JSON Serialization: Proper enum-to-string conversion for API responses
  • Error Handling: Comprehensive error handling and user-friendly messages
  • Build System: Clean builds across all projects

πŸš€ Current Status

πŸŽ‰ PROJECT IS FULLY FUNCTIONAL!

  • βœ… API Server: Running on HTTP port 5269
  • βœ… Database: SQLite with automatic creation and seeding
  • βœ… Authentication: JWT-based user registration and login
  • βœ… All Features: Transactions, budgets, categories, and reports working
  • βœ… Console Client: Interactive interface with all functionality
  • βœ… Cross-Platform: Works on Windows, macOS, and Linux

πŸš€ Future Enhancements

  • Web-based UI
  • Mobile app integration
  • Data export/import features
  • Advanced reporting with charts
  • Multi-currency support
  • Recurring transaction support
  • Investment tracking
  • Bill reminders

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with .NET 9 and Entity Framework Core
  • Optimized for cross-platform development
  • SQLite database for universal compatibility
  • Inspired by modern personal finance management needs
  • Designed for extensibility and maintainability

Happy Financial Tracking! πŸ’°πŸ“Š

Last Updated: August 2025 - Now with full cross-platform support and all issues resolved!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages