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

No packages published

Languages