# openlibhums/janeway architecture

> Architecture diagram of the GitHub repository openlibhums/janeway, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openlibhums/janeway
- Repository: https://github.com/openlibhums/janeway

## Overview

##### Main Components
The system should be divided into these key components:

a. Core Platform Components:
- Web Application Layer (Django)
- Database Layer (supports PostgreSQL, MySQL, SQLite)
- File Storage System
- Authentication & Authorization System
- Plugin System

b. Functional Modules:
- Journal Management
- Submission System
- Review System
- Production System
- Publishing System
- Repository System
- User Management
- Content Management System (CMS)

##### Architecture Patterns to Highlight

a. MVC/MTV Pattern:
- Models (src/core/models.py, etc.)
- Templates (src/templates/)
- Views (src/core/views.py, etc.)

b. Plugin Architecture:
- Homepage Elements
- Notification Systems
- Theme System

##### Integration Points

a. External Services:
- ORCID Integration
- CrossRef DOI System
- OAI-PMH Interface
- iThenticate
- Mailgun

b. API Layer:
- REST API (src/api/)
- OAI Interface (src/api/oai/)

##### Layer Organization

Top to bottom:
##### Data Layer (Database & File Storage)

Left to right:

##### Key Workflows to Highlight

- Article Submission Flow
- Peer Review Process
- Production Workflow
- Publishing Pipeline
- User Authentication Flow

##### Infrastructure Components

- Docker Container Support
- WSGI Interface
- Static/Media File Handling
- Cache System
- Task Queue System

##### Security boundaries

Remember to:
- Version information
- Supported databases and deployment options
- Security boundaries and access control points

This system design should reflect Janeway's core principles of readability and transparency while capturing its comprehensive feature set as a publishing platform.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User Interface Layer"
        Themes["Theme System"]
        DefaultThemes["Default Themes"]
        HomepageElements["Homepage Elements"]
    end

    subgraph "Application Layer"
        WebCore["Web Application Core"]
        PluginSystem["Plugin System"]
        Settings["Settings Management"]
    end

    subgraph "Content Management"
        CMS["CMS Module"]
        JournalMgmt["Journal Management"]
        PressMgmt["Press Management"]
    end

    subgraph "Editorial Workflow"
        Submission["Submission System"]
        Review["Review System"]
        Copyediting["Copyediting System"]
        Production["Production System"]
        Proofing["Proofing System"]
    end

    subgraph "Publishing Components"
        Repository["Repository System"]
        Identifiers["Identifiers Management"]
        Metrics["Metrics System"]
        Transform["Transform System"]
    end

    subgraph "User Management"
        UserModels["Core User Models"]
        Auth["Authentication System"]
        Comms["Communication System"]
    end

    subgraph "API Layer"
        RestAPI["REST API"]
        OAI["OAI Interface"]
    end

    subgraph "External Services"
        ORCID[("ORCID")]
        CrossRef[("CrossRef DOI")]
        iThenticate[("iThenticate")]
        Mailgun[("Mailgun")]
    end

    subgraph "Data Layer"
        DB[(Database)]
        FileStorage[(File Storage)]
    end

    %% Relationships
    WebCore --> DB
    WebCore --> FileStorage
    PluginSystem --> WebCore
    Themes --> WebCore
    DefaultThemes --> Themes
    HomepageElements --> WebCore

    CMS --> WebCore
    JournalMgmt --> WebCore
    PressMgmt --> WebCore

    Submission --> WebCore
    Review --> WebCore
    Copyediting --> WebCore
    Production --> WebCore
    Proofing --> WebCore

    Repository --> WebCore
    Identifiers --> WebCore
    Metrics --> WebCore
    Transform --> WebCore

    UserModels --> WebCore
    Auth --> WebCore
    Comms --> WebCore

    RestAPI --> WebCore
    OAI --> WebCore

    WebCore --> ORCID
    WebCore --> CrossRef
    WebCore --> iThenticate
    WebCore --> Mailgun

    %% Click events
    click WebCore "https://github.com/openlibhums/janeway/tree/master/src/core/"
    click FileStorage "https://github.com/openlibhums/janeway/blob/master/src/core/file_system.py"
    click Auth "https://github.com/openlibhums/janeway/tree/master/src/security/"
    click PluginSystem "https://github.com/openlibhums/janeway/blob/master/src/core/plugin_loader.py"
    click HomepageElements "https://github.com/openlibhums/janeway/tree/master/src/core/homepage_elements/"
    click Settings "https://github.com/openlibhums/janeway/blob/master/src/core/example_settings.py"
    click CMS "https://github.com/openlibhums/janeway/tree/master/src/cms/"
    click JournalMgmt "https://github.com/openlibhums/janeway/tree/master/src/journal/"
    click PressMgmt "https://github.com/openlibhums/janeway/tree/master/src/press/"
    click Submission "https://github.com/openlibhums/janeway/tree/master/src/submission/"
    click Review "https://github.com/openlibhums/janeway/tree/master/src/review/"
    click Copyediting "https://github.com/openlibhums/janeway/tree/master/src/copyediting/"
    click Production "https://github.com/openlibhums/janeway/tree/master/src/production/"
    click Proofing "https://github.com/openlibhums/janeway/tree/master/src/proofing/"
    click Repository "https://github.com/openlibhums/janeway/tree/master/src/repository/"
    click Identifiers "https://github.com/openlibhums/janeway/tree/master/src/identifiers/"
    click Metrics "https://github.com/openlibhums/janeway/tree/master/src/metrics/"
    click Transform "https://github.com/openlibhums/janeway/tree/master/src/transform/"
    click UserModels "https://github.com/openlibhums/janeway/blob/master/src/core/models.py"
    click Comms "https://github.com/openlibhums/janeway/tree/master/src/comms/"
    click RestAPI "https://github.com/openlibhums/janeway/tree/master/src/api/"
    click OAI "https://github.com/openlibhums/janeway/tree/master/src/api/oai/"
    click Themes "https://github.com/openlibhums/janeway/tree/master/src/themes/"
    click DefaultThemes "https://github.com/openlibhums/janeway/tree/master/src/themes/OLH/"

    %% Styling
    classDef core fill:#b3e0ff
    classDef external fill:#98FB98
    classDef plugin fill:#FFB366
    classDef data fill:#d3d3d3
    
    class WebCore,PluginSystem,Settings core
    class ORCID,CrossRef,iThenticate,Mailgun external
    class Themes,HomepageElements plugin
    class DB,FileStorage data

    %% Legend
    subgraph Legend
        CoreComponent["Core Component"]:::core
        ExternalService["External Service"]:::external
        PluginComponent["Plugin Component"]:::plugin
        DataComponent["Data Storage"]:::data
    end
```
