Skip to content

bbrout/AlexandriaReview

Repository files navigation

AlexandriaReview

Decentralized Peer Review

Please go to and read The Alexander Review.pdf

=======

🧩 OJS Integration Setup & Verification Workflow

The Alexandria Review platform connects each registered journal to its Open Journal Systems (OJS) backend through a live API link. This enables verification, section retrieval, and (later) publication automation.


1. Server-Side Prerequisites

Component Requirement Notes
Web Server nginx serving /var/www/journal/ Acts as reverse proxy for OJS requests
PHP Version 8.4+ via FPM (php8.4-fpm.sock) Confirm via a temporary probe if needed
PHP Extensions bcmath, curl, pdo_mysql, json, mbstring, xml, zip, intl Verify they are loaded by FPM (e.g., /etc/php/8.4/fpm/conf.d/)
OJS Config File /var/www/journal/config.inc.php Must include a valid secret key. Some OJS builds read it from [security], newer ones from [api]. Set both:

[security]
api_secret_key = "YOUR_LONG_RANDOM_SECRET"
api_key_secret = "YOUR_LONG_RANDOM_SECRET"

[api] enable = On require_ssl = On api_secret_key = "YOUR_LONG_RANDOM_SECRET" api_key_secret = "YOUR_LONG_RANDOM_SECRET"

After editing:
sudo systemctl restart php8.4-fpm
sudo systemctl reload nginx

2. Generating API Keys in OJS

  1. Log into OJS as a user with appropriate permissions.
  2. Go to User Profile → API Keys.
  3. Click Create/Generate API Key (button appears only if the secret is set in config.inc.php).
  4. Copy the key for use in the Alexandria Review frontend.

Quick test:

curl -i -H "Accept: application/json" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  "https://journal.example.org/index.php/<context>/api/v1/sections"

If successful, the response is 200 JSON with your journal’s section list.


3. Frontend Verification Flow

File: src/pages/library/journal/JournalRegistrationPage.jsx

  1. Editor clicks Verify & Load Sections on the registration page.
  2. The frontend POSTs to the backend (/api/journals/verify) with:
    • OJS base URL
    • Auth method (e.g., Bearer)
    • API token
    • Optional timeout/version info
  3. The backend requests /api/v1/sections from OJS.
  4. The page renders exactly the section names & IDs returned by OJS (no hard-coded names, no guessing).

Empty state: If OJS returns zero sections, the UI displays a clear message: “No sections found in your OJS journal. Please create at least one section in OJS, then click Verify again.”


4. Registration Flow

  1. After verification, the user fills the required fields (journal name, wallet, OJS details, etc.).
  2. Register Journal triggers:
    • POST /api/journals (create journal).
    • PUT /api/journals/:id/ojs (save OJS config, including selected section IDs).
  3. On failure, the backend rolls back any partial registration so there are no orphaned entries.

5. Deployment Notes

Frontend rebuild:

cd ~/alexandria-review
npm run build
sudo nginx -t && sudo systemctl reload nginx

Backend (example start):

cd ~/alexandria-review/backend
node server.js   # or your preferred process manager

  • doc/OJS_Integration.html (linked from README), or
  • Embed this whole block directly in README.md (GitHub renders HTML inline).

Tip: You can wrap this whole section in <details> for a collapsible README block:

<details>
<summary>OJS Integration Setup & Verification Workflow (click to expand)</summary>

<!-- paste the entire HTML section here -->

</details>

About

Decentralized Peer Review

Resources

Stars

Watchers

Forks

Packages

No packages published