How pkp/ojs works
Main Components
a. Frontend / Presentation Layer:
• “public”, “templates”, “pages”, and “styles” directories as elements of the UI layer.
• Entry point (index.php) and template rendering (located under templates/controllers, templates/frontend, etc.) to show how the application renders content.
b. Business Logic and Core Modules:
• Benchmark the “classes” directory (with subdirectories such as core, article, issue, submission, payment, etc.) as the central business logic and data models.
• “classes/core” (containing Application, Request, Services, and PageRouter) as the central orchestration engine.
c. Controllers and Routing:
• “controllers” and “pages” directories, which route HTTP requests to the proper handler.
• How web requests go from the public entry point to controllers and then hand off to pages or core services.
d. API Layer:
• “api” directory (with a versioned structure such as api/v1) as providing RESTful endpoints for external clients.
e. Plugin and Extension System:
• “plugins” directory that houses numerous submodules (blocks, generic, pubIds, themes, paymethods, importexport, etc.), supporting extensibility.
f. Background Jobs and Schedulers:
• “jobs” directory (and related classes in “classes/scheduler”, “classes/tasks”) to represent the asynchronous processing engine.
• That these jobs handle notifications, statistics compilation, notifications to external services (like ORCID), etc.
g. Localization, Configuration, and Other Assets:
• Acknowledge directories for “locale”, “docs”, “configs”, “schemas”, and “registry”. These form the ancillary but essential parts of the system.
• Use small iconography or annotations to denote configuration, documentation, and schema management.
Relationships and Data Flow
a. A typical HTTP client (web browser) making requests to the front controller (index.php) in “public” which routes to “controllers” and then “pages”.
c. API calls (from clients or third-party integrations) interacting with the “api” endpoints that, in turn, delegate to core business logic.
Architectural Patterns and Design Principles
a. MVC Pattern:
• The structure suggests an MVC-like separation, with “pages” and “controllers” handling the request and view logic, “classes” managing business logic and data access, and “templates” rendering output.
b. Modular / Plugin-oriented Architecture:
• That many OJS functions are implemented via plugins for flexibility. Use a separate “Plugin” block that links into the core system.
c. Layered Architecture:
• A layered approach where presentation, application logic, data access, and integration modules interact through well-defined interfaces.
d. Versioning and API Abstraction:
• Point out how the “api/v1” directory ensures that the API is versioned and decoupled from the underlying business logic.
Technologies and Frameworks
a. That while OJS is built in PHP, it makes extensive use of PHP classes and DAO patterns (distributed in “classes/” directories).
b. Frontend technologies – LESS files under “styles” and “plugins/themes/default/styles” indicate client-side styling.
c. External integrations are handled via gateway and importexport plugins, so mention formats like XML, JSON, and possible external API endpoints (ORCID, Crossref, etc.).
a. A high-level view that shows how the web client interacts with the application.
b. Break down into subsystems: UI, API, core business logic, persistence (which, while not explicitly shown in the file tree, is assumed), plugin architecture, and job scheduling.
c. A section for configuration & localization that integrates with the overall system.
d. Annotations where necessary to explain the purpose of specific modules (for example, noting that “classes/migration” handles database upgrades).