How rtcamp/godam works
• Plugin Core: Represented by the main PHP files like godam.php, the inc/ directory (classes for plugin management, asset handling, taxonomy management, etc.) and the admin directory (admin UI files handling transcoder settings, REST routes, and media functionalities). Label it “WordPress Plugin Core.”
• Admin Interface: Show both “Admin” (PHP-based backend pages in admin/ and class files) and “WordPress Media Library Integration” (which hooks into the WordPress admin dashboard). Indicate the UI components provided by the plugin’s PHP classes.
• Build & Asset Pipeline: Include a component to represent the build system with Node/NPM scripts (Gruntfile.js, package.json, webpack.config.js, tailwind.config.js, etc.) and how these generate production assets for both the plugin’s admin UI and front-end blocks.
• External Integrations: Highlight external services such as:
• godam.io – used for deactivation feedback.
• app.godam.io – for media transcoding services and API key validation.
• analytics.godam.io – for collecting and processing video analytics.
Relationships and Data Flows
• That WordPress (and its admin dashboard) interacts with the Plugin Core to configure settings (via PHP classes and REST API endpoints defined under inc/classes/rest-api).
• Separation between the front-end video player (built with React, Redux, and JavaScript assets from pages/ and assets/src/blocks) and the back-end processing.
– Data/control flow from the WordPress dashboard to the PHP back end (plugin classes in admin/ and inc/).
– Build pipeline flow from source files (assets/src, pages) to bundled production assets.
– Communication with external services (transcoding, deactivation feedback, analytics) during key events like media upload, deactivation, and when a video is watched.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly distinguish between the WordPress back end (PHP, REST API endpoints, admin actions) and the front-end modern JavaScript components.
• Modularization: The file structure indicates modular components such as “admin”, “inc”, “assets”, and “pages” – each representing a particular aspect of the plugin functionality.
• Extensibility: Note how external APIs and integration points (via REST and external service calls) are abstracted and how new interactive video layers can be added.
• Build & Testing: Include components representing build automation (npm, composer, Grunt, webpack) and testing with e2e tests (located under tests/e2e-playwright).
Schematic Elements to be Included
– “Upload Video” event flowing from WordPress to Plugin Core to External Transcoding Service.
– “User Video Playback” event sending analytics from Frontend to analytics.godam.io.
• Use callouts or annotations for key technologies (PHP, React, Redux, Node.js, Grunt/Webpack) which are integral parts of the plugin’s architecture.