System Overview
Cleareye.ai CRM v4.2 is a modular sales pipeline management system built for trade finance compliance solutions. Each page is a single HTML file with shared api.php backend. Includes multi-user authentication, demo booking system, calendar integration, and AI-powered business card scanning.
Tech Stack
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Backend | PHP 7.4+ with PDO |
| Database | SQLite3 |
| Server | XAMPP / Apache |
| Auth | PHP Sessions (30 min expiry) |
| Design | Golden Ratio Typography & Spacing |
File Structure
Pages
Dashboard
Main overview with pipeline stats, charts, and quick actions. Shows total pipeline, weighted value, win rate.
index.htmlOpportunities
Full pipeline management with filters, search, notes, actions. Includes At Risk and Stale detection.
opps.htmlBanks
Bank database with 396 banks across 20+ countries. Tracks assets, contacts, deals, and intel.
banks.htmlContacts
Contact management linked to banks and opportunities. Track roles and relationships.
contacts.htmlKanban
Visual pipeline board with drag-and-drop. Dynamic stages from Settings → Stages.
kanban.htmlPresales Dashboard
Calendar view of demos, stats cards, activity timeline. iCal & Google Calendar export.
demos_dashboard.html NEWDemo Slots
Create and manage available demo time slots. Assign presales resources.
demos_slots.html NEWBook Demo
Step wizard to book demos. Select bank, date/time, activity type. Reschedule support.
demos_book.html NEWSettings
System configuration: stages, regions, countries, products, currencies.
settings.htmlEvents
Marketing events calendar. Up Next countdown, visual calendar with logos.
events.htmlAudit Trail
Activity history of all changes. Field-level tracking with before/after values.
audit.htmlDemo Module Overview NEW
The Demo Module provides complete presales activity management with slot scheduling, booking workflow, and calendar integration.
Module Architecture
Key Features
| Slot Management | Create time slots with duration, timezone, presales assignment |
| Booking Wizard | 3-step flow: Organization → Date/Time → Details |
| Activity Types | Demo, Call, Meeting, Workshop, Presentation |
| Reschedule | Orange-themed reschedule mode with original slot display |
| Calendar Export | iCal (.ics) and Google Calendar integration |
| Timezone Support | Automatic conversion to user's local timezone |
Activity Types
Five activity types are available when booking demos. Each has a distinct color and icon.
| Type | Badge | Color | Use Case |
|---|---|---|---|
| Demo | Demo | Teal (#00B8A9) | Product demonstrations |
| Call | Call | Teal (#00B8A9) | Discovery/follow-up calls |
| Meeting | Meeting | Orange (#f97316) | In-person or virtual meetings |
| Workshop | Workshop | Purple (#a855f7) | Training/workshop sessions |
| Presentation | Presentation | Green (#22c55e) | Executive presentations |
Calendar Export
After booking a demo, users can export to iCal or Google Calendar. The export includes all booking details.
Exported Fields
| SUMMARY | [Activity Type] - [Organization Name] |
| DTSTART/DTEND | Date and time of the booking |
| LOCATION | Meeting link (if provided) or country |
| DESCRIPTION | Notes + Meeting Link + "Booked by [Name] from the Booking System" |
iCal Format Example
Demo API Endpoints
| Action | Method | Description |
|---|---|---|
list_demo_slots |
GET | List all demo slots with optional date filter |
save_demo_slot |
POST | Create or update a demo slot |
delete_demo_slot |
POST | Delete an unbooked slot |
list_demo_bookings |
GET | List bookings with slot details |
save_demo_booking |
POST | Book a demo (marks slot as booked) |
update_demo_booking |
POST | Update booking details |
cancel_demo_booking |
POST | Cancel booking (frees the slot) |
reschedule_booking |
POST | Move booking to a new slot |
get_demo_stats |
GET | Dashboard statistics |
save_demo_booking Parameters
slot_id | Required - ID of the slot to book |
bank_id | Required - ID of the bank/organization |
activity_type | Demo, Call, Meeting, Workshop, Presentation |
notes | Optional - HTML notes |
meeting_link | Optional - Teams/Zoom/Meet link |
booked_by | User who created the booking |
Demo Database Tables
demo_slots
| Column | Type | Description |
|---|---|---|
id | INTEGER | Primary key |
date | TEXT | Date (YYYY-MM-DD) |
start_time | TEXT | Start time (HH:MM) |
end_time | TEXT | End time (HH:MM) |
duration | INTEGER | Duration in minutes |
status | TEXT | 'available' or 'booked' |
timezone | TEXT | Default: 'Asia/Dubai' |
presales_ids | TEXT | Comma-separated presales IDs |
created_by | TEXT | Creator name |
created_at | TEXT | Timestamp |
demo_bookings
| Column | Type | Description |
|---|---|---|
id | INTEGER | Primary key |
slot_id | INTEGER | FK to demo_slots |
bank_id | INTEGER | FK to banks |
opp_id | INTEGER | Optional FK to opps |
activity_type | TEXT | Demo, Call, Meeting, etc. |
notes | TEXT | HTML notes |
meeting_link | TEXT | Video call link |
booked_by | TEXT | Who booked it |
booked_at | TEXT | Booking timestamp |
reschedule_count | INTEGER | Times rescheduled |
presales_resources
| Column | Type | Description |
|---|---|---|
id | INTEGER | Primary key |
name | TEXT | Resource name |
email | TEXT | Email address |
photo | TEXT | Photo URL |
timezone | TEXT | Default: 'Asia/Dubai' |
active | INTEGER | 1 = active, 0 = inactive |
Golden Ratio Design System
CRM v4 uses Fibonacci-based typography and spacing for visual harmony. φ = 1.618
Typography Scale (px)
--fs-xs | 8px | Labels, hints |
--fs-sm | 10px | Meta text |
--fs-base | 13px | Body text |
--fs-md | 21px | Subheadings |
--fs-lg | 34px | Headings |
Spacing Scale (px)
--sp-1 | 3px | Tight gaps |
--sp-2 | 5px | Small gaps |
--sp-3 | 8px | Default gaps |
--sp-4 | 13px | Medium gaps |
--sp-5 | 21px | Large gaps |
--sp-6 | 34px | Section gaps |
--sp-7 | 55px | Page sections |
Component Sizes
| Logo | 89×55px | All pages |
| Flags | 21px | Country flags |
| Icons | 21px | Standard icons |
| Header | 55px height | Page header |
| Buttons | 34px height | Action buttons |
| Inputs | 34px height | Form inputs |
Branding & Colors
CE1 Brand Colors
| Background | #f8f9fa |
|
| Headings (Navy) | #1a2844 |
|
| Subtitles | #6b7c93 |
|
| Accent (Turquoise) | #00B8A9 |
|
| Cards | #FFFFFF |
White with TOP turquoise border |
Dashboard Module
File: index.html — Main entry point with KPIs, charts, and navigation.
Features
| KPI Cards | Total Pipeline, Weighted Value, Win Rate, Active Deals |
| Pipeline Chart | Visual funnel by stage with values |
| Recent Activity | Latest opportunity updates |
| Quick Actions | Add Opp, View Kanban, Export |
| Navigation | Links to all modules with SVG icons |
KPI Calculations
Total Pipeline | Sum of (IMPL + ARR) for all active opps |
Weighted Value | Sum of (IMPL + ARR) × Probability % |
Win Rate | Closed Won ÷ (Won + Lost) × 100 |
Active Deals | Count excluding Closed Won/Lost |
Opportunities Module
File: opps.html — Full pipeline management with deal tracking.
Features
| Pipeline Table | Sortable, filterable list of all opportunities |
| Stage Filters | Filter by pipeline stage |
| At Risk Detection | Highlights deals not contacted in 30+ days |
| Notes System | Rich text notes per opportunity |
| Actions Tracking | Log calls, meetings, emails with dates |
| Contacts Link | Associate contacts with opportunities |
| File Attachments | Upload documents per opportunity |
| Milestones | Track key dates and deliverables |
Key Fields (opps table)
bank | Associated bank name |
stage | Pipeline stage (from settings_stages) |
impl | Implementation value |
arr | Annual Recurring Revenue |
probability | Win probability % |
close_date | Expected close date |
owner | Sales rep assigned |
API Endpoints
list&table=opps | GET List opportunities |
save&table=opps | POST Create/update |
opp_notes | GET Get notes |
opp_actions | GET Get actions |
Banks Module
File: banks.html — Bank database with 396 banks across 20+ countries.
Features
| Bank List | Filterable table with logos, flags |
| Region Filter | GCC, Levant, North Africa, CIS |
| Bank Intel | Intelligence notes per bank |
| TBML Notes | Trade-Based Money Laundering intel |
| Export HTML | Export bank profile to HTML |
API Endpoints
list&table=banks | GET List banks |
bank_intel | GET Intel notes |
bank_tbml | GET TBML notes |
Contacts Module
File: contacts.html — Contact management linked to banks with AI-powered business card scanning.
Features
| Contact List | Searchable table with photos and organization logos |
| Organization Link | Associate with banks or standalone organizations |
| Role Tracking | Title, decision maker flag, opportunity roles |
| Contact Info | Email, phone, mobile, LinkedIn |
| WhatsApp Broadcast | Send broadcast messages to selected contacts |
| Link to Opportunity | Associate contacts with opportunities and roles |
Business Card Scanner NEW v4.2
AI-powered business card OCR using Claude Haiku Vision API. Extracts contact information automatically from uploaded card images.
| Image Upload | Support for front and back side of business cards |
| Crop Tool | Interactive crop box to select card area and remove background noise |
| Claude Vision OCR | AI-powered text extraction using Claude Haiku (~$0.01/scan) |
| Smart Parsing | Extracts: Name, Title, Company, Email, Mobile, Phone, LinkedIn |
| Organization Matching | Auto-detects if company exists in banks/organizations |
| Review & Edit | Preview extracted data before saving |
| Card Storage | Stores front/back card images with contact record |
Scanner Flow:
contacts Table Schema
| Column | Type | Description |
|---|---|---|
id | INTEGER | Primary key |
name | TEXT | Full name |
title | TEXT | Job title |
email | TEXT | Email address |
phone | TEXT | Office phone |
mobile | TEXT | Mobile number |
linkedin | TEXT | LinkedIn URL |
photo | TEXT | Photo (base64 or URL) |
bank_id | INTEGER | FK to banks (legacy) |
org_id | INTEGER | FK to banks or organizations |
org_type | TEXT | 'bank' or 'organization' |
org_name | TEXT | Organization name (for standalone) |
standalone | TEXT | 'Yes' if not linked to bank/org |
business_card | TEXT | Front card image (base64) |
card_back | TEXT | Back card image (base64) |
decision_maker | INTEGER | 1 = decision maker |
Kanban Module
File: kanban.html — Visual pipeline with drag-and-drop.
Features
| Dynamic Stages | Columns from settings_stages |
| Drag & Drop | Move cards between stages |
| Stage Colors | Colors from settings_stages.color |
| Stale Indicator | Visual flag for stale deals |
Partners Module
File: partners.html — Partner ecosystem management.
Features
| Partner List | Table with logos and regions |
| Region Coverage | Regions the partner covers |
| Deal Association | Link to opportunities |
Competitors Module
File: competitors.html — Competitive intelligence.
Features
| Competitor List | Table with logos |
| Win/Loss Tracking | Deals won/lost to competitor |
| Strengths/Weaknesses | Competitive positioning |
Events Module
File: events.html — Marketing events calendar.
Features
| KPI Cards | Total, Upcoming, Completed |
| Up Next | Countdown to next event |
| Visual Calendar | Month view with markers |
| Day Badges | D1, D2 for multi-day |
Audit Trail Module
File: audit.html — Activity history tracking.
Features
| Timeline View | Visual activity timeline |
| Field-Level Tracking | Before/after values |
| User Attribution | Who made changes |
| Action Types | Create, Update, Delete, Login |
Settings Module
File: settings.html — System configuration with tabbed interface.
Settings Tabs
| Stages | Pipeline stages with colors/probabilities (sortable) |
| Regions | Geographic regions with colors |
| Countries | Countries with flag emojis |
| Products | Product catalog with logos |
| Currencies | Currency list |
| Partners | Partner companies with logos |
| Backoffice | Backoffice partners |
| Influencers | Industry influencers |
| Competitors | Competitor companies |
| Sources | Lead sources with colors |
| Tags | Opportunity tags |
| Deployment | Deployment options with SM percentages |
| Contact Roles | Contact role types |
| Owners | Opportunity owners |
| Opp Contact Roles | Roles for contacts linked to opportunities |
| User Roles | System user role types |
| 👤 Presales | Presales resources with photos & timezones |
| 👥 Users | Link to User Management page |
| 🤖 AI Settings | Claude API key configuration NEW |
AI Settings NEW v4.2
Configure Claude API key for AI-powered features like business card OCR scanning.
| Claude API Key | Anthropic API key (sk-ant-...) |
| Save API Key | Stores key securely in database |
| Test Connection | Verifies API key works with Claude |
Setup Instructions:
Cost Estimate:
| Claude Haiku Vision | ~$0.01 per business card scan |
| $5 credit | ~500 business card scans |
Users Module
File: users.html — User management (Admin only).
Features
| User List | All system users |
| Add/Edit User | Create/update users |
| Reset Password | Admin reset |
| Roles | Admin, Manager, User |
Authentication
Files: login.html, change_password.html
API Endpoints
login | POST Authenticate |
logout | GET End session |
check_auth | GET Verify session |
change_password | POST Update password |
AI API Endpoints NEW v4.2
API endpoints for AI-powered features using Claude Vision.
Settings API
get_app_setting |
GET Get a setting value |
?action=get_app_setting&key=claude_api_keyReturns: {"success": true, "value": "sk-ant-..."}
|
|
save_app_setting |
POST Save a setting value |
POST params: key, value
|
|
Claude API
test_claude_api |
POST Test API key connection |
POST params: api_keyReturns: {"success": true} or error
|
|
ocr_business_card |
POST Extract contact info from card image |
POST params: image (base64 data URL)Uses Claude API key from app_settings Returns: {
"success": true,
"data": {
"name": "Ed Virtue",
"title": "Director, Global Sales",
"company": "Global Trade Review",
"email": "evirtue@gtreview.com",
"mobile": "+971 50 xxx xxxx",
"phone": "+44 (0)7730 765 990",
"linkedin": ""
}
}
|
|
Database Tables
SQLite: cleareye.db
Main Tables
opps | Opportunities |
banks | Banks/financial institutions |
organizations | Non-bank organizations |
contacts | Contacts with business card images |
users | System users |
audit_log | Audit trail |
app_settings | Application settings (API keys, etc.) NEW |
Notes & Relations Tables
opp_notes | Opportunity notes |
opp_actions | Actions/activities |
opp_contacts | Opp-contact links with roles |
opp_files | File attachments |
opp_products | Products linked to opportunities |
bank_intel | Bank intelligence notes |
bank_tbml | TBML assessment notes |
Demo Tables
demo_slots | Available time slots |
demo_bookings | Booked demos with activity types |
presales_resources | Presales team with timezones |
app_settings Table NEW v4.2
Key-value store for application configuration.
| Column | Type | Description |
|---|---|---|
key | TEXT | Setting name (PRIMARY KEY) |
value | TEXT | Setting value |
Current keys: claude_api_key