Skip to content

KarenL24/bridgette

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bridgette - Intelligent Financial Data Processing Platform

Bridgette Logo

Bridgette - Your Trusted Financial Platform for Modern Banking Solutions

Intelligent schema mapping and data processing for financial institutions


🌟 Overview

Bridgette is a comprehensive financial data processing platform designed to bridge the gap between traditional banking and modern digital solutions. It provides secure, efficient, and user-friendly banking services with AI-powered schema matching capabilities.

🎯 Key Features

  • πŸ€– AI-Powered Schema Matching: Uses OpenAI API for intelligent mapping between different bank data formats
  • πŸ“Š Multi-Format Support: Handles CSV, Excel (.xlsx, .xls) files with up to 50MB per file
  • πŸ”„ Real-Time Processing: Live file upload with immediate feedback and progress tracking
  • πŸ“± Responsive Design: Beautiful, modern UI that works on desktop, tablet, and mobile
  • πŸ›‘οΈ Secure Processing: Local file processing with no data transmission to third parties
  • ⚑ Fallback Mechanisms: Reliable operation even when AI services are unavailable
  • πŸ“ˆ Excel Generation: Creates unified Excel files from processed data
  • 🎨 Modern UI/UX: Smooth animations, drag-and-drop uploads, and intuitive navigation

πŸ—οΈ Architecture

Backend (Python Flask)

  • API Server: RESTful endpoints for file processing and data management
  • Schema Analysis: Intelligent mapping between different bank data formats
  • OpenAI Integration: AI-powered schema matching and data processing
  • File Management: Organized storage with bank-specific directories
  • Excel Generation: Creates unified output files with customer data consolidation

Frontend (Vanilla HTML/CSS/JavaScript)

  • Responsive Design: Mobile-first approach with modern CSS Grid and Flexbox
  • Interactive UI: Drag-and-drop file uploads with real-time feedback
  • API Communication: Seamless backend integration with error handling
  • Progressive Enhancement: Works without JavaScript for basic functionality
  • Cache Management: Intelligent caching with version control for updates

πŸš€ Quick Start

Prerequisites

  • Python 3.11+ with pip
  • Node.js 18+ (for development tools)
  • OpenAI API Key (for AI features)
  • Modern web browser (Chrome, Firefox, Safari, Edge)

1. Clone and Setup

# Clone the repository
git clone https://github.com/your-username/bridgette.git
cd bridgette

# Install Python dependencies
cd backend
pip install -r requirements.txt
cd ..

# Install Node.js dependencies (optional, for development)
npm install

2. Environment Configuration

# Copy environment template
cp env.example .env

# Edit .env file with your OpenAI API key
OPENAI_API_KEY=your_openai_api_key_here
FLASK_DEBUG=True
FLASK_HOST=0.0.0.0

3. Start the Application

Option A: Automated Start (Recommended)

# Windows
start_servers.bat

# Linux/Mac
./start_servers.sh

Option B: Manual Start

# Terminal 1: Backend Server
cd backend
python app.py

# Terminal 2: Frontend Server
cd frontend
python -m http.server 8080

4. Access the Application


πŸ“‹ Usage Guide

1. Upload Schema Files

  • Bank Schema Files: Upload schema files that define the mapping between different bank formats
  • Drag & Drop: Simply drag files onto the upload areas
  • Multiple Files: Upload multiple schema files for comprehensive mapping

2. Upload Data Files

  • Regular Data Files: Upload your actual financial data files
  • Format Support: CSV, Excel (.xlsx, .xls) files
  • File Size: Up to 50MB per file
  • Unlimited Count: Upload as many files as needed

3. Process and Merge

  • AI Processing: The system uses OpenAI API to intelligently match schemas
  • Fallback Mode: If AI is unavailable, uses rule-based matching
  • Real-Time Feedback: Progress indicators and status updates
  • Error Handling: Clear error messages and recovery suggestions

4. Download Results

  • Excel Output: Download unified Excel file with processed data
  • Customer Consolidation: Data is merged and organized by customer
  • Automatic Cleanup: Files are automatically cleaned up after download

πŸ”§ API Endpoints

Core Endpoints

Method Endpoint Description
GET /api/health Health check and server status
POST /api/process-files Upload and process files
POST /api/trigger-main-processing Start AI-powered processing
POST /api/download-files Get download link for processed files
GET /api/download-excel/<filename> Download specific Excel file

File Management

Method Endpoint Description
GET /api/uploaded-files List all uploaded files
GET /api/uploaded-files/<filename> Get specific file info
DELETE /api/uploaded-files/<filename> Delete uploaded file
POST /api/cleanup-json-files Clean up temporary files

Query Parameters

  • ?schema=true - Process as schema files
  • ?box=1 or ?box=2 - Specify upload box (bank1 or bank2)

πŸ› οΈ Development

Project Structure

