# openg2p/openg2p-registry architecture

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

- Interactive diagram: https://gitdiagram.com/openg2p/openg2p-registry
- Repository: https://github.com/openg2p/openg2p-registry

## Overview

OpenG2P Registry is a modular Odoo application for managing social-protection registrants and related services. A practical workflow is that staff or integrations submit registrant data through portals, ODK import, or APIs; registry models hold individual and group records, while optional modules add identifiers, bank details, documents, deduplication, and change controls. APIs expose registry and G2P Connect operations, and dashboards report registry aggregates. The map follows documented addon capabilities and sampled calls; most addon wiring is declarative or unsampled, so unsupported links are omitted.

Main entry points: [`g2p_registry_base/models/registrant.py`](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_base/models/registrant.py) (Registrant records), [`g2p_registry_dashboard/__init__.py`](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/__init__.py) (Dashboard aggregates), [`g2p_registry_rest_api/routers/individual.py`](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/routers/individual.py) (Registry REST API), [`g2p_registry_g2p_connect_rest_api/routers/registry_search.py`](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_g2p_connect_rest_api/routers/registry_search.py) (G2P Connect search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_registry["Registry data"]
  node_registry_base[("Registrant records<br/>[registrant.py]")]
  node_individual["Individual records<br/>[individual.py]"]
  node_groups["Group records<br/>[group.py]"]
  node_membership["Group membership"]
  node_identifiers["Additional registrant data<br/>[registrant.py]"]
end

subgraph group_intake["Intake and access"]
  node_portals["Registration portals<br/>[main.py]"]
  node_agent_portal["Agent portal<br/>[main.py]"]
  node_oidc["OIDC authentication<br/>[main.py]"]
  node_odk["ODK import<br/>[odk_import.py]"]
end

subgraph group_services["Registry services"]
  node_change["Change management<br/>[change_request.py]"]
  node_dedupe["Deduplication<br/>[registrant.py]"]
  node_documents["Documents"]
  node_encryption["Encryption services"]
end

subgraph group_integration["APIs and exchange"]
  node_rest_api["Registry REST API<br/>[individual.py]"]
  node_individual_mixin["Individual request mapping"]
  node_api_errors["API errors<br/>[base_exception.py]"]
  node_g2p_connect["G2P Connect search<br/>[registry_search.py]"]
  node_connect_schemas["Connect schemas<br/>[registry_search.py]"]
  node_social_schema["Social registry schema<br/>[graphql_schema.py]"]
  node_data_share["Registry data sharing<br/>[registrant.py]"]
end

subgraph group_insight["Insights and credentials"]
  node_dashboard_store[("Dashboard aggregates<br/>[__init__.py]")]
  node_dashboard_cron["Dashboard refresh jobs<br/>[cron.py]"]
  node_dashboard_metrics["Dashboard metrics<br/>[registrant.py]"]
  node_map_renderer["Registry map"]
  node_vci_issuer["Verifiable credentials<br/>[vci_issuer.py]"]
  node_vci_encoder["Credential JSON encoding<br/>[json_encoder.py]"]
end

node_staff(("Staff / registrant"))

node_staff -.->|"submits records"| node_portals
node_staff -.->|"uses portal"| node_agent_portal
node_odk -.->|"imports records"| node_registry_base
node_rest_api -->|"maps requests"| node_individual_mixin
node_rest_api -->|"raises errors"| node_api_errors
node_individual_mixin -->|"raises errors"| node_api_errors
node_g2p_connect -->|"validates messages"| node_connect_schemas
node_g2p_connect -->|"executes queries"| node_social_schema
node_dashboard_cron -.->|"refreshes aggregates"| node_dashboard_store
node_dashboard_metrics -.->|"presents metrics"| node_dashboard_store
node_vci_issuer -->|"encodes credentials"| node_vci_encoder
node_agent_portal -.->|"authenticates with"| node_oidc
node_registry_base -.->|"extends records"| node_identifiers
node_registry_base -.->|"supports groups"| node_groups
node_groups -.->|"tracks membership"| node_membership
node_registry_base -.->|"attaches documents"| node_documents
node_registry_base -.->|"records changes"| node_change
node_registry_base -.->|"checks duplicates"| node_dedupe
node_registry_base -.->|"shares updates"| node_data_share
node_registry_base -.->|"aggregates records"| node_dashboard_store

click node_portals "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registration_portal_base/controllers/main.py"
click node_agent_portal "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_agent_portal_base/controllers/main.py"
click node_oidc "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_auth_id_oidc/controllers/main.py"
click node_odk "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_odk_importer/models/odk_import.py"
click node_registry_base "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_base/models/registrant.py"
click node_individual "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_individual/models/individual.py"
click node_groups "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_group/models/group.py"
click node_membership "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_membership/models/group_membership.py"
click node_identifiers "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_addl_info/models/registrant.py"
click node_change "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_change_management/models/change_request.py"
click node_dedupe "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_deduplication_deduplicator/models/registrant.py"
click node_documents "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_documents/models/registrant_document.py"
click node_encryption "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_encryption/models/encryption_provider.py"
click node_rest_api "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/routers/individual.py"
click node_individual_mixin "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/models/process_individual_mixin.py"
click node_api_errors "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/exceptions/base_exception.py"
click node_g2p_connect "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_g2p_connect_rest_api/routers/registry_search.py"
click node_connect_schemas "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_g2p_connect_rest_api/schemas/registry_search.py"
click node_social_schema "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_social_registry_model/schemas/graphql_schema.py"
click node_data_share "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_datashare_rabbitmq/models/registrant.py"
click node_dashboard_store "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/__init__.py"
click node_dashboard_cron "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/models/cron.py"
click node_dashboard_metrics "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/models/registrant.py"
click node_map_renderer "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_leaflet_map/static/src/g2p_lmap_renderer.js"
click node_vci_issuer "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_openid_vci/models/vci_issuer.py"
click node_vci_encoder "https://github.com/openg2p/openg2p-registry/blob/develop/g2p_openid_vci/json_encoder.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_registry_base,node_individual,node_groups,node_membership,node_identifiers toneBlue
class node_portals,node_agent_portal,node_oidc,node_odk toneAmber
class node_change,node_dedupe,node_documents,node_encryption toneMint
class node_rest_api,node_individual_mixin,node_api_errors,node_g2p_connect,node_connect_schemas,node_social_schema,node_data_share toneRose
class node_dashboard_store,node_dashboard_cron,node_dashboard_metrics,node_map_renderer,node_vci_issuer,node_vci_encoder,node_staff toneIndigo
```

## Components

### Registry data

- [Registrant records](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_base/models/registrant.py): `g2p_registry_base/models/registrant.py`
- [Individual records](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_individual/models/individual.py): `g2p_registry_individual/models/individual.py`
- [Group records](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_group/models/group.py): `g2p_registry_group/models/group.py`
- [Group membership](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_membership/models/group_membership.py): `g2p_registry_membership/models/group_membership.py`
- [Additional registrant data](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_addl_info/models/registrant.py): `g2p_registry_addl_info/models/registrant.py`

### Intake and access

- [Registration portals](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registration_portal_base/controllers/main.py): `g2p_registration_portal_base/controllers/main.py`
- [Agent portal](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_agent_portal_base/controllers/main.py): `g2p_agent_portal_base/controllers/main.py`
- [OIDC authentication](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_auth_id_oidc/controllers/main.py): `g2p_auth_id_oidc/controllers/main.py`
- [ODK import](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_odk_importer/models/odk_import.py): `g2p_odk_importer/models/odk_import.py`

### Registry services

- [Change management](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_change_management/models/change_request.py): `g2p_change_management/models/change_request.py`
- [Deduplication](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_deduplication_deduplicator/models/registrant.py): `g2p_registry_deduplication_deduplicator/models/registrant.py`
- [Documents](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_documents/models/registrant_document.py): `g2p_registry_documents/models/registrant_document.py`
- [Encryption services](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_encryption/models/encryption_provider.py): `g2p_encryption/models/encryption_provider.py`

### APIs and exchange

- [Registry REST API](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/routers/individual.py): `g2p_registry_rest_api/routers/individual.py`
- [Individual request mapping](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/models/process_individual_mixin.py): `g2p_registry_rest_api/models/process_individual_mixin.py`
- [API errors](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_rest_api/exceptions/base_exception.py): `g2p_registry_rest_api/exceptions/base_exception.py`
- [G2P Connect search](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_g2p_connect_rest_api/routers/registry_search.py): `g2p_registry_g2p_connect_rest_api/routers/registry_search.py`
- [Connect schemas](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_g2p_connect_rest_api/schemas/registry_search.py): `g2p_registry_g2p_connect_rest_api/schemas/registry_search.py`
- [Social registry schema](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_social_registry_model/schemas/graphql_schema.py): `g2p_social_registry_model/schemas/graphql_schema.py`
- [Registry data sharing](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_datashare_rabbitmq/models/registrant.py): `g2p_registry_datashare_rabbitmq/models/registrant.py`

### Insights and credentials

- [Dashboard aggregates](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/__init__.py): `g2p_registry_dashboard/__init__.py`
- [Dashboard refresh jobs](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/models/cron.py): `g2p_registry_dashboard/models/cron.py`
- [Dashboard metrics](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_registry_dashboard/models/registrant.py): `g2p_registry_dashboard/models/registrant.py`
- [Registry map](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_leaflet_map/static/src/g2p_lmap_renderer.js): `g2p_leaflet_map/static/src/g2p_lmap_renderer.js`
- [Verifiable credentials](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_openid_vci/models/vci_issuer.py): `g2p_openid_vci/models/vci_issuer.py`
- [Credential JSON encoding](https://github.com/openg2p/openg2p-registry/blob/develop/g2p_openid_vci/json_encoder.py): `g2p_openid_vci/json_encoder.py`

### Other components

- **Staff / registrant**

## Connections

- Staff / registrant → Registration portals: submits records
- Staff / registrant → Agent portal: uses portal
- ODK import → Registrant records: imports records
- Registry REST API → Individual request mapping: maps requests (evidence: `g2p_registry_rest_api/routers/individual.py`)
- Registry REST API → API errors: raises errors (evidence: `g2p_registry_rest_api/routers/individual.py`)
- Individual request mapping → API errors: raises errors (evidence: `g2p_registry_rest_api/models/process_individual_mixin.py`)
- G2P Connect search → Connect schemas: validates messages (evidence: `g2p_registry_g2p_connect_rest_api/routers/registry_search.py`)
- G2P Connect search → Social registry schema: executes queries
- Dashboard refresh jobs → Dashboard aggregates: refreshes aggregates
- Dashboard metrics → Dashboard aggregates: presents metrics
- Verifiable credentials → Credential JSON encoding: encodes credentials (evidence: `g2p_openid_vci/models/vci_issuer.py`)
- Agent portal → OIDC authentication: authenticates with
- Registrant records → Additional registrant data: extends records
- Registrant records → Group records: supports groups
- Group records → Group membership: tracks membership
- Registrant records → Documents: attaches documents
- Registrant records → Change management: records changes
- Registrant records → Deduplication: checks duplicates
- Registrant records → Registry data sharing: shares updates
- Registrant records → Dashboard aggregates: aggregates records
