Skip to content

skylart2025S/VTHacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

64 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

RoomieLoot - Budget Battle Royale ๐Ÿ’ฐ๐Ÿ†

Turn budgeting into epic battles. Compete with friends, master your spending, and climb the leaderboard with AI-powered insights.

RoomieLoot is a gamified financial management platform that transforms personal finance into an engaging, competitive experience. Connect your bank accounts, track your financial health, compete with friends on leaderboards, and receive AI-powered financial advice to level up your money management skills.

๐ŸŽฏ Project Overview

RoomieLoot combines real financial data integration with gaming mechanics to make budgeting fun and motivating. The platform integrates with Plaid's API to fetch your actual bank account and transaction data, calculates your financial wellness score, and creates competitive leaderboards where you can challenge friends to improve their financial habits.

Key Features

  • ๐Ÿฆ Real Financial Data: Connect your bank accounts via Plaid API for live transaction and balance data
  • ๐Ÿ“Š Financial Wellness Scoring: AI-powered scoring system that evaluates your financial health (0-100)
  • ๐Ÿ† Competitive Leaderboards: Compete with friends on financial efficiency and savings goals
  • ๐Ÿค– AI Financial Advisor: Personalized financial recommendations and advice
  • ๐ŸŽฎ Gamification Elements: Achievements, badges, and progress tracking
  • ๐Ÿ“ฑ Modern Dashboard: Beautiful, responsive interface with real-time financial insights
  • ๐Ÿ”’ Secure Authentication: Safe user accounts with encrypted financial data

๐Ÿ›  Technology Stack

Frontend

  • Next.js 15.5.4 - React framework with App Router
  • React 19.1.0 - UI library
  • TypeScript 5.9.2 - Type safety
  • Tailwind CSS 4 - Styling framework
  • Biome - Linting and formatting

Backend

  • Next.js API Routes - Server-side API endpoints
  • Flask - Python web framework for financial services
  • Prisma 6.16.2 - Database ORM
  • PostgreSQL - Primary database
  • MongoDB - Additional data storage
  • bcryptjs - Password hashing

Financial Integration & Python Ecosystem

  • Plaid API - Bank account and transaction data
  • Python 3.8+ - Core financial processing language
  • Flask - Python web services and API endpoints
  • Plaid Python SDK - Official Plaid integration
  • Custom AI Agent - Financial advice generation and scoring
  • Financial Data Processing - Transaction analysis and categorization

Authentication

  • Custom Session Management - User authentication
  • bcryptjs - Secure password hashing

๐Ÿ“ Project Structure

RoomieLoot/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/                      # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ auth/                 # Authentication endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ register/         # User registration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ signin/           # User login
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ session/          # Session management
โ”‚   โ”‚   โ”œโ”€โ”€ rooms/                # Room/group management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ create/           # Create new groups
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ join/             # Join existing groups
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ wishlist/         # Group wishlist (optional feature)
โ”‚   โ”‚   โ””โ”€โ”€ users/                # User data endpoints
โ”‚   โ”‚       โ””โ”€โ”€ [userId]/
โ”‚   โ”‚           โ””โ”€โ”€ financial-data/ # Financial data retrieval
โ”‚   โ”œโ”€โ”€ components/               # React components
โ”‚   โ”‚   โ”œโ”€โ”€ FinancialAdvisor.tsx  # AI financial advice
โ”‚   โ”‚   โ”œโ”€โ”€ RoomWishlistAndSpectrum.tsx # Group features
โ”‚   โ”‚   โ”œโ”€โ”€ Wishlist.tsx          # Wishlist management
โ”‚   โ”‚   โ””โ”€โ”€ ContributionSpectrum.tsx # Group contribution tracking
โ”‚   โ”œโ”€โ”€ dashboard/                # Personal financial dashboard
โ”‚   โ”œโ”€โ”€ room/[roomId]/            # Group/room pages with leaderboards
โ”‚   โ”œโ”€โ”€ rooms/                    # Group selection
โ”‚   โ””โ”€โ”€ page.tsx                  # Landing page
โ”œโ”€โ”€ api/                          # Python Flask API & financial integration
โ”‚   โ”œโ”€โ”€ plaid_client.py           # Plaid API client
โ”‚   โ”œโ”€โ”€ get_my_data.py            # Data fetching script
โ”‚   โ”œโ”€โ”€ generate_user_financial_data.py # Data generation
โ”‚   โ”œโ”€โ”€ app.py                    # Flask web application
โ”‚   โ”œโ”€โ”€ routes/                   # Flask API routes
โ”‚   โ”œโ”€โ”€ models/                   # Python data models
โ”‚   โ”œโ”€โ”€ services/                 # Business logic services
โ”‚   โ””โ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ agent/                        # AI financial advisor
โ”‚   โ”œโ”€โ”€ main.py                   # Main agent logic
โ”‚   โ”œโ”€โ”€ calculate_score.py        # Financial wellness scoring
โ”‚   โ””โ”€โ”€ tools.py                  # Agent tools
โ”œโ”€โ”€ prisma/                       # Database schema
โ”‚   โ””โ”€โ”€ schema.prisma             # Prisma schema definition
โ””โ”€โ”€ public/                       # Static assets

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.8+
  • PostgreSQL database
  • MongoDB (optional, for additional storage)
  • Plaid Account (for financial data integration)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd RoomieLoot/VTHacks
  2. Install Node.js dependencies

    npm install
  3. Install Python dependencies

    cd api
    pip install -r requirements.txt
    cd ..
  4. Set up Python virtual environment (recommended)

    cd api
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    cd ..
  5. Set up environment variables

    Create a .env.local file in the root directory:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/roomieloot"
    
    # Plaid API (get from https://dashboard.plaid.com/)
    PLAID_CLIENT_ID=your_client_id_here
    PLAID_SECRET=your_secret_here
    PLAID_ENV=sandbox
    
    # Session secret
    SESSION_SECRET=your_session_secret_here
  6. Set up the database

    npx prisma generate
    npx prisma db push
  7. Start the Flask API server

    cd api
    python app.py  # or flask run
  8. Run the Next.js development server

    npm run dev
  9. Open your browser Navigate to http://localhost:3000

