Skip to content

Repository files navigation

Credit Card Advisor

A web application that helps users decide which credit card to use for specific purchases or situations using AI-powered recommendations.

Features

  • User registration form (name, email, credit cards)
  • Interactive chat interface
  • AI-powered credit card recommendations based on user's cards and purchase context
  • Real-time web search for up-to-date credit card information

Setup Instructions

Backend Setup

  1. Navigate to the hackAI2 directory:

    cd hackAI2
  2. Create a virtual environment (recommended):

    python -m venv venv
  3. Activate the virtual environment:

    • Windows:
      venv\Scripts\activate
    • macOS/Linux:
      source venv/bin/activate
  4. Install Python dependencies:

    pip install -r requirements.txt
  5. Make sure you have a .env file in the hackAI2 directory with your OpenAI API key:

    OPEN_AI_API_KEY=your_openai_api_key_here
    
  6. Start the backend server:

    python app.py

    The backend will run on http://localhost:8000

Frontend Setup

  1. In the hackAI2 directory, install Node.js dependencies:

    npm install
  2. Start the development server:

    npm run dev

    The frontend will run on http://localhost:3000

Usage

  1. Open your browser and navigate to http://localhost:3000
  2. Fill in the registration form with your name, email, and add your credit cards
  3. Click "Start Chatting" to begin
  4. Ask questions like:
    • "I'm buying groceries at Whole Foods, which card should I use?"
    • "I'm booking a flight, which card gives me the best rewards?"
    • "I'm dining at a restaurant, which card should I use?"

API Endpoints

  • POST /api/chat - Send a chat message and get AI recommendations

    • Request body:
      {
        "question": "Which card should I use?",
        "credit_cards": ["Chase Sapphire Preferred", "Citi Rewards+"],
        "credit_card_info": []
      }
    • Response:
      {
        "success": true,
        "response": "Based on your cards..."
      }
  • GET /api/health - Health check endpoint

Project Structure

hackAI2/
├── agents.py          # AI agent configuration and workflow
├── app.py            # FastAPI backend server
├── requirements.txt  # Python dependencies
├── package.json      # Node.js dependencies
├── src/
│   ├── App.tsx       # Main React component
│   ├── components/
│   │   ├── UserForm.tsx        # User registration form
│   │   └── ChatInterface.tsx   # Chat interface component
│   └── main.tsx      # React entry point
└── README.md         # This file

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages