Skip to content

Varun2045/FinanceTrackerAI

Repository files navigation

💰 FinanceTracker: AI-Powered Wealth Management

Live Demo: https://fj-be-r2-varun-damani-vit-vellore-1.onrender.com

FinanceTracker is a high-performance, full-stack Financial Dashboard designed to provide users with deep insights into their household economy. By combining PostgreSQL data persistence with Google Gemini AI, the platform transforms raw transactions into actionable financial wisdom.


🚀 Key Features

  • AI Insights Advisor: Leverages Google Gemini AI to analyze spending habits and provide personalized budget optimization feedback.
  • Dynamic Visual Analytics: Real-time 7-day cash flow trends and categorical expense distribution powered by Chart.js.
  • Visual Ledger: Highly scannable transaction history featuring Emerald Green (+) for income and Rose Red (-) for expenses.
  • CSV Bank Import: Automated transaction import from bank statements with smart categorization.
  • Multi-Currency Engine: Global readiness with real-time switching between INR (₹), USD ($), and EUR (€).
  • Advanced Data Filtering: Instant search and multi-parameter filtering (type, category, date) with a dedicated Reset Filter UI.
  • 🔒 Enhanced Security: Rate limiting, input validation, secure authentication, and comprehensive logging.
  • 🧪 Testing Suite: Comprehensive test coverage with Jest and automated testing workflows.
  • 📊 Structured Logging: Winston-based logging system for monitoring and debugging.

📸 Dashboard Preview

1. Real-time Cash Flow Analytics

Financial Analytics

2. Gemini AI Insights & Transaction Entry

Smart Entry & AI Advisor

3. Expense Distribution & Budget Tracking

Budgeting & Progress

.4 Custom Category Management & Financial Goal Tracking

Categories & Goals

5. Searchable Transaction History

Transaction Ledger

🛠️ The Tech Stack

Layer Technology Used
Deployment Render (Live Production)
Frontend Tailwind CSS, JavaScript (ES6+), Chart.js
Backend Node.js, Express.js
Database PostgreSQL (Hosted on Neon.tech)
ORM Sequelize
AI Integration Google Gemini 2.5 Flash API
Authentication JWT (JSON Web Tokens) & Google OAuth 2.0
Security Rate Limiting, Input Validation, CORS
Testing Jest, Supertest
Logging Winston

🏛️ Architecture & Clean Code

This project strictly adheres to the Model-View-Controller (MVC) design pattern to ensure scalability and separation of concerns.

MVC Architecture

  • Models: Managed via Sequelize for schema-based data integrity.
  • Controllers: Decoupled business logic handling Authentication, Transactions, AI Analysis, and File Uploads.
  • Security: Production-ready environment variable protection via .gitignore to secure sensitive API keys.
  • Middleware: Centralized validation, rate limiting, and error handling.
  • Testing: Comprehensive test suite with automated coverage reporting.

⚙️ Setup & Installation

  1. Clone the repository:

    git clone https://github.com/Varun2045/FJ-BE-R2-Varun-Damani-VIT-Vellore.git
    cd FJ-BE-R2-Varun-Damani-VIT-Vellore
  2. Install dependencies:

    npm install
  3. Configure Environment Variables: Copy the example environment file and configure:

    cp .env.example .env

    Edit .env file and add your configuration:

    PORT=3000
    DATABASE_URL=your_neon_postgresql_url
    JWT_SECRET=your_super_secret_jwt_key_here_at_least_32_characters_long
    GEMINI_API_KEY=your_google_ai_key
    GOOGLE_CLIENT_ID=your_google_id
    GOOGLE_CLIENT_SECRET=your_google_secret
    BASE_URL=http://localhost:3000
  4. Launch the Server:

    npm run dev

🧪 Testing

Run the test suite:

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage report
npm run test:coverage

🔧 Development Tools

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

📝 API Documentation

Authentication Endpoints

  • POST /api/auth/register - User registration with validation
  • POST /api/auth/login - User login with rate limiting
  • GET /api/auth/google - Initiate Google OAuth
  • GET /api/auth/google/callback - Google OAuth callback

Transaction Endpoints

  • GET /api/transactions - Get user transactions
  • POST /api/transactions - Create new transaction
  • PUT /api/transactions/:id - Update transaction
  • DELETE /api/transactions/:id - Delete transaction

Bank Import Endpoints

  • POST /api/bank/import/upload - Import transactions from CSV bank statement

Security Features

  • Rate Limiting: Auth endpoints (5/15min), AI endpoints (20/hour)
  • Input Validation: Comprehensive validation using express-validator
  • CORS Protection: Environment-based CORS configuration
  • Structured Logging: Winston-based logging with security event tracking

📝 License

Distributed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors