Skip to content
Engineering capability showcase

CRMA — AI-Native CRM

A multi-tenant CRM and sales operations platform designed around controlled workflows, deterministic business rules and AI actions that require explicit human review before consequential changes.

Stack: Laravel 12 · React 19 · MySQL · Redis/Horizon · Workflow Engine · Governed Agent Runtime · Arabic RTL

Engineering capability showcase · seeded demonstration data

CRMA · Dashboard
CRMA dashboard with pipeline value, open deals, tasks due today and recent activity, on seeded demonstration data.

Built as an engineering capability showcase for modern CRM, workflow automation and governed AI systems. Every screen shows the running application on seeded demonstration data.

01 · The operating system

Sales operations in one place

Contacts, leads, tasks, deals, the pipeline and reporting share one data model and one permission model, so a change in one module is visible in the others.

CRMA · Dashboard
CRMA dashboard with pipeline metrics, tasks and an activity feed.

Pipeline value, open deals, today's tasks and recent activity for the signed-in team.

02 · How work moves

From first contact to measured result

Every record follows one path. Automation and AI sit inside it; neither can skip the step where a person decides.

  1. 01

    Capture

    Forms, imports, signed webhooks and manual entry create leads and contacts.

  2. 02

    Qualify

    Rule-based lead scoring with a per-rule explanation; owners assigned.

  3. 03

    Automate

    Workflows react to record, email, form, schedule and webhook events.

  4. 04

    Sell

    Deals move through pipeline stages; every stage change is recorded.

  5. 05

    Assist

    Agents read CRM context and draft proposals — they never write directly.

  6. 06

    Approve

    A person reviews the proposed change, its risk and its evidence.

  7. 07

    Measure

    Reports, deal health and the audit log read the resulting state.

Approval is a step in the flow, not an optional setting: governed actions cannot execute without a decision.

03 · Deterministic business logic

Business state is computed from CRM data, not guessed by the model.

Scores, health and pipeline review come from fixed, testable rules over stored records. The language model may explain a number; it never produces one.

Pipeline
Deal pipeline board with stage columns and value totals.
Deal workspace
Deal workspace showing health signals labelled 'Computed from CRM data, not by AI' and the deal's stage history.
  • Pipeline stages

    Configured stages per organization; deals carry a stage and a status.

  • Deal health

    A deterministic signal calculator scores each deal from activity, age and stage — AI may explain it but never produces it.

  • Pipeline review

    Pipeline intelligence summarises stalled and at-risk deals from the same rules, with thresholds held in configuration.

  • Lead scoring

    Priority, status, 30-day engagement, recency, contact completeness and value, each with its own rule and points, capped at 100.

  • Stage history

    Every stage change is written to its own table, so time-in-stage is measured, not estimated.

  • Tasks & follow-up

    Due and overdue work is counted per owner for the daily brief and the hourly proactive scan.

04 · Workflow automation

Automation you can read before it runs

Workflows are drawn as graphs, synced to executable triggers and actions, and validated before they can be activated.

  1. 01

    Trigger

    Record created or updated, email opened, clicked or replied, form submitted, cron schedule, signed inbound webhook.

  2. 02

    Condition

    A typed expression language evaluates conditions — no eval() — with an audit command for existing workflows.

  3. 03

    Action

    Controlled actions on CRM records, waits and delays, resumed by a scheduler every minute.

Workflow builder
Visual workflow builder with a trigger node connected to condition and action nodes.
  • Graph-defined

    The visual graph is the source; trigger and action rows are synced from it.

  • Validated activation

    A workflow with errors cannot be switched on; the errors are returned to the builder.

  • Waits

    Wait and delay steps park a run; a scheduled job resumes due runs every minute.

  • Event-driven

    Record, email, form, schedule and webhook events start runs on queued workers.

05 · Governed AI

AI proposes.Humans decide.

