Skip to content

A robust financial tracking system with real-time analytics and budgeting.

Notifications You must be signed in to change notification settings

adhamNemr/ExpenseTracker

Repository files navigation

💰 Expense Tracker API (SaaS MVP)

Net Core Architecture Database Status

A professional, scalable Expense Tracking SaaS Backend built with .NET 9, following the principles of Clean Architecture and Domain-Driven Design (DDD). Designed to be the robust core for a modern financial management dashboard.


🏗️ Architecture

This project is structured around the Dependency inversion principle, ensuring the core domain logic is decoupled from external frameworks and UI.

graph TD;
    API[Presentation Layer (API)] --> Application;
    Infrastructure --> Application;
    Application --> Domain;
    Infrastructure --> Domain;
Loading

Layers Breakdown

  • ExpenseTracker.Domain: The heart of the system. Contains Entities, Enums, and Repository Interfaces. No dependencies.
  • ExpenseTracker.Application: Business logic, DTOs, Validators, and Service Interfaces. Orchestrates data flow.
  • ExpenseTracker.Infrastructure: Implementation of data access (EF Core), external services, and repositories.
  • ExpenseTracker.API: The entry point. Controllers, Middleware, and Dependency Injection configuration.

🚀 Tech Stack & Features

  • Core: .NET 9.0, C# 12
  • Data Access: Entity Framework Core, Repository Pattern
  • Database: MySQL 8.0
  • Validation: FluentValidation
  • Mapping: AutoMapper
  • Logging: Serilog (Structured Logging)
  • Documentation: Swagger / OpenAPI (with JWT Auth support)
  • Authentication: JWT (JSON Web Tokens) with Refresh Tokens
  • Security: BCrypt hashing, CORS policies, Exception Handling Middleware

🛠️ Getting Started

Prerequisites

  • .NET 9.0 SDK
  • MySQL Server

Installation (The Easy Way 🐳)

Pre-requisite: Make sure you have Docker and Docker Compose installed.

  1. Clone the repository

    git clone https://github.com/your-username/ExpenseTracker.git
    cd ExpenseTracker
  2. Run with Docker Compose

    docker-compose up --build
  3. Access the App

    Note: If running for the first time, you may need to apply migrations manually or simply let the API initialize.


Installation (Manual Way)

  1. Configure Database Update appsettings.json or preferably use User Secrets:

    "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Port=3306;Database=ExpenseTrackerDb;User=root;Password=YOUR_STRONG_PASSWORD;"
    }
  2. Run Migrations

    dotnet ef database update --project ExpenseTracker.Infrastructure --startup-project ExpenseTracker.API
  3. Run the API

    dotnet run --project ExpenseTracker.API
  4. Explore Navigate to https://localhost:7139/swagger to view the interactive API documentation.


🧪 Testing

The solution includes a dedicated test project ExpenseTracker.Tests using xUnit and FluentAssertions.

dotnet test

🔮 Future Roadmap

  • Docker Support: Containerize the API and Database.
  • CI/CD Pipeline: GitHub Actions for automated testing and deployment.
  • Role-Based Access Control (RBAC): Admin vs User roles.
  • Reporting Service: Background jobs for generating monthly PDF reports.

Developed by Adham - Backend Engineer

About

A robust financial tracking system with real-time analytics and budgeting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published