AI Quote Generator v2
An intelligent web application that automatically converts supplier quotes into customer quotes with configurable margin rules.
Features
- AI-Powered PDF Parsing: Upload supplier quotes (PDF) and automatically extract line items using Google Gemini AI
- Automatic Margin Calculation: Applies vendor-specific margin rules:
- Sencore: 20% hardware, 10% support
- All Other Vendors: 20% hardware, 20% support
- Customer Selection: Integrated with Supabase customer database
- Real-Time Quote Generation: Instantly see customer pricing, margins, and profit calculations
- Premium UI: Modern, responsive design with dark mode support
Tech Stack
- Framework: Next.js 16 (App Router)
- Styling: Tailwind CSS
- AI: Google Gemini 2.0 Flash
- Database: Supabase
- PDF Processing: PDF.js
- Icons: Lucide React
Getting Started
Prerequisites
- Node.js 18+ installed
- Supabase account with customer database
- Google Gemini API key
Installation
cd ai-quote
npm install
Environment Variables
Create a .env.local file:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key
GEMINI_API_KEY=your_gemini_api_key
PORT=3101
Running Locally
npm run dev -- -p 3101
Navigate to http://localhost:3101
Usage
- Select Customer: Choose from the dropdown (populated from Supabase)
- Upload Supplier Quote: Drag and drop a PDF supplier quote
- Review Generated Quote: AI automatically:
- Extracts all line items
- Applies appropriate margins
- Calculates customer pricing
- Shows profit and margin percentages
API Endpoints
/api/parse-supplier-quote
- Method: POST
- Body:
{ text: string } - Returns: Structured quote data with line items
/api/customers
- Method: GET
- Returns: List of customers from Supabase
Margin Rules
The system applies different margins based on vendor and product type:
| Vendor | Hardware | Support |
|---|---|---|
| Sencore | 20% | 10% |
| Others | 20% | 20% |
Future Enhancements
- [ ] PDF export of customer quotes
- [ ] Quote history and versioning
- [ ] Email integration for quote delivery
- [ ] Multi-currency support
- [ ] Custom margin rule configuration UI
- [ ] Excel quote support
License
Proprietary - MDL Communications © 2026