A web application that helps users decide which credit card to use for specific purchases or situations using AI-powered recommendations.
- 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
-
Navigate to the
hackAI2directory:cd hackAI2 -
Create a virtual environment (recommended):
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install Python dependencies:
pip install -r requirements.txt
-
Make sure you have a
.envfile in thehackAI2directory with your OpenAI API key:OPEN_AI_API_KEY=your_openai_api_key_here -
Start the backend server:
python app.py
The backend will run on
http://localhost:8000
-
In the
hackAI2directory, install Node.js dependencies:npm install
-
Start the development server:
npm run dev
The frontend will run on
http://localhost:3000
- Open your browser and navigate to
http://localhost:3000 - Fill in the registration form with your name, email, and add your credit cards
- Click "Start Chatting" to begin
- 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?"
-
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..." }
- Request body:
-
GET /api/health- Health check endpoint
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