Platform Documentation

B2B Platform — Feature Overview

A complete breakdown of every module, feature, and technical decision in this business automation platform.

Laravel 12 PHP 8.2 MySQL Bootstrap 5 Blade Templates Session Auth Role Middleware Eloquent ORM cPanel Hosting GitHub CI
Module 01
E-Commerce & Marketplace
A full B2B wholesale marketplace where suppliers list products and buyers place bulk orders — with MOQ enforcement, stock tracking, and invoice generation.
  • Multi-vendor product listings — Each supplier manages their own product catalogue independently
  • MOQ enforcement — Minimum Order Quantity applied automatically at cart level
  • Stock tracking — Live stock display with low-stock alerts (≤50 units flagged)
  • Cart → Checkout → Order — Full purchase flow with session-based cart
  • Per-supplier order splitting — Cart items grouped by supplier, separate orders created
  • Payment methods — Cash on Delivery + Fake payment gateway (demo)
  • Invoice generation — Professional print-ready invoice per order with transaction ID
🛒
E-Commerce Routes
Public marketplace + authenticated buyer flow
GET /products GET /products/{id} GET /cart POST /checkout GET /orders/{id}/invoice
Fully Implemented
Module 02
CRM — Customer Relationship Management
Auto-tracks every buyer as a customer profile from the moment they register. Segments customers by spend, logs every interaction, and manages leads through a sales pipeline.
  • Auto customer profiling — Profile created automatically when buyer registers
  • Purchase history tracking — All orders visible per customer with totals
  • Customer segmentation — Auto-calculated: New (0-10k), Regular (10k-50k), VIP (50k+)
  • Lead management pipeline — Track potential customers: New → Contacted → Qualified → Converted
  • Interaction history — Log calls, messages, RFQs, and notes per customer
👥
CRM Routes
Admin-only access via role middleware
GET /admin/crm/customers GET /admin/crm/customers/{id} POST /admin/crm/customers/{id}/interactions GET /admin/crm/leads POST /admin/crm/leads
Fully Implemented
Module 03
Workflow Automation Engine
A database-driven IF→THEN rule engine. Admin creates rules that fire automatically when platform events occur. Every execution is logged with status and details.
  • Rule builder UI — Create IF trigger → THEN action rules from admin panel
  • Live triggers — order_placed and user_registered fire automatically in real-time
  • Action types — send_email, send_sms, notify_supplier, log_interaction
  • Enable/disable rules — Toggle individual rules without deleting them
  • Execution log trail — Every rule execution recorded with status (success/failed)
  • AutomationEngine service — Dedicated service class handles rule matching and execution
How a Rule Fires
Example: buyer places order
1. Buyer submits checkout 2. AutomationEngine::fire('order_placed') 3. DB query: active rules WHERE trigger = 'order_placed' 4. Matching rule action executes 5. Log written to workflow_logs
Fully Implemented
Module 04
Marketing Automation
Create and schedule email/SMS campaigns with trigger-based delivery. Pre-built templates for the most common B2B marketing scenarios.
  • Campaign creation — Name, type (email/SMS), trigger, subject, body, schedule
  • Trigger-based campaigns — Link campaigns to order_placed, user_registered, abandoned_cart
  • Template system — Welcome, Order Confirmation, Abandoned Cart templates displayed
  • Campaign scheduling — Set future date/time for campaign delivery
  • Status tracking — Draft → Scheduled → Sent lifecycle
  • Actual email sending — Currently logs to file. Real SMTP: one .env config change away
📧
Campaign Routes
Full CRUD with send tracking
GET /admin/campaigns GET /admin/campaigns/create POST /admin/campaigns POST /admin/campaigns/{id}/send
Implemented Email = Log Driver
Module 05
Social Media Management
Schedule and manage social media posts for Facebook and Instagram from one dashboard. Content calendar view shows all scheduled posts chronologically.
  • Post scheduling — Schedule posts for Facebook or Instagram with date/time
  • Content calendar — Posts grouped by day in chronological calendar view
  • Platform stats — Separate counts for Facebook vs Instagram posts
  • Manual publish — Mark posts as published, generates mock engagement data
  • Engagement tracking — Likes and comments tracked per post (mock data for demo)
  • Real API posting — Requires Facebook/Instagram API keys. Architecture is API-ready
📱
Social Media Routes
Schedule, calendar, and publish flow
GET /admin/social GET /admin/social/calendar GET /admin/social/create POST /admin/social POST /admin/social/{id}/post
Implemented API = Mock
Module 06
Admin Control Panel
A full-featured admin dashboard with dark UI, sidebar navigation, user management, module control, and platform-wide monitoring. Accessible only to admin role.
  • Role-based access — Admin, Supplier, Buyer — each with separate dashboards and middleware
  • User management — View all users, change roles, delete accounts
  • Module control — Enable/disable CRM, Automation, Marketing, Social, Tickets independently
  • Platform stats dashboard — Live counts: users, products, orders, revenue
  • Support ticket management — View, respond, and update status of buyer tickets
  • Orders & Products overview — Platform-wide order list and product catalogue
🛡️
Admin Panel Access
Protected by role:admin middleware
GET /admin/dashboard GET /admin/users GET /admin/modules GET /admin/tickets GET /admin/orders
Fully Implemented
Module 07
Support Ticket System
Buyers submit support tickets from their dashboard. Admin responds from the admin panel. Full status lifecycle management.
  • Ticket submission — Buyers submit tickets with subject and message
  • Status lifecycle — Open → In Progress → Closed
  • Admin response — Admin writes response and updates status in one action
  • Buyer visibility — Buyers see admin response and current status in their ticket list
🎧
Ticket Flow
Buyer → Admin → Resolution
GET /tickets/create (buyer) POST /tickets (buyer) GET /admin/tickets (admin) GET /admin/tickets/{id} (admin) POST /admin/tickets/{id}/respond
Fully Implemented
Database
Database Design

14 tables — fully normalized relational schema

Core Auth
users
roles
sessions
password_reset_tokens
Commerce
products
orders
order_items
CRM
customers
leads
interactions
Automation
automation_rules
workflow_logs
Marketing
campaigns
social_posts
Platform
tickets
module_settings
jobs
cache
Access Control
Role-Based Access System
🛡️
Admin
Full platform control
✓ All modules access
✓ User management
✓ CRM & automation
✓ Module enable/disable
✓ Ticket management
📦
Supplier
Product & order management
✓ Product CRUD
✓ Inventory management
✓ Order accept/reject
✓ Supplier dashboard
✓ Low stock alerts
🛒
Buyer
Marketplace purchasing
✓ Browse & search products
✓ Cart & checkout
✓ Order history
✓ Invoice download
✓ Support tickets