Home

Cleareye.ai CRM Documentation

v4.2

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

FrontendHTML5, CSS3, Vanilla JavaScript
BackendPHP 7.4+ with PDO
DatabaseSQLite3
ServerXAMPP / Apache
AuthPHP Sessions (30 min expiry)
DesignGolden Ratio Typography & Spacing

File Structure

api.php Backend
cleareye.db Database
index.html Dashboard
opps.html Pipeline
banks.html Banks
contacts.html Contacts
kanban.html Kanban
demos_dashboard NEW
demos_slots NEW
demos_book NEW
partners.html Partners
settings.html Settings
events.html Events
audit.html Audit
users.html Users
login.html Login
docs.html Docs

Pages

Dashboard

Main overview with pipeline stats, charts, and quick actions. Shows total pipeline, weighted value, win rate.

index.html

Opportunities

Full pipeline management with filters, search, notes, actions. Includes At Risk and Stale detection.

opps.html

Banks

Bank database with 396 banks across 20+ countries. Tracks assets, contacts, deals, and intel.

banks.html

Contacts

Contact management linked to banks and opportunities. Track roles and relationships.

contacts.html

Kanban

Visual pipeline board with drag-and-drop. Dynamic stages from Settings → Stages.

kanban.html

Presales Dashboard

Calendar view of demos, stats cards, activity timeline. iCal & Google Calendar export.

demos_dashboard.html NEW

Demo Slots

Create and manage available demo time slots. Assign presales resources.

demos_slots.html NEW

Book Demo

Step wizard to book demos. Select bank, date/time, activity type. Reschedule support.

demos_book.html NEW

Settings

System configuration: stages, regions, countries, products, currencies.

settings.html

Events

Marketing events calendar. Up Next countdown, visual calendar with logos.

events.html

Audit Trail

Activity history of all changes. Field-level tracking with before/after values.

audit.html

Demo Module Overview NEW

The Demo Module provides complete presales activity management with slot scheduling, booking workflow, and calendar integration.

Module Architecture

demos_dashboard.html → Calendar view, stats, activity list ↓ demos_slots.html → Create/manage available slots ↓ demos_book.html → Book or reschedule demos ↓ api.php → Demo API endpoints ↓ cleareye.db → demo_slots, demo_bookings tables

Key Features

Slot ManagementCreate time slots with duration, timezone, presales assignment
Booking Wizard3-step flow: Organization → Date/Time → Details
Activity TypesDemo, Call, Meeting, Workshop, Presentation
RescheduleOrange-themed reschedule mode with original slot display
Calendar ExportiCal (.ics) and Google Calendar integration
Timezone SupportAutomatic 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/DTENDDate and time of the booking
LOCATIONMeeting link (if provided) or country
DESCRIPTIONNotes + Meeting Link + "Booked by [Name] from the Booking System"

iCal Format Example

BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Cleareye.ai//CRM//EN BEGIN:VEVENT DTSTART:20260116T100000 DTEND:20260116T110000 SUMMARY:Demo - Al Masraf Bank DESCRIPTION:Product demo for trade finance\n\nMeeting Link: https://teams.microsoft.com/...\n\nBooked by Anar Qasem from the Booking System LOCATION:https://teams.microsoft.com/... END:VEVENT END:VCALENDAR

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_idRequired - ID of the slot to book
bank_idRequired - ID of the bank/organization
activity_typeDemo, Call, Meeting, Workshop, Presentation
notesOptional - HTML notes
meeting_linkOptional - Teams/Zoom/Meet link
booked_byUser who created the booking

Demo Database Tables

demo_slots

ColumnTypeDescription
idINTEGERPrimary key
dateTEXTDate (YYYY-MM-DD)
start_timeTEXTStart time (HH:MM)
end_timeTEXTEnd time (HH:MM)
durationINTEGERDuration in minutes
statusTEXT'available' or 'booked'
timezoneTEXTDefault: 'Asia/Dubai'
presales_idsTEXTComma-separated presales IDs
created_byTEXTCreator name
created_atTEXTTimestamp

demo_bookings

