Skip to content

Multi-Currency Expense Operating Backend is a scalable backend system that manages expenses across multiple currencies and accurate financial records

Notifications You must be signed in to change notification settings

Satyam8589/FinterHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FinterHub

FinterHub Logo

A Multi-Currency Expense Management Platform for International Communities

Node.js Express MongoDB Docker License

Features โ€ข Tech Stack โ€ข Getting Started โ€ข API Documentation โ€ข Contributing


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

FinterHub is a comprehensive expense management platform designed specifically for international students, foreign interns, and multicultural communities who share expenses across different currencies. The platform provides intelligent expense tracking, automatic currency conversion, and optimized debt settlement algorithms to simplify financial management in diverse groups.

Why FinterHub?

Managing shared expenses becomes complex when participants use different currencies. FinterHub eliminates this complexity by:

  • Automatic Currency Conversion: Real-time conversion to a base currency
  • Smart Debt Simplification: Minimizes the number of transactions needed for settlement
  • Flexible Split Options: Equal, percentage-based, or custom splits
  • Comprehensive Reporting: Detailed expense tracking and settlement reports
  • Secure & Scalable: Built with enterprise-grade security and scalability in mind

๐Ÿš€ Problem Statement

The Challenge

When people from multiple countries live or work together, expense management becomes complicated:

๐Ÿ‡ช๐Ÿ‡บ Person A pays rent in EUR
๐Ÿ‡จ๐Ÿ‡ฆ Person B pays groceries in CAD  
๐Ÿ‡ฎ๐Ÿ‡ณ Person C pays utilities in INR
๐Ÿ‡บ๐Ÿ‡ธ Person D pays transportation in USD

Traditional Problems:

  • Manual currency conversion is error-prone
  • Unclear who owes whom and how much
  • Multiple unnecessary transactions
  • Timezone and exchange rate confusion
  • Lack of transparent audit trails

Our Solution

FinterHub automates the entire process:

  1. Record expenses in any supported currency
  2. Convert automatically to base currency
  3. Calculate accurate balances for all members
  4. Simplify debts using graph algorithms
  5. Settle with minimum transfers
  6. Report with detailed PDF summaries

โœจ Features

Core Functionality

  • Multi-Currency Support

    • Add expenses in INR, EUR, CAD, USD, and more
    • Automatic conversion to group's base currency
    • Historical exchange rate tracking
  • Flexible Expense Splitting

    • Equal split among all members
    • Percentage-based distribution
    • Custom amount allocation
    • Exclude specific members
  • Smart Debt Management

    • Automatic balance calculation
    • Debt simplification algorithm
    • Minimum transfer optimization
    • Settlement history tracking
  • Group Management

    • Create and manage expense groups
    • Invite members via email
    • Role-based permissions
    • Group activity logs

Advanced Features

  • Authentication & Security

    • JWT-based authentication
    • Secure password hashing with bcrypt
    • Role-based access control
    • API rate limiting
  • Reporting & Analytics

    • Monthly settlement reports
    • Expense categorization
    • Group spending analytics
    • Export to PDF
  • Real-time Updates

    • Socket.io integration (optional)
    • Live balance updates
    • Instant notifications
  • Developer-Friendly

    • RESTful API design
    • Comprehensive API documentation
    • Docker containerization
    • Extensive test coverage

๐Ÿ› ๏ธ Tech Stack

Backend

Technology Purpose Version
Node.js Runtime Environment 20.x
Express.js Web Framework 4.x
MongoDB Database 7.x
Mongoose ODM Latest
Redis Caching & Sessions 7.x

Authentication & Security

Technology Purpose
JWT Token-based Authentication
bcrypt Password Hashing
express-rate-limit API Rate Limiting
helmet Security Headers
cors Cross-Origin Resource Sharing

Testing & Quality

Technology Purpose
Jest Testing Framework
Supertest HTTP Testing
ESLint Code Linting

DevOps

Technology Purpose
Docker Containerization
Docker Compose Multi-container Orchestration
PM2 Process Management

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Client Layer                         โ”‚
โ”‚              (Client App / Mobile App / API)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   API Gateway Layer                      โ”‚
โ”‚         (Express.js + Middleware + Rate Limiting)        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                   โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Auth       โ”‚   โ”‚   Expense    โ”‚   โ”‚   Group      โ”‚
โ”‚  Controller  โ”‚   โ”‚  Controller  โ”‚   โ”‚  Controller  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚                   โ”‚                   โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Business Logic Layer                   โ”‚
โ”‚        (Currency Conversion + Debt Simplification)       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                   โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   MongoDB    โ”‚   โ”‚    Redis     โ”‚   โ”‚  File System โ”‚
โ”‚   Database   โ”‚   โ”‚    Cache     โ”‚   โ”‚   (Logs)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Design Patterns

  • MVC Architecture: Separation of concerns
  • Repository Pattern: Data access abstraction
  • Middleware Pattern: Request/response processing
  • Factory Pattern: Object creation
  • Singleton Pattern: Database connections