๐Ÿ”ง API Documentation

Next.js API Endpoints

Authentication Endpoints

POST /api/auth/register

Register a new user account with automatic financial data generation.

Request Body:

{
  "username": "string",
  "password": "string"
}

Response:

{
  "message": "Account created successfully",
  "userId": "string",
  "financialDataGenerated": true
}

POST /api/auth/signin

Sign in to an existing account.

Request Body:

{
  "username": "string",
  "password": "string"
}

Group Management Endpoints

POST /api/rooms/create

Create a new group for financial competition.

Request Body:

{
  "roomName": "string"
}

POST /api/rooms/join

Join an existing group.

Request Body:

{
  "roomId": "string"
}

Financial Data Endpoints

GET /api/users/[userId]/financial-data

Get user's financial data including accounts, transactions, and holdings.

Response:

{
  "accounts": [...],
  "transactions": [...],
  "holdings": [...],
  "metadata": {...}
}

๐Ÿ Python Flask API Documentation

Flask Financial Services

The Flask API provides core financial data processing and AI services:

POST /api/financial/analyze

Analyze user financial data and generate insights.

Request Body:

{
  "userId": "string",
  "financialData": {...}
}

Response:

{
  "score": 85,
  "recommendations": [...],
  "insights": {...}
}

POST /api/financial/generate

Generate financial data for new users using Plaid sandbox.

Request Body:

{
  "userId": "string"
}

GET /api/financial/score

Get current financial wellness score for a user.

Response:

{
  "score": 85,
  "breakdown": {
    "balance": 20,
    "investments": 15,
    "credit": 10,
    "spending": 8,
    "diversity": 7,
    "base": 30
  }
}

Python Services

PlaidClient Class

  • Purpose: Handles all Plaid API interactions
  • Methods:
    • create_sandbox_item() - Create test financial data
    • get_accounts() - Fetch account information
    • get_transactions() - Retrieve transaction history
    • get_investments() - Get investment holdings
    • get_securities() - Fetch security information

Financial Data Processing

  • Transaction Categorization: Automatic categorization of expenses
  • Balance Analysis: Real-time account balance monitoring
  • Investment Tracking: Portfolio analysis and performance metrics
  • Data Transformation: Convert raw Plaid data to application format

AI Financial Agent

  • Scoring Algorithm: Comprehensive financial wellness calculation
  • Recommendation Engine: Personalized financial advice generation
  • Data Analysis: Pattern recognition in spending and saving habits

๐ŸŽฎ Features Overview

1. Financial Wellness Scoring System

  • Comprehensive Scoring: 0-100 financial wellness score based on multiple factors
  • Balance Analysis: Rewards healthy account balances and emergency funds
  • Investment Tracking: Scores based on investment portfolio diversity and value
  • Credit Utilization: Monitors credit card usage and debt management
  • Spending Patterns: Analyzes cash flow and spending habits
  • Account Diversity: Rewards having multiple account types

2. Competitive Leaderboards

  • Real-time Rankings: Live leaderboard updates based on financial scores
  • Efficiency Metrics: Tracks financial efficiency percentages
  • Group Competitions: Compete with friends in private groups
  • Achievement System: Unlock badges for financial milestones
  • Progress Tracking: Visual progress indicators and trend analysis

3. AI Financial Advisor

  • Personalized Recommendations: AI-generated advice based on your financial data
  • Category-Based Tips: Advice across saving, budgeting, investment, and debt
  • Priority System: High, medium, and low priority recommendations
  • Interactive Chat: Chat interface for financial questions
  • Smart Insights: Automated analysis of spending patterns and opportunities