ColumnTypeDescription
idINTEGERPrimary key
slot_idINTEGERFK to demo_slots
bank_idINTEGERFK to banks
opp_idINTEGEROptional FK to opps
activity_typeTEXTDemo, Call, Meeting, etc.
notesTEXTHTML notes
meeting_linkTEXTVideo call link
booked_byTEXTWho booked it
booked_atTEXTBooking timestamp
reschedule_countINTEGERTimes rescheduled

presales_resources

ColumnTypeDescription
idINTEGERPrimary key
nameTEXTResource name
emailTEXTEmail address
photoTEXTPhoto URL
timezoneTEXTDefault: 'Asia/Dubai'
activeINTEGER1 = active, 0 = inactive

Golden Ratio Design System

CRM v4 uses Fibonacci-based typography and spacing for visual harmony. φ = 1.618

Typography Scale (px)

--fs-xs8pxLabels, hints
--fs-sm10pxMeta text
--fs-base13pxBody text
--fs-md21pxSubheadings
--fs-lg34pxHeadings

Spacing Scale (px)

--sp-13pxTight gaps
--sp-25pxSmall gaps
--sp-38pxDefault gaps
--sp-413pxMedium gaps
--sp-521pxLarge gaps
--sp-634pxSection gaps
--sp-755pxPage sections

Component Sizes

Logo89×55pxAll pages
Flags21pxCountry flags
Icons21pxStandard icons
Header55px heightPage header
Buttons34px heightAction buttons
Inputs34px heightForm 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 CardsTotal Pipeline, Weighted Value, Win Rate, Active Deals
Pipeline ChartVisual funnel by stage with values
Recent ActivityLatest opportunity updates
Quick ActionsAdd Opp, View Kanban, Export
NavigationLinks to all modules with SVG icons

KPI Calculations

Total PipelineSum of (IMPL + ARR) for all active opps
Weighted ValueSum of (IMPL + ARR) × Probability %
Win RateClosed Won ÷ (Won + Lost) × 100
Active DealsCount excluding Closed Won/Lost

Opportunities Module

File: opps.html — Full pipeline management with deal tracking.

Features

Pipeline TableSortable, filterable list of all opportunities
Stage FiltersFilter by pipeline stage
At Risk DetectionHighlights deals not contacted in 30+ days
Notes SystemRich text notes per opportunity
Actions TrackingLog calls, meetings, emails with dates
Contacts LinkAssociate contacts with opportunities
File AttachmentsUpload documents per opportunity
MilestonesTrack key dates and deliverables

Key Fields (opps table)

bankAssociated bank name
stagePipeline stage (from settings_stages)
implImplementation value
arrAnnual Recurring Revenue
probabilityWin probability %
close_dateExpected close date
ownerSales rep assigned

API Endpoints

list&table=oppsGET List opportunities
save&table=oppsPOST Create/update
opp_notesGET Get notes
opp_actionsGET Get actions

Banks Module

File: banks.html — Bank database with 396 banks across 20+ countries.

Features

Bank ListFilterable table with logos, flags
Region FilterGCC, Levant, North Africa, CIS
Bank IntelIntelligence notes per bank
TBML NotesTrade-Based Money Laundering intel
Export HTMLExport bank profile to HTML

API Endpoints

list&table=banksGET List banks
bank_intelGET Intel notes
bank_tbmlGET TBML notes

Contacts Module

File: contacts.html — Contact management linked to banks with AI-powered business card scanning.

Features

Contact ListSearchable table with photos and organization logos
Organization LinkAssociate with banks or standalone organizations
Role TrackingTitle, decision maker flag, opportunity roles
Contact InfoEmail, phone, mobile, LinkedIn
WhatsApp BroadcastSend broadcast messages to selected contacts
Link to OpportunityAssociate 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 UploadSupport for front and back side of business cards
Crop ToolInteractive crop box to select card area and remove background noise
Claude Vision OCRAI-powered text extraction using Claude Haiku (~$0.01/scan)
Smart ParsingExtracts: Name, Title, Company, Email, Mobile, Phone, LinkedIn
Organization MatchingAuto-detects if company exists in banks/organizations
Review & EditPreview extracted data before saving
Card StorageStores front/back card images with contact record

Scanner Flow:

1. Upload Image(s) → Front side required, back optional 2. Crop Card → Draw box around card to remove background 3. AI Analysis → Claude Haiku extracts contact info 4. Review & Edit → Verify/correct extracted fields 5. Save Contact → Creates contact with card images attached