๐Ÿš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

๐Ÿ“ Project Structure

FinterHub/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ db.js                    # Database configuration
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.controller.js       # Authentication logic
โ”‚   โ”‚   โ”œโ”€โ”€ group.controller.js      # Group management
โ”‚   โ”‚   โ”œโ”€โ”€ expense.controller.js    # Expense handling
โ”‚   โ”‚   โ””โ”€โ”€ settlement.controller.js # Settlement calculations
โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.js                  # JWT authentication
โ”‚   โ”‚   โ”œโ”€โ”€ errorHandler.js          # Error handling
โ”‚   โ”‚   โ””โ”€โ”€ validator.js             # Request validation
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ user.model.js            # User schema
โ”‚   โ”‚   โ”œโ”€โ”€ group.model.js           # Group schema
โ”‚   โ”‚   โ”œโ”€โ”€ expense.model.js         # Expense schema
โ”‚   โ”‚   โ””โ”€โ”€ settlement.model.js      # Settlement schema
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.route.js            # Auth routes
โ”‚   โ”‚   โ”œโ”€โ”€ group.route.js           # Group routes
โ”‚   โ”‚   โ”œโ”€โ”€ expense.route.js         # Expense routes
โ”‚   โ”‚   โ””โ”€โ”€ settlement.route.js      # Settlement routes
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”‚   โ””โ”€โ”€ *.test.js                # Test files
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ currency.js              # Currency utilities
โ”‚   โ”‚   โ”œโ”€โ”€ debtSimplification.js   # Debt algorithm
โ”‚   โ”‚   โ””โ”€โ”€ logger.js                # Logging utility
โ”‚   โ”œโ”€โ”€ .env                         # Environment variables
โ”‚   โ”œโ”€โ”€ .env.docker                  # Docker environment
โ”‚   โ”œโ”€โ”€ Dockerfile                   # Docker configuration
โ”‚   โ”œโ”€โ”€ package.json                 # Dependencies
โ”‚   โ””โ”€โ”€ server.js                    # Entry point
โ”œโ”€โ”€ docker-compose.yml               # Docker Compose config
โ”œโ”€โ”€ .gitignore                       # Git ignore rules
โ”œโ”€โ”€ LICENSE                          # MIT License
โ””โ”€โ”€ README.md                        # This file

๐Ÿค Contributing

We welcome contributions from the community! Here's how you can help:

How to Contribute

  1. Fork the Repository

    git clone https://github.com/yourusername/FinterHub.git
  2. Create a Feature Branch

    git checkout -b feature/amazing-feature
  3. Make Your Changes

    • Write clean, documented code
    • Follow existing code style
    • Add tests for new features
  4. Commit Your Changes

    git commit -m "feat: add amazing feature"
  5. Push to Your Fork

    git push origin feature/amazing-feature
  6. Open a Pull Request

    • Describe your changes
    • Reference any related issues
    • Wait for review

Commit Convention

We follow Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • test: Adding tests
  • refactor: Code refactoring
  • style: Code style changes
  • chore: Maintenance tasks

Code Style

  • Use ESLint for JavaScript
  • Follow Airbnb style guide
  • Write meaningful variable names
  • Add comments for complex logic
  • Keep functions small and focused

๐Ÿ“„ License

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


๐Ÿ™ Acknowledgments

  • Inspired by Splitwise and Tricount
  • Built for international students and interns
  • Special thanks to all contributors

๐Ÿ“ž Contact & Support


๐Ÿ—บ๏ธ Roadmap

Current Version (v1.0)

  • โœ… Multi-currency expense tracking
  • โœ… Group management
  • โœ… Debt simplification
  • โœ… JWT authentication
  • โœ… Docker support

Upcoming Features (v1.1)

  • ๐Ÿ”„ Real-time exchange rate API integration
  • ๐Ÿ”„ Email/SMS notifications
  • ๐Ÿ”„ PDF report generation
  • ๐Ÿ”„ Advanced analytics dashboard

Future Plans (v2.0)

  • ๐Ÿ“… Recurring expenses
  • ๐Ÿ“… Budget limits and alerts
  • ๐Ÿ“… Escrow payment integration
  • ๐Ÿ“… Multi-language support

Made with โค๏ธ for the global community

โญ Star this repo if you find it helpful!

Report Bug โ€ข Request Feature โ€ข Documentation

About

Multi-Currency Expense Operating Backend is a scalable backend system that manages expenses across multiple currencies and accurate financial records

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published