# prathmesh2028/novexa_blockchain architecture

> Architecture diagram of the GitHub repository prathmesh2028/novexa_blockchain, 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/prathmesh2028/novexa_blockchain
- Repository: https://github.com/prathmesh2028/novexa_blockchain

## Overview

KavachTrust supports defense-asset traceability from registration and evidence capture through inspections, lifecycle management, certification, and tamper-evident verification. Users work through a role-specific React application backed by a NestJS API; PostgreSQL stores application state, MinIO holds evidence files, and an outbox worker publishes blockchain events. The graph preserves the documented supply-chain, dashboard, notification, wallet, and audit capabilities. Several subsystem links are based on the README because their implementation files were not sampled.

Main entry points: [`backend/src/app.module.ts`](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/app.module.ts) (NestJS API), [`frontend/f1/routes.tsx`](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/routes.tsx) (Role-based routes), [`backend/src/identity/auth/auth.service.ts`](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/auth.service.ts) (Authentication), [`frontend/f1/App.tsx`](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/App.tsx) (React application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_frontend["React application<br/>[App.tsx]"]
  node_routes["Role-based routes<br/>[routes.tsx]"]
  node_asset_pages["Asset workflows<br/>[LifecyclePage.tsx]"]
  node_cert_pages["Certification views"]
  node_evidence_pages["Evidence views<br/>[EvidencePage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_user_pages["User administration<br/>[UsersPage.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_jwt_guard["JWT guard<br/>[jwt-auth.guard.ts]"]
  node_casbin_guard["Casbin authorization<br/>[casbin.guard.ts]"]
  node_casbin["Policy service<br/>[casbin.service.ts]"]
end

subgraph group_assets["Asset operations"]
  node_asset_lifecycle["Asset lifecycle"]
  node_inspections["Inspections"]
  node_technical_records["Technical records"]
  node_supply_chain["Supply chain"]
end

subgraph group_trust["Trust and verification"]
  node_evidence["Evidence integrity"]
  node_minio[("Object storage<br/>[minio.service.ts]")]
  node_audit["Audit and hash chain<br/>[audit.service.ts]"]
  node_certifications["Certifications"]
  node_verification["Verification"]
  node_blockchain["Blockchain adapter"]
  node_contract_types["SBT contract interface<br/>[KavachTrustSBT.ts]"]
  node_outbox["Transactional outbox<br/>[outbox.service.ts]"]
  node_worker["Outbox worker<br/>[worker.service.ts]"]
end

subgraph group_platform["Platform services"]
  node_api["NestJS API<br/>[app.module.ts]"]
  node_postgres[("PostgreSQL<br/>[prisma.service.ts]")]
  node_search["Search<br/>[search.service.ts]"]
  node_notifications["Notifications"]
end

node_user(("Platform users"))
node_evm[("EVM network")]

node_user -->|"uses"| node_frontend
node_frontend -->|"renders"| node_routes
node_routes -->|"routes to"| node_asset_pages
node_routes -->|"routes to"| node_cert_pages
node_routes -->|"routes to"| node_evidence_pages
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_user_pages
node_frontend -->|"consumes API"| node_api
node_api -.->|"provides authentication"| node_auth
node_jwt_guard -->|"validates token"| node_auth
node_casbin_guard -->|"checks permission"| node_casbin
node_auth -->|"reads and writes users"| node_postgres
node_auth -->|"uses configuration"| node_postgres
node_api -.->|"exposes workflow"| node_asset_lifecycle
node_api -.->|"exposes workflow"| node_inspections
node_api -.->|"exposes workflow"| node_technical_records
node_api -->|"routes requests"| node_supply_chain
node_api -->|"routes requests"| node_evidence
node_evidence -->|"stores files"| node_minio
node_api -->|"routes requests"| node_certifications
node_api -->|"routes requests"| node_verification
node_api -->|"routes requests"| node_blockchain
node_api -->|"persists domain state"| node_postgres
node_api -->|"writes events"| node_outbox
node_worker -->|"publishes pending events"| node_outbox
node_worker -->|"publishes events"| node_evm
node_blockchain -->|"uses EVM"| node_evm
node_certifications -.->|"exposes proof flow"| node_contract_types
node_api -.->|"provides audit capability"| node_audit
node_api -.->|"provides search"| node_search
node_api -.->|"provides notifications"| node_notifications

click node_frontend "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/App.tsx"
click node_routes "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/routes.tsx"
click node_asset_pages "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/lifecycle/LifecyclePage.tsx"
click node_cert_pages "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/certifications/CertificationsPage.tsx"
click node_evidence_pages "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/evidence/EvidencePage.tsx"
click node_dashboard "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/dashboard/DashboardPage.tsx"
click node_user_pages "https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/users/UsersPage.tsx"
click node_api "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/app.module.ts"
click node_auth "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/auth.service.ts"
click node_jwt_guard "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/guards/jwt-auth.guard.ts"
click node_casbin_guard "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/guards/casbin.guard.ts"
click node_casbin "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/core/casbin/casbin.service.ts"
click node_asset_lifecycle "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/lifecycle/lifecycle.service.ts"
click node_inspections "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/inspections/inspections.service.ts"
click node_technical_records "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/technical-records/technical-records.service.ts"
click node_supply_chain "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/supply-chain/supply-chain.service.ts"
click node_evidence "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/evidence/evidence.service.ts"
click node_minio "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/evidence/minio.service.ts"
click node_audit "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/audit/audit.service.ts"
click node_certifications "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/certification/certifications/certifications.service.ts"
click node_verification "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/verification/verification.service.ts"
click node_blockchain "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/blockchain/blockchain.service.ts"
click node_contract_types "https://github.com/prathmesh2028/novexa_blockchain/blob/main/contracts/typechain-types/contracts/KavachTrustSBT.ts"
click node_outbox "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/outbox/outbox.service.ts"
click node_worker "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/outbox/worker.service.ts"
click node_postgres "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/core/database/prisma.service.ts"
click node_search "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/search/search.service.ts"
click node_notifications "https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/notifications/notifications.service.ts"

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_asset_pages,node_cert_pages,node_evidence_pages,node_dashboard,node_user_pages,node_user toneBlue
class node_auth,node_jwt_guard,node_casbin_guard,node_casbin,node_evm toneAmber
class node_asset_lifecycle,node_inspections,node_technical_records,node_supply_chain toneMint
class node_evidence,node_minio,node_audit,node_certifications,node_verification,node_blockchain,node_contract_types,node_outbox,node_worker toneRose
class node_api,node_postgres,node_search,node_notifications toneIndigo
```

## Components

### Web application

- [React application](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/App.tsx): `frontend/f1/App.tsx`
- [Role-based routes](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/routes.tsx): `frontend/f1/routes.tsx`
- [Asset workflows](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/lifecycle/LifecyclePage.tsx): `frontend/f1/pages/lifecycle/LifecyclePage.tsx`
- [Certification views](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/certifications/CertificationsPage.tsx): `frontend/f1/pages/certifications/CertificationsPage.tsx`
- [Evidence views](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/evidence/EvidencePage.tsx): `frontend/f1/pages/evidence/EvidencePage.tsx`
- [Dashboard](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/dashboard/DashboardPage.tsx): `frontend/f1/pages/dashboard/DashboardPage.tsx`
- [User administration](https://github.com/prathmesh2028/novexa_blockchain/blob/main/frontend/f1/pages/users/UsersPage.tsx): `frontend/f1/pages/users/UsersPage.tsx`

### Identity and access

- [Authentication](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/auth.service.ts): `backend/src/identity/auth/auth.service.ts`
- [JWT guard](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/guards/jwt-auth.guard.ts): `backend/src/identity/auth/guards/jwt-auth.guard.ts`
- [Casbin authorization](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/identity/auth/guards/casbin.guard.ts): `backend/src/identity/auth/guards/casbin.guard.ts`
- [Policy service](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/core/casbin/casbin.service.ts): `backend/src/core/casbin/casbin.service.ts`

### Asset operations

- [Asset lifecycle](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/lifecycle/lifecycle.service.ts): `backend/src/asset-management/lifecycle/lifecycle.service.ts`
- [Inspections](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/inspections/inspections.service.ts): `backend/src/asset-management/inspections/inspections.service.ts`
- [Technical records](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/technical-records/technical-records.service.ts): `backend/src/asset-management/technical-records/technical-records.service.ts`
- [Supply chain](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/supply-chain/supply-chain.service.ts): `backend/src/supply-chain/supply-chain.service.ts`

### Trust and verification

- [Evidence integrity](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/evidence/evidence.service.ts): `backend/src/asset-management/evidence/evidence.service.ts`
- [Object storage](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/evidence/minio.service.ts): `backend/src/asset-management/evidence/minio.service.ts`
- [Audit and hash chain](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/asset-management/audit/audit.service.ts): `backend/src/asset-management/audit/audit.service.ts`
- [Certifications](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/certification/certifications/certifications.service.ts): `backend/src/certification/certifications/certifications.service.ts`
- [Verification](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/verification/verification.service.ts): `backend/src/verification/verification.service.ts`
- [Blockchain adapter](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/blockchain/blockchain.service.ts): `backend/src/trust/blockchain/blockchain.service.ts`
- [SBT contract interface](https://github.com/prathmesh2028/novexa_blockchain/blob/main/contracts/typechain-types/contracts/KavachTrustSBT.ts): `contracts/typechain-types/contracts/KavachTrustSBT.ts`
- [Transactional outbox](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/outbox/outbox.service.ts): `backend/src/trust/outbox/outbox.service.ts`
- [Outbox worker](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/trust/outbox/worker.service.ts): `backend/src/trust/outbox/worker.service.ts`

### Platform services

- [NestJS API](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/app.module.ts): `backend/src/app.module.ts`
- [PostgreSQL](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/core/database/prisma.service.ts): `backend/src/core/database/prisma.service.ts`
- [Search](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/search/search.service.ts): `backend/src/search/search.service.ts`
- [Notifications](https://github.com/prathmesh2028/novexa_blockchain/blob/main/backend/src/notifications/notifications.service.ts): `backend/src/notifications/notifications.service.ts`

### Other components

- **Platform users**
- **EVM network**

## Connections

- Platform users → React application: uses (evidence: `README.md`)
- React application → Role-based routes: renders (evidence: `frontend/f1/App.tsx`)
- Role-based routes → Asset workflows: routes to (evidence: `frontend/f1/routes.tsx`)
- Role-based routes → Certification views: routes to (evidence: `frontend/f1/routes.tsx`)
- Role-based routes → Evidence views: routes to (evidence: `frontend/f1/routes.tsx`)
- Role-based routes → Dashboard: routes to (evidence: `frontend/f1/routes.tsx`)
- Role-based routes → User administration: routes to (evidence: `frontend/f1/routes.tsx`)
- React application → NestJS API: consumes API (evidence: `README.md`)
- NestJS API → Authentication: provides authentication
- JWT guard → Authentication: validates token (evidence: `backend/src/identity/auth/guards/jwt-auth.guard.ts`)
- Casbin authorization → Policy service: checks permission (evidence: `backend/src/identity/auth/guards/casbin.guard.ts`)
- Authentication → PostgreSQL: reads and writes users (evidence: `backend/src/identity/auth/auth.service.ts`)
- Authentication → PostgreSQL: uses configuration (evidence: `backend/src/identity/auth/auth.service.ts`)
- NestJS API → Asset lifecycle: exposes workflow
- NestJS API → Inspections: exposes workflow
- NestJS API → Technical records: exposes workflow
- NestJS API → Supply chain: routes requests
- NestJS API → Evidence integrity: routes requests
- Evidence integrity → Object storage: stores files (evidence: `README.md`)
- NestJS API → Certifications: routes requests
- NestJS API → Verification: routes requests
- NestJS API → Blockchain adapter: routes requests
- NestJS API → PostgreSQL: persists domain state (evidence: `README.md`)
- NestJS API → Transactional outbox: writes events (evidence: `README.md`)
- Outbox worker → Transactional outbox: publishes pending events (evidence: `README.md`)
- Outbox worker → EVM network: publishes events (evidence: `README.md`)
- Blockchain adapter → EVM network: uses EVM (evidence: `README.md`)
- Certifications → SBT contract interface: exposes proof flow
- NestJS API → Audit and hash chain: provides audit capability
- NestJS API → Search: provides search
- NestJS API → Notifications: provides notifications