Agents work inside CRM context with a tool allowlist per profile. Anything that changes data becomes a proposal: the stored current state, the proposed state, a reason, evidence and a risk class — waiting for a person.

  1. CRM context

    Records the user can already see, scoped to their organization.

  2. Agent runtime

    One of 14 agent profiles, each with its own tool allowlist.

  3. Tool

    Read tools answer directly; write tools can only propose.

  4. Proposal

    Stored with reason and evidence; expires after 72 hours by default.

  5. Field-level diff

    Current and proposed values, side by side.

  6. Risk

    One of five risk classes decides how it may be approved.

  7. Human approval

    Approve, reject — or edit an email or WhatsApp draft, which is validated again.

  8. Controlled execution

    Executed by the action handler, written to the audit log.

  9. Resume

    The same agent run continues with the outcome.

Copilot · proposal
Copilot chat where the agent proposes moving a deal from Qualification to Proposal, with a field-by-field before and after and Approve and Reject buttons.
deal.stage_changeMedium writePending review
Stored state of the proposed stage change
FieldCurrentProposed
stageQualificationProposal
stage_id12

Recreated from the proposal shown above. The proposal stores the before and after state; the reviewer sees both before anything changes.

Risk classes

  1. READReads only. Nothing to approve.
  2. LOW_WRITESmall internal writes. May be approved in bulk.
  3. MEDIUM_WRITERecord changes. May be approved in bulk.
  4. HIGH_EXTERNALLeaves the system — email, WhatsApp. Never in bulk.
  5. CRITICALReviewed one at a time. Never in bulk.
  • Eight governed action types

    Create task, add note, update record, change deal stage, assign lead, draft workflow, send email, send WhatsApp.

  • Same-run resume

    A run pauses while waiting for a decision and resumes the same run afterwards — covered by runtime tests.

  • Edited drafts are revalidated

    A reviewer can edit an outbound email or WhatsApp draft; the edit is a new revision and is checked again.

  • Everything is audited

    Proposed, revised, rejected and executed events are written to the audit log.

The copilot turns on these screens were recorded with the deterministic test driver, so the tool sequence is repeatable.

06 · Knowledge

Answers grounded in the organization's own documents

Hybrid retrieval: keyword ranking and vector similarity, fused into one result list, with an evaluation command that fails when quality drops.

  1. 01

    Ingest

    Text, file or URL; URLs fetched through the SSRF-safe fetcher.

  2. 02

    BM25

    Keyword ranking over full-text candidates.

  3. 03

    Vector

    Cosine similarity over stored embeddings.

  4. 04

    Fusion

    Reciprocal rank fusion merges both lists.

  5. 05

    Evaluate

    kb:eval reports recall@k and MRR against thresholds.

Knowledge base
Knowledge base screen with Text, File and URL tabs, an Index Document button and an Ask box.
  • Fusion ranking

    BM25 plus vector similarity, merged with reciprocal rank fusion.

  • Sized for a team's knowledge

    Vector similarity is computed in the application over a bounded set of recent chunks.

  • Measured, not assumed

    Retrieval quality has a command and thresholds, so a regression fails loudly.

07 · System architecture

Three tiers, one tenant boundary

Recreated from the codebase: what talks to the application, what runs inside it, and what it depends on.

Clients & inbound

  • Web app

    Inertia + React 19, English and Arabic.

  • REST API

    /api/v1 — 244 routes.

  • MCP clients

    OAuth 2.1, PKCE S256.

  • Signed webhooks

    Twilio, Stripe, Meta, workflow hooks.

Application · Laravel 12

  • Tenant boundary

    Organization global scope, RBAC per organization, 49 policies.

  • CRM domain

    Contacts, leads, deals, tasks, pipeline, reports.

  • Workflow engine

    Graph sync, typed expressions, waits.

  • Agent runtime

    14 profiles, 39 registered tools.

  • Action engine

    Proposals, risk, approval, execution.

  • Pipeline intelligence

    Deterministic deal and lead signals.

  • Knowledge retrieval

    BM25 + vector + RRF.

Async, data & external

  • MySQL

    168 migrations.

  • Redis · Horizon

    Queues for email, AI agents, webhooks, WhatsApp, imports.

  • Scheduler

    Workflow resume each minute, proposal expiry, hourly scan.

  • Reverb

    WebSocket server in the compose stack.

  • Model providers

    Anthropic, OpenAI, OpenAI-compatible — keys encrypted.

