Skip to content

HackStyx/Loan-Genie

Repository files navigation

Loan Genie

React TypeScript Python FastAPI Tailwind CSS scikit-learn Sarvam AI Supabase Groq License Code Quality Dependencies Contributions Stars

A modern, AI-powered loan prediction and management system with multi-language support and an intelligent digital assistant.

πŸ—οΈ System Architecture

Loan Genie System Architecture

High-level architecture of the Loan Genie system

✨ Features

πŸ€– Intelligent Loan Assessment

  • Smart Prediction Engine: Leverages advanced machine learning to analyze your loan eligibility in real-time
  • Confidence Scoring: Get detailed insights into your application's approval probability
  • Personalized Recommendations: Receive tailored suggestions to improve your loan application
  • Instant Results: No waiting - get your loan eligibility assessment in seconds

πŸ‘¨β€πŸ’Ό AI-Powered Digital Assistant (Amol)

  • Multilingual Support: Natural conversation in 11 Indian languages
  • Real-time Voice & Text Interaction: Seamless communication through voice or text
  • Context-Aware Responses: Intelligent understanding of loan-related queries
  • Dynamic Facial Expressions: Emotional intelligence in responses
  • Lip-Synchronized Speech: Natural speaking avatar
  • Persistent Chat History: Save and review past conversations
  • Real-time Translation: Instant translation between languages
  • Speech Recognition: Accurate voice input processing

🌐 Seamless Multi-Language Experience

  • 11 Indian Languages: Access the platform in your preferred language
  • Real-Time Translation: Powered by Sarvam AI's cutting-edge translation technology
  • Natural Language Processing: Understand complex financial terms in your native language
  • Instant Language Switching: Switch languages without losing your progress

πŸ”’ Enterprise-Grade Security

  • Bank-Level Authentication: Secure login powered by Supabase
  • Protected Data: Your sensitive information is encrypted and secure
  • Secure Document Handling: Safe upload and storage of your documents
  • Role-Based Access: Different access levels for users and administrators

πŸ’« Modern User Experience

  • Stunning Animations: Smooth transitions and interactions powered by Framer Motion
  • Responsive Design: Perfect experience on any device, from mobile to desktop
  • Dark Mode: Eye-friendly interface with dark mode support
  • Interactive Components: Engaging UI elements that make the process enjoyable

πŸ“Š Comprehensive Financial Dashboard

  • Real-Time Tracking: Monitor your loan application status in real-time
  • Smart Analytics: Visual insights into your financial profile
  • Document Management: Easy upload and organization of required documents
  • Financial Education: Access to curated financial literacy resources

🌐 Sarvam AI Integration

Text Translation API

  • Endpoint: POST /translate
  • Purpose: Translates text between different languages
  • Supported Languages: 11 Indian languages including Hindi, Tamil, Telugu, Malayalam, Kannada, Bengali, Marathi, Gujarati, Punjabi, Odia, and Assamese
  • Rate Limits: 1000 requests per minute
  • Response Time: < 500ms
  • Error Handling: Retries on 5xx errors with exponential backoff

Text Transliteration API

  • Endpoint: POST /transliterate
  • Purpose: Converts text between different scripts
  • Supported Scripts: Devanagari, Tamil, Telugu, Malayalam, Kannada, Bengali
  • Rate Limits: 2000 requests per minute
  • Response Time: < 300ms
  • Error Handling: Automatic script detection

Speech to Text API

  • Endpoint: POST /speech-to-text
  • Purpose: Converts spoken audio to text
  • Supported Audio Formats: WAV, MP3, M4A
  • Maximum Audio Length: 5 minutes
  • Supported Languages: All 11 Indian languages
  • Rate Limits: 100 requests per minute
  • Response Time: < 2 seconds for 1-minute audio

Speech to Text Translation API

  • Endpoint: POST /speech-to-text-translate
  • Purpose: Converts speech to text and translates it
  • Supported Audio Formats: WAV, MP3, M4A
  • Maximum Audio Length: 5 minutes
  • Supported Language Pairs: All combinations of 11 Indian languages
  • Rate Limits: 50 requests per minute
  • Response Time: < 3 seconds for 1-minute audio

Text to Speech API

  • Endpoint: POST /text-to-speech
  • Purpose: Converts text to natural-sounding speech
  • Supported Languages: All 11 Indian languages
  • Voice Options: Multiple voices per language
  • Audio Format: MP3, WAV
  • Rate Limits: 500 requests per minute
  • Response Time: < 1 second for 100 characters

πŸ› οΈ Tech Stack

Frontend

  • Framework: React 18 with TypeScript
  • Build Tool: Vite
  • Styling: Tailwind CSS
  • State Management: React Context
  • Routing: React Router v6
  • Animations: Framer Motion
  • UI Components: Custom components with Tailwind
  • Authentication: Supabase Auth
  • File Upload: React Dropzone
  • Notifications: React Hot Toast
  • 3D Rendering:
    • Three.js
    • React Three Fiber
    • React Three Drei
    • Ready Player Me Avatar Creator
  • Development Tools:
    • ESLint
    • Prettier
    • TypeScript

