Skip to content

Brijes987/smart-expense-tracker

Repository files navigation

πŸ’° Smart Expense Tracker - Enterprise Microservices Application

A comprehensive, production-ready expense tracking system built with modern microservices architecture, featuring automated budget alerts, real-time currency conversion, and enterprise-grade security.

Docker Spring Boot Node.js MySQL JWT Swagger


πŸ“‹ Project Overview

The Smart Expense Tracker is a full-featured, enterprise-grade expense management system designed using microservices architecture. It provides comprehensive expense tracking, intelligent budget management with automated alerts, real-time currency conversion, and robust security features.

🎯 Key Features

  • πŸ” JWT-based Authentication - Secure user management with role-based access
  • πŸ’³ Comprehensive Expense Management - CRUD operations with advanced filtering
  • πŸ“Š Intelligent Budget Tracking - Automated alerts when 80% of budget is reached
  • πŸ’± Real-time Currency Conversion - Live exchange rates with intelligent caching
  • πŸ“… Automated Notifications - Scheduled reports (hourly, daily, weekly, monthly)
  • πŸ” Advanced Analytics - Expense summaries and budget performance insights
  • πŸ“š Complete API Documentation - Interactive Swagger UI for all services
  • 🐳 Production-Ready Deployment - Docker containerization with one-command setup

🏒 Use Cases

  • Personal Finance Management - Track daily expenses and manage budgets
  • Small Business Accounting - Monitor business expenses across categories
  • Multi-Currency Operations - Handle international transactions seamlessly
  • Budget Compliance - Automated alerts for budget threshold management
  • Financial Reporting - Generate comprehensive expense and budget reports

πŸ—οΈ Architecture Diagram

Smart Expense Tracker Architecture

Note: If the image doesn't display, you can view the interactive diagram by copying the Mermaid code from assets/architecture.mmd to Mermaid Live Editor.

πŸ“‹ View Mermaid Source Code
graph TB
    subgraph "Client Layer"
        WEB[Web Browser]
        MOBILE[Mobile App]
        API_CLIENT[API Client]
    end

    subgraph "API Gateway Layer"
        GATEWAY[API Gateway<br/>Spring Cloud Gateway<br/>Port: 8080]
    end

    subgraph "Microservices Layer"
        USER[User Service<br/>Spring Boot<br/>Port: 8081]
        EXPENSE[Expense Service<br/>Spring Boot<br/>Port: 8082]
        BUDGET[Budget Service<br/>Spring Boot<br/>Port: 8083]
        CURRENCY[Currency Service<br/>Node.js/Express<br/>Port: 3000]
    end

    subgraph "Data Layer"
        USER_DB[(User Database<br/>MySQL)]
        EXPENSE_DB[(Expense Database<br/>MySQL)]
        BUDGET_DB[(Budget Database<br/>MySQL)]
    end

    subgraph "External Services"
        EXCHANGE_API[Exchange Rate API<br/>Real-time Rates]
    end

    subgraph "Cross-Cutting Concerns"
        JWT[JWT Authentication]
        SWAGGER[Swagger Documentation]
        DOCKER[Docker Containers]
        SCHEDULER[Scheduled Jobs]
    end

    %% Client connections
    WEB --> GATEWAY
    MOBILE --> GATEWAY
    API_CLIENT --> GATEWAY

    %% Gateway routing
    GATEWAY --> USER
    GATEWAY --> EXPENSE
    GATEWAY --> BUDGET
    GATEWAY --> CURRENCY

    %% Service to database connections
    USER --> USER_DB
    EXPENSE --> EXPENSE_DB
    BUDGET --> BUDGET_DB

    %% Inter-service communication
    BUDGET -.-> EXPENSE
    EXPENSE -.-> CURRENCY
    CURRENCY --> EXCHANGE_API

    %% Cross-cutting concerns
    JWT -.-> GATEWAY
    JWT -.-> USER
    JWT -.-> EXPENSE
    JWT -.-> BUDGET
    
    SWAGGER -.-> USER
    SWAGGER -.-> EXPENSE
    SWAGGER -.-> BUDGET
    SWAGGER -.-> CURRENCY

    SCHEDULER -.-> BUDGET
    
    DOCKER -.-> USER
    DOCKER -.-> EXPENSE
    DOCKER -.-> BUDGET
    DOCKER -.-> CURRENCY
    DOCKER -.-> USER_DB
    DOCKER -.-> EXPENSE_DB
    DOCKER -.-> BUDGET_DB

    classDef serviceBox fill:#e1f5fe,stroke:#01579b,stroke-width:2px
    classDef databaseBox fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
    classDef gatewayBox fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px
    classDef clientBox fill:#fff3e0,stroke:#e65100,stroke-width:2px
    classDef externalBox fill:#fce4ec,stroke:#880e4f,stroke-width:2px

    class USER,EXPENSE,BUDGET serviceBox
    class CURRENCY serviceBox
    class USER_DB,EXPENSE_DB,BUDGET_DB databaseBox
    class GATEWAY gatewayBox
    class WEB,MOBILE,API_CLIENT clientBox
    class EXCHANGE_API externalBox