contacts Table Schema

ColumnTypeDescription
idINTEGERPrimary key
nameTEXTFull name
titleTEXTJob title
emailTEXTEmail address
phoneTEXTOffice phone
mobileTEXTMobile number
linkedinTEXTLinkedIn URL
photoTEXTPhoto (base64 or URL)
bank_idINTEGERFK to banks (legacy)
org_idINTEGERFK to banks or organizations
org_typeTEXT'bank' or 'organization'
org_nameTEXTOrganization name (for standalone)
standaloneTEXT'Yes' if not linked to bank/org
business_cardTEXTFront card image (base64)
card_backTEXTBack card image (base64)
decision_makerINTEGER1 = decision maker

Kanban Module

File: kanban.html — Visual pipeline with drag-and-drop.

Features

Dynamic StagesColumns from settings_stages
Drag & DropMove cards between stages
Stage ColorsColors from settings_stages.color
Stale IndicatorVisual flag for stale deals

Partners Module

File: partners.html — Partner ecosystem management.

Features

Partner ListTable with logos and regions
Region CoverageRegions the partner covers
Deal AssociationLink to opportunities

Competitors Module

File: competitors.html — Competitive intelligence.

Features

Competitor ListTable with logos
Win/Loss TrackingDeals won/lost to competitor
Strengths/WeaknessesCompetitive positioning

Events Module

File: events.html — Marketing events calendar.

Features

KPI CardsTotal, Upcoming, Completed
Up NextCountdown to next event
Visual CalendarMonth view with markers
Day BadgesD1, D2 for multi-day

Audit Trail Module

File: audit.html — Activity history tracking.

Features

Timeline ViewVisual activity timeline
Field-Level TrackingBefore/after values
User AttributionWho made changes
Action TypesCreate, Update, Delete, Login

Settings Module

File: settings.html — System configuration with tabbed interface.

Settings Tabs

StagesPipeline stages with colors/probabilities (sortable)
RegionsGeographic regions with colors
CountriesCountries with flag emojis
ProductsProduct catalog with logos
CurrenciesCurrency list
PartnersPartner companies with logos
BackofficeBackoffice partners
InfluencersIndustry influencers
CompetitorsCompetitor companies
SourcesLead sources with colors
TagsOpportunity tags
DeploymentDeployment options with SM percentages
Contact RolesContact role types
OwnersOpportunity owners
Opp Contact RolesRoles for contacts linked to opportunities
User RolesSystem user role types
👤 PresalesPresales resources with photos & timezones
👥 UsersLink to User Management page
🤖 AI SettingsClaude API key configuration NEW

AI Settings NEW v4.2

Configure Claude API key for AI-powered features like business card OCR scanning.

Claude API KeyAnthropic API key (sk-ant-...)
Save API KeyStores key securely in database
Test ConnectionVerifies API key works with Claude

Setup Instructions:

1. Go to https://console.anthropic.com 2. Create an API key 3. Add $5 credit to your account 4. Paste key in Settings → AI Settings 5. Click "Save API Key" 6. Click "Test Connection" to verify

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 ListAll system users
Add/Edit UserCreate/update users
Reset PasswordAdmin reset
RolesAdmin, Manager, User

Authentication

Files: login.html, change_password.html

API Endpoints

loginPOST Authenticate
logoutGET End session
check_authGET Verify session
change_passwordPOST 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_key
Returns: {"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_key
Returns: {"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

oppsOpportunities
banksBanks/financial institutions
organizationsNon-bank organizations
contactsContacts with business card images
usersSystem users
audit_logAudit trail
app_settingsApplication settings (API keys, etc.) NEW

Notes & Relations Tables

opp_notesOpportunity notes
opp_actionsActions/activities
opp_contactsOpp-contact links with roles
opp_filesFile attachments
opp_productsProducts linked to opportunities
bank_intelBank intelligence notes
bank_tbmlTBML assessment notes

Demo Tables

demo_slotsAvailable time slots
demo_bookingsBooked demos with activity types
presales_resourcesPresales team with timezones

app_settings Table NEW v4.2

Key-value store for application configuration.

ColumnTypeDescription
keyTEXTSetting name (PRIMARY KEY)
valueTEXTSetting value

Current keys: claude_api_key