Backend

  • Framework: FastAPI
  • ML Framework: scikit-learn
  • Database: Supabase
  • File Storage: Supabase Storage
  • AI Services:
    • Groq LLM (Mixtral-8x7b-32768)
    • Sarvam AI Services
  • Data Validation: Zod
  • Development Tools:
    • Nodemon
    • dotenv

Machine Learning

  • Model: Random Forest Classifier
  • Preprocessing: StandardScaler
  • Features:
    • Age
    • Experience
    • Income
    • Family size
    • Credit card spending
    • Education level
    • Mortgage value
    • Account types
    • Online banking usage

AI & ML Services

  • Language Model: Groq Mixtral-8x7b-32768
  • Speech Services:
    • Text-to-Speech: Sarvam AI
    • Speech Recognition: Sarvam AI
  • Language Processing:
    • Translation: Sarvam AI
    • Language Detection: Sarvam AI
    • Text Analytics: Sarvam AI

Animation & Graphics

  • Avatar System: Ready Player Me
  • 3D Rendering: Three.js
  • Lip Sync: Rhubarb Lip Sync
  • Post-processing: React Three Postprocessing

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • Python (v3.8 or higher)
  • npm or yarn
  • Supabase account
  • Sarvam AI API key

Installation

  1. Clone the repository

    git clone https://github.com/HackStyx/loan-genie.git
    cd loan-genie
  2. Install Frontend Dependencies

    npm install
    # or
    yarn install
  3. Install Python Dependencies

    cd "Loan Prediction model"
    pip install -r requirements.txt
  4. Environment Setup

    # Frontend
    cp .env.example .env
    
    # Backend
    cd "Loan Prediction model"
    cp .env.example .env
  5. Start Development Servers

    # Terminal 1 - Frontend
    npm run dev
    
    # Terminal 2 - Backend
    cd "Loan Prediction model"
    python api.py

πŸ”§ Configuration

Frontend Environment Variables

VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_GROQ_API_KEY=your_groq_api_key
VITE_SARVAM_API_KEY=your_sarvam_api_key

Backend Environment Variables

ALLOWED_ORIGINS=http://localhost:5173,https://your-production-domain.com
MODEL_PATH=loan_prediction_model.joblib
SCALER_PATH=scaler.pkl
HOST=0.0.0.0
PORT=8000
DEBUG=False
SECRET_KEY=your-secret-key-here
API_KEY=your-api-key-here

πŸ“ Project Structure

loan-genie/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                    # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Card.tsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx          # Main dashboard component
β”‚   β”‚   β”œβ”€β”€ LoanApplication.tsx    # Loan application form
β”‚   β”‚   β”œβ”€β”€ LoanEligibility.tsx    # Loan eligibility checker
β”‚   β”‚   β”œβ”€β”€ SignUp.tsx            # User registration
β”‚   β”‚   β”œβ”€β”€ Login.tsx             # User authentication
β”‚   β”‚   └── Profile.tsx           # User profile management
β”‚   β”œβ”€β”€ contexts/                  # React contexts
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx       # Authentication context
β”‚   β”‚   └── ThemeContext.tsx      # Theme management
β”‚   β”œβ”€β”€ lib/                      # Utility functions
β”‚   β”‚   β”œβ”€β”€ supabase.ts          # Supabase client setup
β”‚   β”‚   β”œβ”€β”€ api.ts               # API integration
β”‚   β”‚   └── utils.ts             # Helper functions
β”‚   β”œβ”€β”€ types/                    # TypeScript type definitions
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ styles/                   # Global styles
β”‚   β”‚   └── globals.css
β”‚   β”œβ”€β”€ App.tsx                   # Main application component
β”‚   └── main.tsx                  # Application entry point
β”œβ”€β”€ Loan Prediction model/         # Backend ML model
β”‚   β”œβ”€β”€ api.py                    # FastAPI application
β”‚   β”œβ”€β”€ loan_predictor.py         # ML model implementation
β”‚   β”œβ”€β”€ requirements.txt          # Python dependencies
β”‚   β”œβ”€β”€ loan_prediction_model.joblib  # Trained model
β”‚   └── scaler.pkl               # Feature scaler
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ images/
β”‚   └── favicon.ico
β”œβ”€β”€ .env.example                  # Environment variables template
β”œβ”€β”€ .gitignore                    # Git ignore rules
β”œβ”€β”€ index.html                    # HTML entry point
β”œβ”€β”€ package.json                  # Frontend dependencies
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
β”œβ”€β”€ vite.config.ts               # Vite configuration
β”œβ”€β”€ tailwind.config.js           # Tailwind CSS configuration
└── README.md                     # Project documentation

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

About

The Great Bengaluru Hackathon Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published