$ show crmeb/CRMEB
CRMEB is a full-featured open-source e-commerce platform built on ThinkPHP 6 (PHP backend) with separate admin, API, customer service, and external API endpoints. The backend serves a Vue 2 + Element UI admin SPA and a uni-app mobile client for WeChat Mini Programs, H5, and apps. It provides standard e-commerce operations (product, order, user, finance management) along with extensive marketing modules (group buying, flash sales, bargaining, coupons, points, live streaming, lottery, agent/distribution), a DIY page builder, and deep WeChat ecosystem integration (official accounts, mini programs, payment, templates, live). The architecture follows a layered pattern: controllers delegate to services, which use DAOs for data access, with models as ActiveRecord classes. The system includes an event system, asynchronous queue jobs, and WebSocket support via Workerman for real-time notifications. It also features a code generation tool (CRUD) to rapidly scaffold admin modules. While the codebase is large and functional, it contains significant boilerplate, duplicated patterns, and some messy code (e.g., repeated conditions in DAO methods). Reusable components include payment, upload, and SMS abstraction layers following a driver/manager pattern, as well as a queue utility and JWT authentication trait.
The LLM identified 5 files worth highlighting for reuse:
Implements a base payment abstraction with a manager that supports multiple payment drivers (WeChatPay, Alipay, AllinPay, balance). The driver interface and unified pay/refund/query methods allow easy extraction to any PHP project needing pluggable payment processing.
Upload abstraction layer supporting multiple storage backends (Local, OSS, Qiniu, COS, JDOSS, OBS, Tyoss). Uses a manager with driver registration and unified image handling. Can be extracted independently for projects requiring cloud-agnostic file upload.
CRUD code generation engine that produces controller, service, DAO, model, route, validation, and Vue admin view files from field definitions. Uses stubs and enumerations for form types, search conditions, and actions. While CRMEB-specific, the stub-based generator pattern is reusable in other frameworks.
A fluent queue dispatch utility that allows chaining job configuration (->job()->do()->push()). Abstracts ThinkPHP queue internals into a clean, testable interface. Demonstrates a reusable pattern for asynchronous task management.
A trait for ThinkPHP models that provides JWT token generation and validation using a configured secret and payload. Encapsulates the JWT auth logic, making it reusable across any model-based authentication system.