Taibat Business Core Platform
Comprehensive Enterprise Resource Planning System for SMEs in the GCC Region
System Architecture
Taibat Business Core Platform is a full-featured Enterprise Resource Planning (ERP) system built on a custom PHP MVC framework. It is designed specifically for small to medium-sized enterprises in the GCC region, with native support for Arabic, English, and Japanese interfaces including full right-to-left (RTL) layout support.
The platform follows a modular architecture where each business domain (CRM, Sales, Inventory, Purchase, Accounting, HR, Payroll) is implemented as an independent module. Modules communicate through a shared event system and database-backed job queue, allowing loose coupling and extensibility. The system supports both SaaS multi-tenant and on-premise single-tenant deployment models.
Custom PHP MVC Framework
The framework is built from scratch in PHP 8+ without relying on external libraries or frameworks. It implements the Model-View-Controller pattern with a service layer and repository pattern for data access. The framework includes routing (with named routes and resourceful routing), middleware pipeline (12 built-in middleware classes including authentication, CSRF protection, permission control, rate limiting, and CORS), a PDO-based database abstraction layer with query builder, input validation, caching, event dispatching, and a console command system.
Multi-Tenant Architecture
Every database table includes a company_id column that segregates data by tenant. The HasCompanyScope model trait automatically applies company-scoped queries, and the CompanyMiddleware ensures all requests carry the correct tenant context. This design enables both SaaS deployment (multiple companies on a shared database) and on-premise single-tenant installations from the same codebase.
Multi-Language & RTL Support
The platform supports Japanese, English, and Arabic with a full translation system. Each language has its own message file with thousands of translated keys. Arabic interfaces render with full right-to-left text direction, properly mirrored layouts, and Eastern Arabic numerals. The language system uses dot-notation key lookups (e.g., crm.leads) with support for parameter replacement in translated strings.
Event-Driven Architecture
Business operations across all modules dispatch typed event objects (e.g., LeadConverted, SaleApproved, PayrollClosed). Synchronous listeners handle immediate side-effects, while long-running tasks are enqueued as database-backed Job records and processed by a background worker process (php taibat worker). This architecture ensures system responsiveness while supporting complex cross-module workflows.
Enterprise Security
Security is implemented at multiple layers: CSRF token validation on every state-changing request, automatic XSS output filtering via the e() helper function, PDO prepared statements preventing SQL injection, encrypted session management with HTTP-only cookies, role-based and permission-based access control, rate limiting on sensitive endpoints, account lockout after configurable failed attempts, and password hashing using Argon2ID or bcrypt.
Service Layer & Repository Pattern
All modules follow a consistent layered architecture: Controllers handle HTTP request/response, Services contain business logic, Repositories encapsulate data access queries, and Models represent database entities with relationships (belongsTo, hasMany, hasManyThrough, belongsToMany). This separation of concerns ensures maintainability, testability, and code reuse across web controllers and API endpoints.
Theming System
The platform includes a dual light/dark theme system with customizable company branding colors. Theme preference is persisted per user session. The stylesheets use CSS custom properties for dynamic color theming, enabling companies to brand the interface with their own color palette without modifying core CSS files. All components respect the active theme.
Business Modules
CRM Module
The Customer Relationship Management module provides end-to-end contact management with support for customer, lead, and company records. Features include lead qualification and conversion pipelines, opportunity tracking with configurable sales stages (e.g., prospecting, negotiation, closed won/lost), activity logging (calls, emails, meetings) with notes, contact management with multiple addresses and communication channels, interactive sales forecasting and pipeline analytics, team performance dashboards, and tag-based categorization. The module manages 11 database tables across 9 models with 8 specialized services, 4 repositories, and 7 event types.
Sales Module
The Sales module manages the complete sales cycle from quotation through invoicing. It handles quotation creation and approval workflows, sales order processing with pick-pack-ship fulfillment stages, delivery note generation, sales invoice creation with proper tax and discount calculations, sales return (credit note) processing, price list management for tiered and customer-specific pricing, and real-time sales performance dashboards. The module integrates with CRM for customer data and Inventory for stock availability checks. It manages 16 database tables across 15 models.
Inventory Module
The Inventory module provides comprehensive warehouse and stock management. It supports multi-warehouse inventory tracking with bin locations, stock movement recording (receipts, issues, transfers, adjustments), real-time stock level monitoring with minimum/maximum thresholds, inventory valuation using weighted average or FIFO costing methods, batch and serial number tracking, stock counting and physical inventory reconciliation, inventory transfer between warehouses, and detailed inventory reports (stock aging, turnover analysis, valuation reports). The module manages 16 database tables with 15 models.
Purchase Module
The Purchase (Procurement) module manages the end-to-end purchasing process including purchase requisition creation and approval, purchase order generation and fulfillment tracking, goods receipt processing against purchase orders, supplier management with performance ratings and payment terms, purchase return handling, and procurement analytics. It integrates with Inventory for stock replenishment alerts and Accounting for automatic purchase journal posting. The module manages 19 database tables across 18 models.
Accounting Module
The Accounting module is a double-entry accounting system supporting full financial management. Features include a chart of accounts with hierarchical categorization, journal entry recording with debit/credit validation, accounts receivable and payable management, bank reconciliation, fixed asset accounting with depreciation tracking, budget management with variance reporting, fiscal year management with opening/closing procedures, multi-currency transaction support, tax management (including VAT/GCC VAT framework), and financial report generation (balance sheet, profit and loss, trial balance, cash flow statement, general ledger, aging reports). The module integrates with all other modules to auto-generate accounting entries for sales, purchases, payroll, and inventory transactions. It manages 21 database tables across 20 models.
HR Module
The Human Resources module provides complete workforce management. Features include employee master data management with comprehensive personal, contact, and address information, contract management supporting multiple contract types (permanent, fixed-term, temporary, probationary) with renewal and termination workflows, organizational structure management (divisions, departments, sections, units), position and job title management, skills and certifications tracking, training management with participant tracking and completion records, performance review management with self-assessment and reviewer evaluation workflows, leave management with entitlement tracking and approval workflows, promotion and transfer management with salary history, and comprehensive HR analytics and reporting (headcount, turnover, tenure distribution, training summaries). The module manages 22 database tables with 21 models.
Payroll Module
The Payroll module automates employee salary calculation and payment processing. It manages employee salary setup with basic salary, housing allowance, transport allowance, cost of living allowance, and other allowances, with a generated total_salary column. The module supports payroll period management (monthly, semi-monthly), payroll run processing with gross-to-net calculation, configurable social insurance (SI) bracket-based deduction calculation, progressive income tax bracket calculation, payroll approval workflows with batch processing, payslip generation, bank transfer file export (CSV format), automatic accounting journal posting for salary expenses, and comprehensive payroll reports. The calculation engine uses transactional processing with row-level locking (SELECT ... FOR UPDATE) to ensure data consistency. The module includes 17 database tables with 17 models, 10 services, 7 repositories, 6 event types, and 6 job processors.
Technical Features
Event System & Job Queue
The event system provides synchronous event dispatch with listener registration. For long-running or cross-module operations, a database-backed job queue stores job records that are processed asynchronously by a dedicated worker process. The worker supports job-specific handlers (e.g., payroll worker, notification worker) and implements retry logic with configurable attempts and backoff. Failed jobs are preserved for debugging and manual retry.
RESTful API
All business modules expose RESTful API endpoints alongside their web interfaces. API routes support JSON request/response handling with proper HTTP status codes, authentication via API tokens, rate limiting, and CORS configuration. Both web and API controllers share the same service and repository layers, ensuring consistent business logic across interfaces.
Service Layer & Repository Pattern
Each module implements a clean separation of concerns: Controllers handle HTTP concerns (request parsing, response formatting), Services encapsulate business logic and orchestration, Repositories contain database query logic with filtering, sorting, and pagination, and Models define entity relationships and scopes. Data transfer between layers uses associative arrays for simplicity without requiring dedicated DTO classes.
Light/Dark Theme System
The theme system supports light and dark modes with CSS custom properties for dynamic color management. Company branding colors can be customized through the settings interface, and the active theme is persisted in the user session. All UI components automatically adapt to the selected theme through CSS variable inheritance.
Database Migrations
Database schema is managed through timestamped migration files within each module. The migration system supports create, alter, and drop operations with proper rollback support. All modules use a consistent DROP-before-CREATE pattern for idempotent re-migration during development. Seed data for default records (permissions, demo data) is provided per module.
Console Command System
The php taibat console provides commands for database migration (migrate, rollback, seed), cache management, user administration, module listing, backup execution, and queue worker management. Commands auto-discover module-specific migrations and seeders.
Deployment Information
The platform is designed for deployment on shared hosting or private servers running PHP 8+ and MySQL. Key deployment details:
- Default administrator: admin@taibat.com (password: admin123)
- Console runner: php taibat (supports migrate, rollback, seed, backup, worker, cache:clear, user:create, module:list)
- Job queue worker: php taibat worker {queue_name} (run as a background process for async job processing)
- First-time setup: Run install.php in the browser or php taibat migrate && php taibat seed from the command line
Taibat Business Core Platform
- : admin@taibat.com
- Password: !Admin@123#