Loading

πŸ”„ Service Communication Flow

  1. Authentication Flow: Client β†’ API Gateway β†’ User Service β†’ JWT Token
  2. Expense Management: Client β†’ API Gateway β†’ Expense Service β†’ Database
  3. Budget Tracking: Budget Service β†’ Expense Service (spending data) β†’ Notifications
  4. Currency Conversion: Expense Service β†’ Currency Service β†’ External API
  5. Automated Alerts: Scheduler β†’ Budget Service β†’ Notification System

πŸ› οΈ Tech Stack

Backend Services

Component Technology Version Purpose
API Gateway Spring Cloud Gateway 2023.0.0 Request routing, authentication, CORS
User Service Spring Boot 3.2.0 User management, JWT authentication
Expense Service Spring Boot 3.2.0 Expense CRUD, filtering, analytics
Budget Service Spring Boot 3.2.0 Budget management, alerts, scheduling
Currency Service Node.js + Express 18+ Real-time currency conversion

Database & Storage

Component Technology Version Purpose
Primary Database MySQL 8.0 User, expense, and budget data
Database Per Service MySQL Schemas 8.0 Microservices data isolation
Connection Pooling HikariCP Built-in Database connection management

Security & Authentication

Component Technology Version Purpose
Authentication JWT (JSON Web Tokens) 0.12.3 Stateless authentication
Password Hashing BCrypt Built-in Secure password storage
API Security Spring Security 6.x Endpoint protection
CORS Spring Cloud Gateway Built-in Cross-origin request handling

Documentation & Testing

Component Technology Version Purpose
API Documentation Swagger/OpenAPI 3.0 Interactive API documentation
Unit Testing JUnit 5 + Mockito 5.x Service layer testing
Integration Testing Spring Boot Test 3.2.0 End-to-end API testing
Test Containers TestContainers Latest Database integration testing

DevOps & Deployment

Component Technology Version Purpose
Containerization Docker Latest Service containerization
Orchestration Docker Compose Latest Multi-container deployment
Build Tool (Java) Maven 3.9+ Java project build management
Build Tool (Node.js) npm 9+ Node.js dependency management

External Integrations

Component Technology Purpose
Exchange Rate API exchangerate-api.com Real-time currency conversion rates
Caching Node-Cache Currency rate caching for performance
Scheduling Spring Scheduler Automated budget alerts and reports

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose installed
  • Ports 3000, 3306, 8080-8083 available

One-Command Deployment

# Clone the repository
git clone https://github.com/Brijes987/smart-expense-tracker.git
cd smart-expense-tracker

# Deploy everything with one command
docker-compose up --build -d

# Verify all services are running
docker-compose ps

Access Points

πŸŽ‰ PROJECT STATUS: 100% COMPLETE & FUNCTIONAL

βœ… ALL FEATURES IMPLEMENTED

  • Complete Microservices Architecture (5 services)
  • User Service - Registration, login, JWT authentication
  • Expense Service - Full CRUD with advanced filtering
  • Budget Service - Budget management with automated alerts
  • Currency Service - Real-time conversion with caching
  • API Gateway - Secure routing with JWT validation
  • Database Management - Separate MySQL schemas per service
  • Swagger Documentation - Complete API documentation
  • Docker Containerization - Production-ready deployment
  • Automated Testing - Unit and integration tests
  • Budget Alert System - 80% threshold notifications
  • Scheduled Jobs - Hourly, daily, weekly, monthly reports
  • Health Monitoring - Health check endpoints
  • Security - JWT authentication across all services

About

🏒 Enterprise-grade Smart Expense Tracker built with microservices architecture. Features JWT auth, automated budget alerts, real-time currency conversion, and comprehensive API documentation. Spring Boot + Node.js + MySQL + Docker.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors