|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +SciELO Screening Plugin for OPS 3.5 (Open Preprint Systems). A PKP generic plugin that performs automated verifications on author submissions and displays status in the editorial workflow. |
| 8 | + |
| 9 | +**Stack:** PHP 8.0+ backend, Vue 3 frontend, Smarty templates, Vite bundler |
| 10 | + |
| 11 | +## Common Commands |
| 12 | + |
| 13 | +```bash |
| 14 | +# Frontend development (watch mode) |
| 15 | +npm run dev |
| 16 | + |
| 17 | +# Production build |
| 18 | +npm run build |
| 19 | + |
| 20 | +# PHP code style fixing |
| 21 | +php-cs-fixer fix |
| 22 | + |
| 23 | +# Run PHP unit tests (from OPS root directory) |
| 24 | +./lib/pkp/lib/vendor/bin/phpunit plugins/generic/scieloScreening/tests/ |
| 25 | + |
| 26 | +# Run specific unit test |
| 27 | +./lib/pkp/lib/vendor/bin/phpunit plugins/generic/scieloScreening/tests/ScreeningCheckerTest.php |
| 28 | + |
| 29 | +# Run Cypress tests (from OPS root directory) |
| 30 | +npx cypress run --config integrationFolder=plugins/generic/scieloScreening/cypress/tests |
| 31 | +``` |
| 32 | + |
| 33 | +## System Requirements |
| 34 | + |
| 35 | +- `poppler-utils` package required for `pdftotext` command (used by DocumentChecker) |
| 36 | + |
| 37 | +## Architecture |
| 38 | + |
| 39 | +**Plugin Entry Point:** `ScieloScreeningPlugin.php` - Registers hooks for form validation, template rendering, schema modification, and API routing. |
| 40 | + |
| 41 | +**Core Classes (classes/):** |
| 42 | +- `ScreeningExecutor` - Orchestrates all screening checks, returns comprehensive status object |
| 43 | +- `ScreeningChecker` - Validation engine for affiliations, ORCID, uppercase names, PDF count |
| 44 | +- `DocumentChecker` - PDF text extraction and ORCID detection using pdftotext |
| 45 | +- `OrcidClient` - OAuth 2.0 client for ORCID API (Public/Sandbox/Member endpoints) |
| 46 | +- `APIKeyEncryption` - Encrypts/decrypts ORCID credentials at rest |
| 47 | + |
| 48 | +**Frontend (resources/js/):** |
| 49 | +- Vue 3 Composition API with `<script setup>` |
| 50 | +- Integrates with PKP UI Module (`useLocalize`, `useUrl`, `useFetch`) |
| 51 | +- Components registered via PKP registry system |
| 52 | + |
| 53 | +**API Endpoint:** |
| 54 | +- `GET /api/v1/submissions/{submissionId}/screening` - Returns all screening statuses |
| 55 | + |
| 56 | +**Hook Integration Points:** |
| 57 | +- `Submission::validateSubmit` / `Publication::validatePublish` - Form validation |
| 58 | +- `Template::SubmissionWizard::Section::Review` - Template rendering |
| 59 | +- `Schema::get::publication` - Schema modification |
| 60 | +- `Settings::Workflow::listScreeningPlugins` - Workflow UI registration |
| 61 | + |
| 62 | +## Testing |
| 63 | + |
| 64 | +- **PHP Unit Tests:** `tests/` directory with test assets in `tests/assets/` |
| 65 | +- **Cypress E2E:** `cypress/tests/` - Plugin setup, submission wizard, workflow features |
| 66 | +- **CI:** GitLab CI with unit tests, Cypress tests, and PHP-CS-Fixer checks |
| 67 | + |
| 68 | +## Locale |
| 69 | + |
| 70 | +Translations in `locale/` (en, es, pt_BR). Backend locale keys registered in `registry/uiLocaleKeysBackend.json`. |
0 commit comments