# nituyadav0109/privacy-preserving-graph-storage architecture

> Architecture diagram of the GitHub repository nituyadav0109/privacy-preserving-graph-storage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nituyadav0109/privacy-preserving-graph-storage
- Repository: https://github.com/nituyadav0109/privacy-preserving-graph-storage

## Overview

This is a minimal privacy-preserving graph library with an interactive demo: users provide node IDs, the graph anonymizes identities and stores relationships internally, and the public API exposes degree and aggregate analytics rather than neighbor or path access. The graph implementation delegates anonymization to PrivacyEncoder; AnalyticsService computes average degree from the implementation’s internal snapshot. The README documents the privacy boundary and intentionally excluded operations; the map reflects the shown runtime code, not tests or build tooling.

Main entry points: [`src/main/java/org/core/PrivacyPreservingGraph.java`](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/PrivacyPreservingGraph.java) (Privacy graph), [`src/main/java/org/core/Demo.java`](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Demo.java) (Interactive demo), [`src/main/java/org/core/AnalyticsService.java`](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/AnalyticsService.java) (Average degree), [`src/main/java/org/core/Graph.java`](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Graph.java) (Degree interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Graph API"]
  node_demo["Interactive demo<br/>[Demo.java]"]
  node_graph_api["Degree interface<br/>[Graph.java]"]
end

subgraph group_storage["Private Graph"]
  node_private_graph["Privacy graph"]
  node_encoder["Identity encoder"]
end

subgraph group_analytics["Safe Analytics"]
  node_analytics["Average degree"]
end

node_user(("Demo user"))

node_user -->|"queries"| node_demo
node_demo -->|"creates and queries"| node_private_graph
node_private_graph -->|"implements"| node_graph_api
node_private_graph -->|"anonymizes IDs"| node_encoder
node_demo -->|"requests average"| node_analytics
node_analytics -->|"reads snapshot"| node_private_graph

click node_demo "https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Demo.java"
click node_graph_api "https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Graph.java"
click node_private_graph "https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/PrivacyPreservingGraph.java"
click node_encoder "https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/PrivacyEncoder.java"
click node_analytics "https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/AnalyticsService.java"

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_demo,node_graph_api,node_user toneBlue
class node_private_graph,node_encoder toneAmber
class node_analytics toneMint
```

## Components

### Graph API

- [Interactive demo](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Demo.java): `src/main/java/org/core/Demo.java`
- [Degree interface](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/Graph.java): `src/main/java/org/core/Graph.java`

### Private Graph

- [Privacy graph](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/PrivacyPreservingGraph.java): `src/main/java/org/core/PrivacyPreservingGraph.java`
- [Identity encoder](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/PrivacyEncoder.java): `src/main/java/org/core/PrivacyEncoder.java`

### Safe Analytics

- [Average degree](https://github.com/nituyadav0109/privacy-preserving-graph-storage/blob/main/src/main/java/org/core/AnalyticsService.java): `src/main/java/org/core/AnalyticsService.java`

### Other components

- **Demo user**

## Connections

- Demo user → Interactive demo: queries (evidence: `src/main/java/org/core/Demo.java`)
- Interactive demo → Privacy graph: creates and queries (evidence: `src/main/java/org/core/Demo.java`)
- Privacy graph → Degree interface: implements (evidence: `src/main/java/org/core/PrivacyPreservingGraph.java`)
- Privacy graph → Identity encoder: anonymizes IDs (evidence: `src/main/java/org/core/PrivacyPreservingGraph.java`)
- Interactive demo → Average degree: requests average (evidence: `src/main/java/org/core/Demo.java`)
- Average degree → Privacy graph: reads snapshot (evidence: `src/main/java/org/core/AnalyticsService.java`)
