# orcid/orcid-source architecture

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

- Interactive diagram: https://gitdiagram.com/orcid/orcid-source
- Repository: https://github.com/orcid/orcid-source

## Overview

##### Project type and purpose
- ORCID-Source is a monorepo implementing the ORCID Registry: a full-stack, highly modular Java/Spring micro-service ecosystem that powers a public researcher identifier system (APIs, web UI, background jobs).

##### Top-level components (modules/directories)
- UI & API façade
- orcid-web & orcid-web-frontend: the user-facing web application (FreeMarker & AngularJS).
- orcid-web-proxy, orcid-lb, orcid-haprouter: Nginx/Haproxy and load-balancer configs.
- Public & internal REST APIs
- orcid-api-web & orcid-pub-web: public ORCID REST endpoints (Jersey + Spring MVC).
- orcid-internal-api: internal API for member organizations.
- Core business logic & data access
- orcid-core: domain services, adapters, manager layer (Spring, JPA/Hibernate).
- orcid-persistence: DAO layer, Liquibase schema migrations, Postgres persistence.
- Asynchronous processing
- orcid-activemq: JMS broker config & listeners.
- orcid-message-listener & orcid-activities-indexer: background consumers that read from S3 or JMS, update Solr indexes.
- orcid-scheduler-web: scheduled jobs (email trickle, cleanup, indexing).
- Shared libraries & utilities
- orcid-api-common, orcid-utils: shared code for clients, analytics, JAXB, common filters.
- Infrastructure & deployment
- Dockerfile, docker-compose.yml, Jenkinsfile, GitHub workflows, environment files, HAProxy/Nginx configs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    UserBrowser["User Browser\n(AngularJS)"]:::ui

    subgraph "Frontend Layer"
        LBcfg["orcid-lb\n(HAProxy)"]:::api
        HAProxyCfg["orcid-haprouter\n(HAProxy)"]:::api
        WebProxy["orcid-web-proxy\n(Nginx)"]:::api
        FrontendSPA["orcid-web-frontend\n(AngularJS SPA)"]:::ui
        FrontServer["orcid-web\n(FreeMarker)"]:::ui
    end

    subgraph "API Layer"
        PublicAPI["orcid-api-web\n(Spring MVC, Jersey)"]:::api
        PubReadAPI["orcid-pub-web\n(Spring MVC)"]:::api
        InternalAPI["orcid-internal-api\n(Spring MVC)"]:::api
    end

    subgraph "Core Layer"
        Core["orcid-core\n(Spring Services)"]:::core
        APICommon["orcid-api-common"]:::core
        Utils["orcid-utils"]:::core
    end

    subgraph "Async Layer"
        ActiveMQ["ActiveMQ\n(JMS Broker)"]:::messaging
        MsgListener["orcid-message-listener"]:::background
        ActivitiesIndexer["orcid-activities-indexer"]:::background
        Scheduler["orcid-scheduler-web\n(Scheduled Jobs)"]:::background
        Solr["Solr Cores\n(Org, Profile)"]:::messaging
    end

    subgraph "Data Layer"
        Persistence["orcid-persistence\n(JPA, Liquibase)"]:::persistence
        Postgres["Postgres DB"]:::persistence
        RedisStore["Redis\n(Cache/Session)"]:::persistence
    end

    subgraph "External Services"
        S3["S3 Messaging"]:::external
        CrossRef["CrossRef API"]:::external
        FundRef["FundRef API"]:::external
        ROR["ROR API"]:::external
        Figshare["Figshare API"]:::external
    end

    subgraph "Infrastructure"
        DockerCompose["Docker Compose\n(Dockerfile, docker-compose.yml)"]:::infra
        Jenkinsfile["Jenkinsfile"]:::infra
        GitHubWF[".github/workflows"]:::infra
        SolrConfig["solr-config"]:::infra
        RedisScripts["/redis"]:::infra
        DefaultEnv["default.env"]:::infra
        Entrypoint["entrypoint.sh"]:::infra
        DeployScript["deploy.sh"]:::infra
        RunTests["run-tests.sh"]:::infra
    end

    %% Connections
    UserBrowser --> LBcfg
    LBcfg --> HAProxyCfg
    HAProxyCfg --> WebProxy
    WebProxy --> FrontendSPA
    FrontendSPA --> FrontServer
    FrontendSPA --> PublicAPI
    Frontserver --> PublicAPI
    FrontendSPA --> PubReadAPI
    FrontServer --> PubReadAPI
    FrontendSPA --> InternalAPI
    FrontServer --> InternalAPI

    PublicAPI --> Core
    PubReadAPI --> Core
    InternalAPI --> Core

    Core --> Persistence
    Persistence --> Postgres
    Core --> RedisStore
    RedisStore --> Core

    Core --> ActiveMQ
    ActiveMQ --> MsgListener
    ActiveMQ --> ActivitiesIndexer
    MsgListener --> Solr
    ActivitiesIndexer --> Solr

    Scheduler --> Core
    Scheduler --> MsgListener
    Scheduler --> ActivitiesIndexer

    Core --> S3
    Core --> CrossRef
    Core --> FundRef
    Core --> ROR
    Core --> Figshare

    Core --> APICommon
    Core --> Utils

    DockerCompose --> LBcfg
    DockerCompose --> WebProxy
    DockerCompose --> FrontendSPA
    DockerCompose --> FrontServer
    DockerCompose --> PublicAPI
    DockerCompose --> PubReadAPI
    DockerCompose --> InternalAPI
    DockerCompose --> Core
    DockerCompose --> Persistence
    DockerCompose --> ActiveMQ
    DockerCompose --> MsgListener
    DockerCompose --> ActivitiesIndexer
    DockerCompose --> Scheduler
    DockerCompose --> Solr
    DockerCompose --> RedisStore

    Jenkinsfile --> DockerCompose
    GitHubWF --> DockerCompose
    SolrConfig --> Solr
    RedisScripts --> RedisStore
    DefaultEnv --> DockerCompose
    Entrypoint --> DockerCompose
    DeployScript --> DockerCompose
    RunTests --> DockerCompose

    %% Click Events
    click FrontendSPA "https://github.com/orcid/orcid-source/tree/main//orcid-web-frontend"
    click FrontServer "https://github.com/orcid/orcid-source/tree/main//orcid-web"
    click WebProxy "https://github.com/orcid/orcid-source/tree/main//orcid-web-proxy"
    click LBcfg "https://github.com/orcid/orcid-source/tree/main//orcid-lb"
    click HAProxyCfg "https://github.com/orcid/orcid-source/tree/main//orcid-haprouter"
    click PublicAPI "https://github.com/orcid/orcid-source/tree/main//orcid-api-web"
    click PubReadAPI "https://github.com/orcid/orcid-source/tree/main//orcid-pub-web"
    click InternalAPI "https://github.com/orcid/orcid-source/tree/main//orcid-internal-api"
    click Core "https://github.com/orcid/orcid-source/tree/main//orcid-core"
    click Persistence "https://github.com/orcid/orcid-source/tree/main//orcid-persistence"
    click ActiveMQ "https://github.com/orcid/orcid-source/tree/main//orcid-activemq"
    click MsgListener "https://github.com/orcid/orcid-source/tree/main//orcid-message-listener"
    click ActivitiesIndexer "https://github.com/orcid/orcid-source/tree/main//orcid-activities-indexer"
    click Scheduler "https://github.com/orcid/orcid-source/tree/main//orcid-scheduler-web"
    click APICommon "https://github.com/orcid/orcid-source/tree/main//orcid-api-common"
    click Utils "https://github.com/orcid/orcid-source/tree/main//orcid-utils"
    click DockerCompose "https://github.com/orcid/orcid-source/blob/main/docker-compose.yml"
    click Jenkinsfile "https://github.com/orcid/orcid-source/tree/main/Jenkinsfile"
    click GitHubWF "https://github.com/orcid/orcid-source/tree/main/.github/workflows"
    click SolrConfig "https://github.com/orcid/orcid-source/tree/main//solr-config"
    click RedisScripts "https://github.com/orcid/orcid-source/tree/main//redis"
    click DefaultEnv "https://github.com/orcid/orcid-source/blob/main/default.env"
    click Entrypoint "https://github.com/orcid/orcid-source/blob/main/entrypoint.sh"
    click DeployScript "https://github.com/orcid/orcid-source/blob/main/deploy.sh"
    click RunTests "https://github.com/orcid/orcid-source/blob/main/run-tests.sh"

    %% Styles
    classDef ui fill:#E3F2FD,stroke:#2196F3,color:#0D47A1,stroke-width:1px
    classDef api fill:#E8F5E9,stroke:#4CAF50,color:#1B5E20,stroke-width:1px
    classDef core fill:#FFF3E0,stroke:#FB8C00,color:#E65100,stroke-width:1px
    classDef persistence fill:#F3E5F5,stroke:#9C27B0,color:#4A148C,stroke-width:1px
    classDef messaging fill:#FFFDE7,stroke:#FBC02D,color:#F57F17,stroke-width:1px
    classDef background fill:#FFF9C4,stroke:#FDD835,color:#F9A825,stroke-width:1px
    classDef external fill:#ECEFF1,stroke:#90A4AE,color:#607D8B,stroke-dasharray: 5 5,stroke-width:1px
    classDef infra fill:#ECEFF1,stroke:#546E7A,color:#263238,stroke-width:1px
```
