How weberp-team/weberp works
Project type and purpose
• This is webERP, an open-source, web-based ERP (enterprise resource planning) system built on the LAMP stack (Linux/Apache/Nginx + PHP + MySQL/MariaDB).
• It delivers multi-user accounting and business administration tools via server-side PHP scripts, covering general ledger, inventory, sales orders, MRP, purchasing, EDI, reporting, etc.
File structure
• Top-level PHP scripts (e.g., AccountGroups.php, SalesOrders.php, etc.) act as “controllers”/entry points.
• The includes/ directory holds shared libraries for database connection (ConnectDB.inc), business logic classes (Define*.php), utility functions (MiscFunctions.inc), session, authentication, PDF page headers, EDI config, etc.
• Third-party libraries under includes: PHPExcel, phplot (charting), TCPDF (PDF generation), xmlrpc, php-gettext (localization).
• api/ and xmlrpc/ expose programmatic endpoints (REST-like PHP scripts and XML-RPC server).
• reportwriter/ is a sub-module for ad-hoc report building (FormMaker, ReportMaker).
• companies/ holds per-company configuration, custom EDI files, form designs, part images, report templates.
• config.distrib.php and config.php handle global configuration; sql/ contains schema and migration scripts. css/ and javascripts/ hold UI assets; locale/ has translation files.
README for additional insights
• Confirms it’s a full-stack PHP ERP, with no separate SPA frontend. It relies on server-rendered HTML/CSS/JS (Bootstrap themes).
• Emphasizes requirements: web server, PHP 5.1+, MySQL/MariaDB, HTML5 browser.
• Documentation and upgrade scripts live under doc/ and sql/.
a. Main components:
• Clients (web browsers)
• Load balancer or reverse proxy (optional)
• Web server + PHP interpreter (Apache, NGINX, Hiawatha)
• Application modules (entry-point PHP scripts)
• Shared libraries & service layer (includes/, Classes/PHPExcel, xmlrpc/)
• Data storage: MySQL/MariaDB database
• File storage: companies/ directory, reportwriter templates, uploaded media
• External services: SMTP mail server, FTP/EDI endpoints, XML-RPC consumers/clients
b. Relationships and interactions:
• HTTP(S) requests from browser → web server → PHP front controller scripts
• Controllers invoke includes/ business-logic classes and utility functions
• Business logic issues SQL queries to the database (via ConnectDB_*.inc)
• PDF/chart libraries invoked for report generation, writing output to browser or file system
• Localization layer (php-gettext) loads .po/.mo per locale
• API scripts and XML-RPC server expose data operations → external clients
• EDI workflows read/write files under companies/<company>/EDI_* and may call FTP_RadioBeacon
• Email functions (htmlMimeMail, smtp.php) deliver notifications
c. Architectural patterns and principles:
• Monolithic, layered architecture: presentation (entry PHP scripts + CSS/JS), service/logic layer (includes/, reportwriter/), data access layer (ConnectDB_*.inc), persistence (MySQL + file store)
• Modular PHP scripts organized by business domain (Sales, GL, Inventory, Fixed Assets, etc.)
• Shared libraries abstract repetitive tasks (PDF headers, charting, Excel I/O)
• Configuration per‐company isolated to companies/ subfolders
• Localization via gettext, enabling multi‐language support
d. Key technologies/frameworks:
• PHP 5+
• MySQL/MariaDB
• PHPExcel for Excel import/export
• TCPDF and PHPlot for PDF and chart generation
• xmlrpc library for XML-RPC interfaces
• php-gettext for internationalization
• Bootstrap CSS themes for UI
Detail
• Major directory as a logical module in the service layer.
• Per-company storage partition.