bridgette/
β”œβ”€β”€ πŸ“ backend/                    # Backend API server
β”‚   β”œβ”€β”€ πŸ“„ app.py                 # Main Flask application
β”‚   β”œβ”€β”€ πŸ“„ main.py                # Core processing logic
β”‚   β”œβ”€β”€ πŸ“„ config.py              # Configuration management
β”‚   β”œβ”€β”€ πŸ“„ requirements.txt       # Python dependencies
β”‚   β”œβ”€β”€ πŸ“„ wsgi.py                # WSGI configuration
β”‚   └── πŸ“ uploaded_files/        # File storage
β”‚       β”œβ”€β”€ πŸ“ bank1/             # Bank 1 files
β”‚       └── πŸ“ bank2/             # Bank 2 files
β”œβ”€β”€ πŸ“ frontend/                  # Frontend application
β”‚   β”œβ”€β”€ πŸ“„ index.html             # Main HTML file
β”‚   β”œβ”€β”€ πŸ“„ script.js              # JavaScript functionality
β”‚   β”œβ”€β”€ πŸ“„ styles.css             # CSS styles
β”‚   β”œβ”€β”€ πŸ“„ server.py              # Development server
β”‚   └── πŸ“ images/                # Assets
β”œβ”€β”€ πŸ“ schema_analysis/           # Schema analysis results
β”œβ”€β”€ πŸ“„ .env                       # Environment variables
β”œβ”€β”€ πŸ“„ docker-compose.yml         # Docker configuration
β”œβ”€β”€ πŸ“„ Dockerfile                 # Docker image
└── πŸ“„ README.md                  # This file

Development Commands

# Start development servers
npm run dev

# Run backend only
cd backend && python app.py

# Run frontend only
cd frontend && python server.py

# Run with cache-busting
cd frontend && python server.py

# Install dependencies
pip install -r backend/requirements.txt
npm install

Code Quality

  • Comprehensive Comments: All code is thoroughly documented
  • Error Handling: Graceful error handling with user feedback
  • Type Safety: Python type hints where applicable
  • Security: Input validation and sanitization
  • Performance: Optimized for large file processing

πŸš€ Deployment

Vercel Deployment (Recommended)

# 1. Connect GitHub repository to Vercel
# 2. Set environment variables in Vercel dashboard:
#    - OPENAI_API_KEY=your_key_here
#    - FLASK_DEBUG=false
# 3. Deploy automatically

Docker Deployment

# Build and run with Docker Compose
docker-compose up --build

# Or build manually
docker build -t bridgette .
docker run -p 5000:5000 bridgette

Traditional Hosting

# 1. Upload files to your hosting provider
# 2. Install Python dependencies
pip install -r backend/requirements.txt

# 3. Configure WSGI using backend/wsgi.py
# 4. Set environment variables
export FLASK_DEBUG=false
export PORT=5000

Environment Variables

Variable Description Default Required
OPENAI_API_KEY OpenAI API key for AI features - Yes
FLASK_DEBUG Enable debug mode false No
FLASK_HOST Host to bind to 0.0.0.0 No
PORT Port to run on 5001 No

πŸ”’ Security & Privacy

Data Protection

  • Local Processing: All data processing happens locally
  • No Data Storage: Files are processed and immediately cleaned up
  • Secure API Keys: Environment variable management
  • Input Validation: Comprehensive file type and size validation
  • Error Handling: Secure error messages without data exposure

Privacy Features

  • No Third-Party Tracking: No analytics or tracking scripts
  • Local File Handling: Files never leave your server
  • Automatic Cleanup: Temporary files are automatically removed
  • Secure Headers: CORS and security headers configured

πŸ› Troubleshooting

Common Issues

Backend Won't Start

# Check Python version
python --version  # Should be 3.11+

# Install dependencies
pip install -r backend/requirements.txt

# Check environment variables
echo $OPENAI_API_KEY

Frontend Not Loading

# Clear browser cache
Ctrl + Shift + R (Windows/Linux)
Cmd + Shift + R (Mac)

# Use cache-busting server
cd frontend && python server.py

File Upload Issues

  • File Size: Ensure files are under 50MB
  • File Format: Only CSV, Excel (.xlsx, .xls) supported
  • Browser Compatibility: Use modern browsers (Chrome, Firefox, Safari, Edge)

AI Processing Errors

  • API Key: Verify OpenAI API key is set correctly
  • Network: Check internet connection for API calls
  • Fallback: System will use rule-based matching if AI fails

Debug Mode

# Enable debug mode
export FLASK_DEBUG=True

# Check logs
tail -f backend/logs/app.log

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes: Follow the existing code style
  4. Add tests: Ensure your changes work correctly
  5. Commit changes: git commit -m 'Add amazing feature'
  6. Push to branch: git push origin feature/amazing-feature
  7. Open a Pull Request: Describe your changes clearly

Development Guidelines

  • Code Comments: Add comprehensive comments for new code
  • Error Handling: Include proper error handling and user feedback
  • Testing: Test your changes thoroughly
  • Documentation: Update documentation for new features

πŸ“„ License

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


πŸ“ž Support & Contact

Getting Help

Business Inquiries


πŸ™ Acknowledgments

  • OpenAI: For providing intelligent schema matching capabilities
  • Flask Community: For the excellent web framework
  • Pandas Team: For powerful data processing capabilities
  • Font Awesome: For beautiful icons
  • Contributors: All developers who have contributed to this project

Bridgette - Bridging the gap between traditional banking and modern digital solutions

Made with ❀️ for the financial community

About

hack the valley product

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 60.8%
  • JavaScript 21.0%
  • HTML 7.8%
  • CSS 7.6%
  • Batchfile 2.2%
  • Dockerfile 0.3%
  • Other 0.3%