How timschofield/weberp works
Project Type & Purpose
• webERP is a monolithic, web-based ERP application written in PHP that serves as a full‐feature business administration and accounting system. It serves end users through a browser and offers modules that cover areas such as general ledger, accounts receivable, inventory, purchasing, manufacturing (MRP), reporting, and more.
• The README confirms that it is intended for multi-user business administration and accounting tasks, and the file tree shows there are many PHP files spread across modules (like BankAccounts, Inventory, Sales, etc.), a dedicated “api” folder for integration endpoints, “includes” for shared logic and libraries, “install” for setup scripts, “companies” for company-specific settings and data, and several directories for documentation, CSS, JavaScript, and third-party libraries.
Key Components from the File Structure
a. Presentation Layer:
• The front-end is served via many PHP files (e.g., index.php, login pages, dashboard scripts) and associated assets in the “css”, “javascripts”, and “locale” directories.
• The “dashboard” and “reportwriter” folders signal specialized user interfaces for dashboards and reports.
b. Business Logic / Application Layer:
• This layer is implemented in the bulk of PHP scripts and the “includes” folder, which houses class definitions, functions for connecting to databases (e.g., ConnectDB.inc, ConnectDB_mysql.inc, etc.), utility functions (e.g., DateFunctions.inc, MiscFunctions.php), EDI, PDF processing (using tcpdf and phplot libraries), and other business rules.
• Modules for different ERP functions (such as BankAccounts.php, Customers.php, SalesReport.php, MRP*.php, etc.) clearly show that many components are tightly integrated into a monolithic PHP application.
c. Data Access / Persistence Layer:
• All SQL scripts and upgrade/installation files in the “install” and “sql” directories indicate that the system uses a MySQL (or MariaDB) relational database.
• Database connection logic is provided via PHP include files allowing dynamic connections according to the configuration in “config.distrib.php” (and your custom config.php file).
d. API/Integration Layer:
• The “api” directory includes endpoints for operations like branches, customers, GL accounts, stock, etc. This acts as an integration layer for external systems or services.
e. Supporting & Ancillary Modules:
• The “companies” directory holds company-specific configuration and possibly company data files.
• Localization is clearly supported through the “locale” directory.
• Additional libraries (such as tcpdf, phplot, and xmlrpc) in the “includes” and “vendor” areas support reporting, barcode generation, PDF generation, and XML RPC communications.
• The “install” folder contains the scripts needed for both new installations and upgrades.
How the Components Interact
• Users interact with the system via a web browser and HTML5 front-end. Their input is handled by PHP scripts which reside in root level files (like index.php) and in dedicated dashboards.
• The web server (Apache, NGINX, etc.) executes the PHP code, which in turn invokes functions and classes from the “includes” directory, and modules across the application.
• The PHP code accesses the relational database (MySQL/MariaDB) to retrieve and update enterprise data (customers, orders, inventory, financial transactions, etc.). SQL scripts and upgrade routines in the “sql” and “install” folders help to manage and upgrade the database schema.
• API endpoints (inside the “api” folder) allow external systems (or even the frontend) to interact with ERP functionalities using HTTP/JSON or XML-RPC.
• Report modules in “reportwriter” and PDF-generating libraries (TCPDF) allow the creation and formatting of financial reports, invoices, picking lists, and other documentation.
• The use of multiple CSS themes and localized content (via “locale”) ensures that the user interface can be customized and localized.