# pat-asc/plv-blockgo architecture

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

- Interactive diagram: https://gitdiagram.com/pat-asc/plv-blockgo
- Repository: https://github.com/pat-asc/plv-blockgo

## Overview

PLV Blockchain Grades Ledger combines role-based academic portals, ASP.NET workflows backed by PostgreSQL, and Node.js/Fabric ledger services. The principal flow is faculty grade entry, department-admin review, registrar finalization, then student access to finalized grades. Registrar account approval, enrollment and section assignment, curriculum management, bulk upload, audit history, support, and realtime chat are distinct supporting capabilities. Edges reflect the README and shown call/import evidence; ledger internals and several service implementations were not sampled, so their connections are documented rather than inferred from names.

Main entry points: [`client-app/Controllers/GradeController.cs`](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/GradeController.cs) (Grade workflows), [`client-app/Services/BlockchainService.cs`](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/BlockchainService.cs) (Blockchain adapter), [`frontend/src/services/api.js`](https://github.com/pat-asc/plv-blockgo/blob/main/frontend/src/services/api.js) (API client), [`client-app/Controllers/AuthController.cs`](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/AuthController.cs) (Account and auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Role Portals"]
  node_portals["Role portals<br/>[App.js]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_dotnet["Academic Backend"]
  node_auth["Account and auth<br/>[AuthController.cs]"]
  node_sectioning["Enrollment and sectioning"]
  node_curriculum["Curriculum management"]
  node_grades["Grade workflows<br/>[GradeController.cs]"]
  node_bulk["Bulk grade upload"]
  node_students["Student grade access"]
  node_realtime["Chat and notifications<br/>[ChatHub.cs]"]
  node_accounts["Account provisioning"]
  node_audit["Audit events<br/>[AuditLogService.cs]"]
  node_blockchain["Blockchain adapter"]
end

subgraph group_middleware["Identity and Ledger Bridge"]
  node_gateway["Middleware gateway<br/>[api-gateway.js]"]
  node_identity["Middleware auth<br/>[auth-service.js]"]
  node_ledger["Ledger service<br/>[ledger-service.js]"]
  node_fabricgw["Fabric gateway<br/>[gateway-manager.js]"]
  node_wallet[("Identity wallets<br/>[wallet-manager.js]")]
end

subgraph group_fabric["Fabric Network"]
  node_contract["Grade chaincode<br/>[main.go]"]
  node_ledgerstate[("Fabric ledger state")]
  node_ipfs[("IPFS storage")]
end

subgraph group_state["Application State"]
  node_db[("PostgreSQL")]
end

node_users(("Students, faculty, registrar"))

node_users -->|"use"| node_portals
node_portals -->|"request data"| node_api
node_api -->|"authenticate"| node_auth
node_api -->|"grade requests"| node_grades
node_api -->|"manage enrollment"| node_sectioning
node_auth -->|"assign students"| node_sectioning
node_auth -->|"provision accounts"| node_accounts
node_grades -->|"read and write"| node_db
node_sectioning -->|"read and write"| node_db
node_curriculum -->|"record audit"| node_blockchain
node_grades -->|"submit and query"| node_blockchain
node_bulk -->|"submit grades"| node_blockchain
node_students -->|"query grades"| node_blockchain
node_grades -.->|"record events"| node_audit
node_grades -.->|"notify changes"| node_realtime
node_blockchain -->|"send ledger requests"| node_gateway
node_gateway -.->|"route auth"| node_identity
node_gateway -.->|"route ledger"| node_ledger
node_identity -->|"query accounts"| node_db
node_ledger -.->|"invoke transactions"| node_fabricgw
node_fabricgw -->|"load identities"| node_wallet
node_fabricgw -->|"submit and query"| node_contract
node_contract -->|"update ledger"| node_ledgerstate
node_grades -.->|"store grading files"| node_ipfs

click node_portals "https://github.com/pat-asc/plv-blockgo/blob/main/frontend/src/App.js"
click node_api "https://github.com/pat-asc/plv-blockgo/blob/main/frontend/src/services/api.js"
click node_auth "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/AuthController.cs"
click node_sectioning "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/EnrollmentSectioningService.cs"
click node_curriculum "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/CurriculumsController.cs"
click node_grades "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/GradeController.cs"
click node_bulk "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/BulkUploadController.cs"
click node_students "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/StudentController.cs"
click node_realtime "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/ChatHub.cs"
click node_accounts "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/AccountProvisioningService.cs"
click node_db "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Models/RegistrarDbContext.cs"
click node_audit "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/AuditLogService.cs"
click node_blockchain "https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/BlockchainService.cs"
click node_gateway "https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/api-gateway.js"
click node_identity "https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/auth-service.js"
click node_ledger "https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/ledger-service.js"
click node_fabricgw "https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/fabric/gateway-manager.js"
click node_wallet "https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/fabric/wallet-manager.js"
click node_contract "https://github.com/pat-asc/plv-blockgo/blob/main/chaincode/main.go"

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_portals,node_api toneBlue
class node_auth,node_sectioning,node_curriculum,node_grades,node_bulk,node_students,node_realtime,node_accounts,node_audit,node_blockchain toneAmber
class node_gateway,node_identity,node_ledger,node_fabricgw,node_wallet toneMint
class node_contract,node_ledgerstate,node_ipfs toneRose
class node_db,node_users toneIndigo
```

## Components

### Role Portals

- [Role portals](https://github.com/pat-asc/plv-blockgo/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [API client](https://github.com/pat-asc/plv-blockgo/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Academic Backend

- [Account and auth](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/AuthController.cs): `client-app/Controllers/AuthController.cs`
- [Enrollment and sectioning](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/EnrollmentSectioningService.cs): `client-app/Services/EnrollmentSectioningService.cs`
- [Curriculum management](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/CurriculumsController.cs): `client-app/Controllers/CurriculumsController.cs`
- [Grade workflows](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/GradeController.cs): `client-app/Controllers/GradeController.cs`
- [Bulk grade upload](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/BulkUploadController.cs): `client-app/Controllers/BulkUploadController.cs`
- [Student grade access](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/StudentController.cs): `client-app/Controllers/StudentController.cs`
- [Chat and notifications](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Controllers/ChatHub.cs): `client-app/Controllers/ChatHub.cs`
- [Account provisioning](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/AccountProvisioningService.cs): `client-app/Services/AccountProvisioningService.cs`
- [Audit events](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/AuditLogService.cs): `client-app/Services/AuditLogService.cs`
- [Blockchain adapter](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Services/BlockchainService.cs): `client-app/Services/BlockchainService.cs`

### Identity and Ledger Bridge

- [Middleware gateway](https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/api-gateway.js): `middleware/src/services/api-gateway.js`
- [Middleware auth](https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/auth-service.js): `middleware/src/services/auth-service.js`
- [Ledger service](https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/services/ledger-service.js): `middleware/src/services/ledger-service.js`
- [Fabric gateway](https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/fabric/gateway-manager.js): `middleware/src/fabric/gateway-manager.js`
- [Identity wallets](https://github.com/pat-asc/plv-blockgo/blob/main/middleware/src/fabric/wallet-manager.js): `middleware/src/fabric/wallet-manager.js`

### Fabric Network

- [Grade chaincode](https://github.com/pat-asc/plv-blockgo/blob/main/chaincode/main.go): `chaincode/main.go`
- **Fabric ledger state**
- **IPFS storage**

### Application State

- [PostgreSQL](https://github.com/pat-asc/plv-blockgo/blob/main/client-app/Models/RegistrarDbContext.cs): `client-app/Models/RegistrarDbContext.cs`

### Other components

- **Students, faculty, registrar**

## Connections

- Students, faculty, registrar → Role portals: use (evidence: `README.md`)
- Role portals → API client: request data (evidence: `frontend/src/App.js`)
- API client → Account and auth: authenticate (evidence: `README.md`)
- API client → Grade workflows: grade requests (evidence: `README.md`)
- API client → Enrollment and sectioning: manage enrollment
- Account and auth → Enrollment and sectioning: assign students (evidence: `client-app/Controllers/AuthController.cs`)
- Account and auth → Account provisioning: provision accounts (evidence: `client-app/Controllers/AuthController.cs`)
- Grade workflows → PostgreSQL: read and write (evidence: `README.md`)
- Enrollment and sectioning → PostgreSQL: read and write (evidence: `client-app/Services/EnrollmentSectioningService.cs`)
- Curriculum management → Blockchain adapter: record audit (evidence: `client-app/Controllers/CurriculumsController.cs`)
- Grade workflows → Blockchain adapter: submit and query (evidence: `client-app/Controllers/GradeController.cs`)
- Bulk grade upload → Blockchain adapter: submit grades (evidence: `client-app/Controllers/BulkUploadController.cs`)
- Student grade access → Blockchain adapter: query grades (evidence: `client-app/Controllers/StudentController.cs`)
- Grade workflows → Audit events: record events
- Grade workflows → Chat and notifications: notify changes (evidence: `client-app/Controllers/GradeController.cs`)
- Blockchain adapter → Middleware gateway: send ledger requests (evidence: `README.md`)
- Middleware gateway → Middleware auth: route auth
- Middleware gateway → Ledger service: route ledger
- Middleware auth → PostgreSQL: query accounts (evidence: `middleware/src/services/auth-service.js`)
- Ledger service → Fabric gateway: invoke transactions
- Fabric gateway → Identity wallets: load identities (evidence: `middleware/src/fabric/gateway-manager.js`)
- Fabric gateway → Grade chaincode: submit and query (evidence: `README.md`)
- Grade chaincode → Fabric ledger state: update ledger (evidence: `README.md`)
- Grade workflows → IPFS storage: store grading files (evidence: `README.md`)
