# parthaggarwal16/opencre architecture

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

- Interactive diagram: https://gitdiagram.com/parthaggarwal16/opencre
- Repository: https://github.com/parthaggarwal16/opencre

## Overview

OpenCRE is a security-requirements catalog and linking platform: users browse and search Common Requirements (CREs), explore their links to standards, and use analysis and contribution features. Its runtime includes a web/API application, a graph-backed catalog, and an import path for catalog and mapping data. A separate documented OIE workflow harvests repository changes, filters candidate knowledge, and proposes CRE links for review or automatic linking. The OIE control-flow edges follow the sampled orchestrator and stage code; unsampled web and database wiring is shown only where documented.

Main entry points: [`application/frontend/src/routes.tsx`](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/routes.tsx) (Page routes), [`application/utils/noise_filter/pipeline.py`](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/noise_filter/pipeline.py) (Noise filter), [`application/utils/librarian/pipeline.py`](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/librarian/pipeline.py) (CRE link librarian), [`application/utils/oie_orchestrator/pipeline.py`](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/oie_orchestrator/pipeline.py) (OIE orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Web application<br/>[App.tsx]"]
  node_routes["Page routes<br/>[routes.tsx]"]
  node_search["Search<br/>[Search.tsx]"]
  node_explorer["CRE explorer<br/>[explorer.tsx]"]
  node_gap["Gap analysis<br/>[GapAnalysis.tsx]"]
  node_myopencre["MyOpenCRE<br/>[MyOpenCRE.tsx]"]
end

subgraph group_catalog["CRE catalog"]
  node_catalogdb[("Catalog database<br/>[db.py]")]
  node_graphdb[("Graph database<br/>[inmemory_graph.py]")]
end

subgraph group_contribution["Data contribution"]
  node_import["Import pipeline<br/>[import_pipeline.py]"]
  node_parsers["Source parsers"]
  node_export["CSV export<br/>[cres_csv_export.py]"]
end

subgraph group_oie["OIE pipeline"]
  node_oie["OIE orchestrator<br/>[pipeline.py]"]
  node_harvester["Repository harvester<br/>[pipeline.py]"]
  node_noise["Noise filter<br/>[pipeline.py]"]
  node_librarian["CRE link librarian<br/>[pipeline.py]"]
  node_llm["LLM services<br/>[litellm_router.py]"]
  node_review["Link decisions<br/>[decision_engine.py]"]
end

subgraph group_interfaces["Interfaces"]
  node_webapi["Web and REST API<br/>[web_main.py]"]
  node_cli["CLI entry<br/>[cre_main.py]"]
  node_mcp["MCP server<br/>[server.py]"]
  node_restclient["REST client<br/>[rest_client.py]"]
end

node_user(("Platform user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"resolves pages"| node_routes
node_routes -->|"routes to"| node_search
node_routes -->|"routes to"| node_explorer
node_routes -->|"routes to"| node_gap
node_routes -->|"routes to"| node_myopencre
node_cli -->|"invokes import"| node_import
node_import -->|"parses sources"| node_parsers
node_import -->|"registers records"| node_catalogdb
node_cli -->|"exports catalog"| node_export
node_user -->|"calls API"| node_webapi
node_user -.->|"connects via MCP"| node_mcp
node_mcp -->|"dispatches tools"| node_restclient
node_restclient -->|"calls REST"| node_webapi
node_oie -->|"runs stage A"| node_harvester
node_oie -->|"runs stage B"| node_noise
node_oie -->|"runs stage C"| node_librarian
node_harvester -->|"writes harvest_input"| node_noise
node_noise -->|"writes knowledge_queue"| node_librarian
node_noise -->|"classifies chunks"| node_llm
node_librarian -->|"scores candidates"| node_llm
node_librarian -->|"decides links"| node_review
node_review -->|"records proposals"| node_catalogdb

click node_frontend "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/App.tsx"
click node_routes "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/routes.tsx"
click node_search "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/Search/Search.tsx"
click node_explorer "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/Explorer/explorer.tsx"
click node_gap "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx"
click node_myopencre "https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx"
click node_webapi "https://github.com/parthaggarwal16/opencre/blob/main/application/web/web_main.py"
click node_cli "https://github.com/parthaggarwal16/opencre/blob/main/application/cmd/cre_main.py"
click node_catalogdb "https://github.com/parthaggarwal16/opencre/blob/main/application/database/db.py"
click node_graphdb "https://github.com/parthaggarwal16/opencre/blob/main/application/database/inmemory_graph.py"
click node_import "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/import_pipeline.py"
click node_parsers "https://github.com/parthaggarwal16/opencre/tree/main/application/utils/external_project_parsers/parsers"
click node_export "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/cres_csv_export.py"
click node_mcp "https://github.com/parthaggarwal16/opencre/blob/main/application/mcp/server.py"
click node_restclient "https://github.com/parthaggarwal16/opencre/blob/main/application/mcp/rest_client.py"
click node_oie "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/oie_orchestrator/pipeline.py"
click node_harvester "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/harvester/pipeline.py"
click node_noise "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/noise_filter/pipeline.py"
click node_librarian "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/librarian/pipeline.py"
click node_llm "https://github.com/parthaggarwal16/opencre/blob/main/application/prompt_client/litellm_router.py"
click node_review "https://github.com/parthaggarwal16/opencre/blob/main/application/utils/librarian/decision_engine.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_frontend,node_routes,node_search,node_explorer,node_gap,node_myopencre,node_user toneBlue
class node_catalogdb,node_graphdb toneAmber
class node_import,node_parsers,node_export toneMint
class node_oie,node_harvester,node_noise,node_librarian,node_llm,node_review toneRose
class node_webapi,node_cli,node_mcp,node_restclient toneIndigo
```

## Components

### User experience

- [Web application](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/App.tsx): `application/frontend/src/App.tsx`
- [Page routes](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/routes.tsx): `application/frontend/src/routes.tsx`
- [Search](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/Search/Search.tsx): `application/frontend/src/pages/Search/Search.tsx`
- [CRE explorer](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/Explorer/explorer.tsx): `application/frontend/src/pages/Explorer/explorer.tsx`
- [Gap analysis](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx): `application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx`
- [MyOpenCRE](https://github.com/parthaggarwal16/opencre/blob/main/application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx): `application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx`

### CRE catalog

- [Catalog database](https://github.com/parthaggarwal16/opencre/blob/main/application/database/db.py): `application/database/db.py`
- [Graph database](https://github.com/parthaggarwal16/opencre/blob/main/application/database/inmemory_graph.py): `application/database/inmemory_graph.py`

### Data contribution

- [Import pipeline](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/import_pipeline.py): `application/utils/import_pipeline.py`
- [Source parsers](https://github.com/parthaggarwal16/opencre/tree/main/application/utils/external_project_parsers/parsers): `application/utils/external_project_parsers/parsers`
- [CSV export](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/cres_csv_export.py): `application/utils/cres_csv_export.py`

### OIE pipeline

- [OIE orchestrator](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/oie_orchestrator/pipeline.py): `application/utils/oie_orchestrator/pipeline.py`
- [Repository harvester](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/harvester/pipeline.py): `application/utils/harvester/pipeline.py`
- [Noise filter](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/noise_filter/pipeline.py): `application/utils/noise_filter/pipeline.py`
- [CRE link librarian](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/librarian/pipeline.py): `application/utils/librarian/pipeline.py`
- [LLM services](https://github.com/parthaggarwal16/opencre/blob/main/application/prompt_client/litellm_router.py): `application/prompt_client/litellm_router.py`
- [Link decisions](https://github.com/parthaggarwal16/opencre/blob/main/application/utils/librarian/decision_engine.py): `application/utils/librarian/decision_engine.py`

### Interfaces

- [Web and REST API](https://github.com/parthaggarwal16/opencre/blob/main/application/web/web_main.py): `application/web/web_main.py`
- [CLI entry](https://github.com/parthaggarwal16/opencre/blob/main/application/cmd/cre_main.py): `application/cmd/cre_main.py`
- [MCP server](https://github.com/parthaggarwal16/opencre/blob/main/application/mcp/server.py): `application/mcp/server.py`
- [REST client](https://github.com/parthaggarwal16/opencre/blob/main/application/mcp/rest_client.py): `application/mcp/rest_client.py`

### Other components

- **Platform user**

## Connections

- Platform user → Web application: uses
- Web application → Page routes: resolves pages
- Page routes → Search: routes to
- Page routes → CRE explorer: routes to
- Page routes → Gap analysis: routes to
- Page routes → MyOpenCRE: routes to
- CLI entry → Import pipeline: invokes import
- Import pipeline → Source parsers: parses sources
- Import pipeline → Catalog database: registers records
- CLI entry → CSV export: exports catalog
- Platform user → Web and REST API: calls API
- Platform user → MCP server: connects via MCP
- MCP server → REST client: dispatches tools
- REST client → Web and REST API: calls REST
- OIE orchestrator → Repository harvester: runs stage A
- OIE orchestrator → Noise filter: runs stage B
- OIE orchestrator → CRE link librarian: runs stage C
- Repository harvester → Noise filter: writes harvest_input
- Noise filter → CRE link librarian: writes knowledge_queue
- Noise filter → LLM services: classifies chunks
- CRE link librarian → LLM services: scores candidates
- CRE link librarian → Link decisions: decides links
- Link decisions → Catalog database: records proposals