Deployment design

Docker Compose: app · nginx · mysql · redis · horizon · scheduler · reverb. Release script with atomic symlink swap, health check and rollback.

08 · Security, tenancy, governance

Specific controls, each in code and tests

No blanket claims. These are the mechanisms the repository implements.

  • Tenant isolation

    A global organization scope on tenant models, cross-tenant validation rules, and dedicated tenancy tests.

  • Per-organization RBAC

    Roles and permissions keyed to the organization, with API/UI policy parity tests.

  • Two-factor and sessions

    TOTP two-factor, session list and revoke, IP allowlist, rate limiting.

  • SCIM provisioning

    SCIM endpoints with their own authentication for user lifecycle.

  • SSRF-safe fetching

    Public-IP validation, a pinned connection and re-validation on every redirect, with a body size cap.

  • Idempotency and headers

    Idempotency keys on writes and a security-headers middleware.

  • AI tool allowlists

    Each agent profile can only call the tools it lists.

  • Audit trail

    AI proposals, revisions, rejections and executions are written to the audit log.

Roles & permissions
Roles and permissions matrix with permission toggles per role.
09 · Integrations & MCP

What is built, and what is a connector

Two different things, kept apart.

Implemented

In the codebase, with tests or verification logic

  • MCP server

    OAuth 2.1 with PKCE S256, hashed audience-bound tokens, rotating refresh tokens with reuse detection; scopes crm:read and crm:propose. MCP writes become proposals.

  • External MCP client

    HTTPS only and SSRF-validated. An admin approves each read-only tool; approval is revoked if the tool changes.

  • Signed webhooks

    Twilio signature validation, Stripe event construction, Meta lead HMAC verification, inbound workflow hooks.

  • Model router

    Anthropic, OpenAI and OpenAI-compatible endpoints (including a local Ollama), bring-your-own-key credentials encrypted at rest, usage recorded per call.

Connector architecture

Lightweight HTTP connectors, shown disconnected

  • Google Workspace

    OAuth connection; reads profile and Gmail message list.

  • Slack · n8n

    OAuth or token connections through the same connector catalog.

Connectors
Connector settings listing Google Workspace, Slack and n8n, each disconnected with a connect button.
10 · Responsive

One responsive product. No separate mobile application.

The same Inertia app at a 390 px phone viewport: the dashboard, the pipeline, a deal and the AI Action Center.

  • CRMA dashboard on a phone-width screen with stacked metric cards.

    Dashboard

  • Pipeline on a phone-width screen, stages stacked vertically.

    Pipeline

  • Deal workspace on a phone-width screen with health signals and stage history.

    Deal workspace

  • AI Action Center on a phone-width screen with pending proposals and approve and reject buttons.

    AI Action Center

Captured at 390 × 844 at 3× density. The Arabic Action Center has an automated check at 390, 430, 768, 1024 and 1440 px.

11 · Arabic & English

Arabic & English, natively.

Direction is switched at runtime, not faked with translated strings: layout, navigation and the board mirror as a whole.

English · LTR
Deal pipeline in English, stages reading left to right.
العربية · RTL
The same deal pipeline in Arabic, stages reading right to left with mirrored navigation.
  • Language, RTL and direction contexts set the document direction at runtime.
  • Full Arabic message catalogue alongside English.
  • A locale middleware carries the choice across requests.
  • The Arabic Action Center is checked across five viewport widths.
12 · Engineering evidence

Repository evidence

Counts from the CRMA codebase, not business results.

Measured: 14 October 2026 · route count from route:list, other counts from the repository tree

HTTP routes
1,098
/api/v1 routes
244
Eloquent models
150
Migrations
168
Controllers
155
Authorization policies
49
Inertia pages
183
Queued jobs
25
Governed action types
8
Registered AI tools
39
Agent profiles
14
Playwright specs
22

Test files

421 PHP test files · 269 frontend test files · 22 Playwright specs

File counts from the repository tree.

More screens

The running application on seeded, fictional data. Select a screen to view it full size.

Need a system like this?

HexaTerminal designs and builds custom CRM, ERP, SaaS, automation and AI-enabled business systems around real operational workflows.