How easy-wi/developer works
Project Overview and Purpose
• Easy-WI is a web-based control panel designed to manage server daemons such as gameservers and TS3 voice servers. It also embeds a CMS which automates game and voice server lending services.
• It is aimed at a diverse user base (commercial hosting providers, LAN party organizers, private individuals, etc.) and emphasizes automation and minimal manual administration.
• The system is built in PHP (7.4+) and leverages many third-party libraries (e.g., Decoda for markup parsing, Symfony Yaml, GameQ for game server query protocols, hybridauth for social logins, phpmailer, phpseclib, etc.)
Key Components in the File Structure and their Architectural Roles
A. Presentation/Frontend Layer
– Templates: The “template”, “template/New”, “template/default” folders contain HTML views for both administrative and user interfaces.
– AJAX Endpoints: Various AJAX calls (e.g., in js/default/ajax and stuff/ajax) support dynamic operations and partial page updates.
B. Business Logic / Application Layer
– PHP Entry Points: Files such as index.php, admin.php, login.php, api.php, and others serve as primary controllers.
– Modular “Stuff” Directory: The “stuff” folder is subdivided into subdirectories (admin, ajax, api, cms, custom_modules, data, jobs, methods, user) that encapsulate business logic for different modules:
• “stuff/admin”: Contains administrative modules (user management, game server settings, feeds, etc.).
• “stuff/api”: Provides REST API endpoints.
• “stuff/cms”: Houses CMS logic and view initializers.
• “stuff/ajax”: Contains handlers for AJAX-driven interactions.
• “stuff/methods”: Contains core classes and functions (e.g., for FTP, database operations, and validation).
• “stuff/user”: Contains user panel modules including lending functions and customization.
C. Infrastructure / Integration Layer
– Installer & Configuration: The “install” folder manages the database & system configuration. The “config.php” file and various language XML files support configuration and multilanguage support.
– Third-Party Libraries: The “third_party” folder holds external libraries which integrate:
• Decoda for markup/BBCode parsing.
• Symfony’s YAML component for configuration.
• GameQ for game server querying.
• Hybridauth for social authentication.
• MonstaFTP, PHPMailer, phpseclib, etc.
– Scripts for server integrations: PHP files such as cloud.php, lend.php, serverallocation.php and various “jobs” scripts automate interactions with external daemons (gameservers, TS3 voice servers).
Relationships and Data Flow
• Clients (users and administrators) interact via browsers with the presentation layer. They receive HTML/CSS/JS pages that dynamically call backend endpoints via AJAX as needed.
• The PHP entry scripts (admin.php, login.php, etc.) invoke the appropriate modules in the “stuff” directory. These modules encapsulate business logic for server management, user management, and content management.
• The system interacts with external services (e.g., game servers, TS3 voice servers) and libraries. These external integrations are managed by dedicated methods (in “stuff/methods”) and jobs (“stuff/jobs”) that periodically monitor and control daemons.
• Although not explicitly shown in the file tree, the use of PDO, PHP configuration files, and related scripts indicate database interactions (most likely MySQL) that support persistent storage of user data, server settings, and configuration.
• The REST API endpoints (via api.php and under stuff/api) not only serve internal modules but are also designed to integrate with third-party systems, such as WHMCS or Magento.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear distinction between the presentation (templates and static assets) and business logic (PHP modules in “stuff”), with fallback to default templates.
• Modular Design: Business logic is broken down into distinct modules (admin, API, AJAX, CMS, user panels) for maintainability and scalability.
• Reusability and Integration: Extensive use of third-party libraries and shared utilities (e.g., for social authentication, mail, FTP, and game server queries).
• Use of REST API: Many modules are exposed as APIs allowing integration with external platforms.
• Fallback and Theming: Custom templates can override default views, indicating a template override mechanism.
Final Steps
• Every major directory, service, or external integration is represented.