4. Real Financial Data Integration

  • Plaid API Integration: Connect real bank accounts securely
  • Transaction Categorization: Automatic categorization of expenses
  • Balance Monitoring: Real-time account balance tracking
  • Investment Holdings: Track investment portfolios and performance
  • Data Security: Encrypted storage and secure API connections

5. Gamification Elements

  • Financial Score: Personal financial wellness score (0-100)
  • Achievement Badges: Unlock badges for financial milestones
  • Progress Bars: Visual progress tracking for financial goals
  • Streak Tracking: Maintain financial habits with streak counters
  • Level System: Level up based on financial improvements

6. Group Features (Optional)

  • Group Creation: Create private groups for friends
  • Shared Wishlists: Collaborative wishlist for group purchases
  • Group Statistics: Aggregate financial statistics for groups
  • Social Features: Share achievements and compete with friends

๐Ÿค– AI Financial Agent

The project includes a sophisticated Python-based AI agent that provides personalized financial advice:

Scoring Algorithm Features

  • Balance Analysis: Evaluates account balances and emergency fund adequacy
  • Investment Assessment: Analyzes investment portfolio diversity and performance
  • Debt Management: Monitors credit utilization and debt-to-income ratios
  • Spending Analysis: Tracks cash flow patterns and spending habits
  • Account Diversity: Rewards having multiple account types for financial stability

AI Recommendations

  • Personalized Advice: Generates 3 key recommendations per user
  • Category-Based Tips: Covers saving, budgeting, investment, and debt management
  • Priority Scoring: Ranks recommendations by importance and impact
  • Contextual Insights: Provides advice based on current financial situation

Usage

cd agent
python main.py

๐Ÿงช Development

Available Scripts

  • npm run dev - Start development server with Turbopack
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run Biome linter
  • npm run format - Format code with Biome

Python Development

Running Python Services

# Start Flask API server
cd api
python app.py

# Run financial data generation
python get_my_data.py

# Run AI financial agent
cd ../agent
python main.py

Python Dependencies

The project uses several Python packages for financial processing:

# Core dependencies
plaid-python>=11.0.0      # Plaid API integration
python-dotenv>=1.0.0      # Environment variable management
requests>=2.31.0          # HTTP requests

# Additional packages (if Flask is used)
flask>=2.0.0              # Web framework
flask-cors>=3.0.0         # CORS handling

Virtual Environment Setup

# Create virtual environment
python -m venv venv

# Activate (Linux/Mac)
source venv/bin/activate

# Activate (Windows)
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Database Management

  • npx prisma generate - Generate Prisma client
  • npx prisma db push - Push schema changes to database
  • npx prisma studio - Open Prisma Studio

๐Ÿš€ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Manual Deployment

  1. Build the application: npm run build
  2. Start the production server: npm run start
  3. Ensure database is accessible from production environment

๐Ÿ“Š Database Schema

Users Table

  • id: Unique user identifier
  • username: Unique username
  • password: Hashed password
  • createdAt: Account creation timestamp
  • updatedAt: Last update timestamp

Financial Data Table

  • id: Unique financial data identifier
  • userId: Reference to user
  • plaidItemId: Plaid item identifier
  • plaidAccessToken: Encrypted access token
  • accountsData: JSON bank account data
  • transactionsData: JSON transaction data
  • holdingsData: JSON investment data
  • lastUpdated: Last sync timestamp

๐Ÿ† Scoring System Details

Financial Wellness Score Components (0-100)

  1. Account Balance (0-20 points)

    • Emergency fund adequacy
    • Liquid account balances
    • Savings account health
  2. Investment Portfolio (0-20 points)

    • Investment value relative to income
    • Portfolio diversity
    • Long-term wealth building
  3. Credit Utilization (0-10 points)

    • Credit card usage percentage
    • Debt management
    • Credit health indicators
  4. Spending Habits (0-10 points)

    • Cash flow analysis
    • Expense categorization
    • Budget adherence
  5. Account Diversity (0-10 points)

    • Multiple account types
    • Financial product utilization
    • Banking relationship strength
  6. Base Score (30 points)

    • Starting score for all users
    • Ensures minimum baseline

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit changes: git commit -m 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit a pull request

๐Ÿ“ License

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

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the GitHub repository
  • Contact the development team
  • Check the documentation in the /api/README.md for Plaid integration details

๐Ÿ”ฎ Future Enhancements

  • Real-time financial notifications
  • Mobile app development
  • Advanced analytics dashboard
  • Integration with more financial institutions
  • Enhanced AI recommendations with machine learning
  • Social challenges and competitions
  • Automated budget goal tracking
  • Investment portfolio optimization
  • Credit score monitoring
  • Bill payment reminders and automation

Built with โค๏ธ for VTHacks - Making Finance Fun!

About

:)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors