# manvendra8511/stellar-cert-project architecture

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

- Interactive diagram: https://gitdiagram.com/manvendra8511/stellar-cert-project
- Repository: https://github.com/manvendra8511/stellar-cert-project

## Overview

This repository implements a certificate registry API backed by a Soroban smart contract. A client submits certificate details or requests a lookup/verification; the API validates the request, the controller delegates to the Soroban service, and the response reflects the contract operation. The contract stores certificates persistently by student address. Health and readiness checks are separate API capabilities. The source excerpts show the backend and contract, but no README or frontend workflow; links to the external network are based on the service’s RPC calls.

Main entry points: [`cert-registry-backend/src/app.js`](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/app.js) (Express application), [`cert-registry-backend/src/controllers/certificates.controller.js`](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js) (Certificate controller), [`cert-registry-backend/src/routes/health.routes.js`](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/routes/health.routes.js) (Health routes), [`cert-registry-backend/src/services/soroban.service.js`](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/services/soroban.service.js) (Soroban service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and routing"]
  node_app["Express application<br/>[app.js]"]
  node_cert_routes["Certificate routes"]
end

subgraph group_cert["Certificate operations"]
  node_controller["Certificate controller"]
  node_issue["Issue certificate"]
  node_lookup["Get certificate"]
  node_verify["Verify certificate"]
end

subgraph group_stellar["Stellar integration"]
  node_soroban_service["Soroban service<br/>[soroban.service.js]"]
  node_stellar_config["Stellar configuration<br/>[stellar.js]"]
  node_rpc["Soroban RPC"]
  node_contract["Certificate contract<br/>[lib.rs]"]
  node_persistent_store[("Persistent storage<br/>[lib.rs]")]
end

subgraph group_ops["Health and operations"]
  node_health_routes["Health routes<br/>[health.routes.js]"]
  node_error_handlers["Error handlers<br/>[errorHandler.js]"]
  node_logger["Logger<br/>[logger.js]"]
  node_entry["Backend entry<br/>[index.js]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"routes requests"| node_cert_routes
node_app -->|"routes requests"| node_health_routes
node_app -->|"installs handlers"| node_error_handlers
node_app -->|"logs requests"| node_logger
node_cert_routes -->|"dispatches endpoints"| node_controller
node_controller -->|"implements issue"| node_issue
node_controller -->|"implements lookup"| node_lookup
node_controller -->|"implements verification"| node_verify
node_controller -->|"calls operations"| node_soroban_service
node_soroban_service -->|"uses connection config"| node_stellar_config
node_soroban_service -->|"simulates and submits"| node_rpc
node_rpc -.->|"executes contract calls"| node_contract
node_contract -->|"reads and writes"| node_persistent_store
node_health_routes -->|"uses RPC client"| node_stellar_config
node_health_routes -->|"checks readiness"| node_rpc
node_health_routes -->|"logs failures"| node_logger
node_error_handlers -->|"logs errors"| node_logger
node_entry -->|"starts server"| node_app
node_entry -->|"loads configuration"| node_stellar_config

click node_app "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/app.js"
click node_cert_routes "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/routes/certificates.routes.js"
click node_health_routes "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/routes/health.routes.js"
click node_controller "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js"
click node_issue "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js"
click node_lookup "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js"
click node_verify "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js"
click node_soroban_service "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/services/soroban.service.js"
click node_stellar_config "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/config/stellar.js"
click node_contract "https://github.com/manvendra8511/stellar-cert-project/blob/main/stellar-cert/src/lib.rs"
click node_persistent_store "https://github.com/manvendra8511/stellar-cert-project/blob/main/stellar-cert/src/lib.rs"
click node_error_handlers "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/middleware/errorHandler.js"
click node_logger "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/config/logger.js"
click node_entry "https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/index.js"

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_app,node_cert_routes,node_client toneBlue
class node_controller,node_issue,node_lookup,node_verify toneAmber
class node_soroban_service,node_stellar_config,node_rpc,node_contract,node_persistent_store toneMint
class node_health_routes,node_error_handlers,node_logger,node_entry toneRose
```

## Components

### API and routing

- [Express application](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/app.js): `cert-registry-backend/src/app.js`
- [Certificate routes](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/routes/certificates.routes.js): `cert-registry-backend/src/routes/certificates.routes.js`

### Certificate operations

- [Certificate controller](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js): `cert-registry-backend/src/controllers/certificates.controller.js`
- [Issue certificate](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js): `cert-registry-backend/src/controllers/certificates.controller.js`
- [Get certificate](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js): `cert-registry-backend/src/controllers/certificates.controller.js`
- [Verify certificate](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/controllers/certificates.controller.js): `cert-registry-backend/src/controllers/certificates.controller.js`

### Stellar integration

- [Soroban service](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/services/soroban.service.js): `cert-registry-backend/src/services/soroban.service.js`
- [Stellar configuration](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/config/stellar.js): `cert-registry-backend/src/config/stellar.js`
- **Soroban RPC**
- [Certificate contract](https://github.com/manvendra8511/stellar-cert-project/blob/main/stellar-cert/src/lib.rs): `stellar-cert/src/lib.rs`
- [Persistent storage](https://github.com/manvendra8511/stellar-cert-project/blob/main/stellar-cert/src/lib.rs): `stellar-cert/src/lib.rs`

### Health and operations

- [Health routes](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/routes/health.routes.js): `cert-registry-backend/src/routes/health.routes.js`
- [Error handlers](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/middleware/errorHandler.js): `cert-registry-backend/src/middleware/errorHandler.js`
- [Logger](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/config/logger.js): `cert-registry-backend/src/config/logger.js`
- [Backend entry](https://github.com/manvendra8511/stellar-cert-project/blob/main/cert-registry-backend/src/index.js): `cert-registry-backend/src/index.js`

### Other components

- **API client**

## Connections

- API client → Express application: sends requests (evidence: `cert-registry-backend/src/app.js`)
- Express application → Certificate routes: routes requests (evidence: `cert-registry-backend/src/app.js`)
- Express application → Health routes: routes requests (evidence: `cert-registry-backend/src/app.js`)
- Express application → Error handlers: installs handlers (evidence: `cert-registry-backend/src/app.js`)
- Express application → Logger: logs requests (evidence: `cert-registry-backend/src/app.js`)
- Certificate routes → Certificate controller: dispatches endpoints (evidence: `cert-registry-backend/src/routes/certificates.routes.js`)
- Certificate controller → Issue certificate: implements issue (evidence: `cert-registry-backend/src/controllers/certificates.controller.js`)
- Certificate controller → Get certificate: implements lookup (evidence: `cert-registry-backend/src/controllers/certificates.controller.js`)
- Certificate controller → Verify certificate: implements verification (evidence: `cert-registry-backend/src/controllers/certificates.controller.js`)
- Certificate controller → Soroban service: calls operations (evidence: `cert-registry-backend/src/controllers/certificates.controller.js`)
- Soroban service → Stellar configuration: uses connection config (evidence: `cert-registry-backend/src/services/soroban.service.js`)
- Soroban service → Soroban RPC: simulates and submits (evidence: `cert-registry-backend/src/services/soroban.service.js`)
- Soroban RPC → Certificate contract: executes contract calls
- Certificate contract → Persistent storage: reads and writes (evidence: `stellar-cert/src/lib.rs`)
- Health routes → Stellar configuration: uses RPC client (evidence: `cert-registry-backend/src/routes/health.routes.js`)
- Health routes → Soroban RPC: checks readiness (evidence: `cert-registry-backend/src/routes/health.routes.js`)
- Health routes → Logger: logs failures (evidence: `cert-registry-backend/src/routes/health.routes.js`)
- Error handlers → Logger: logs errors (evidence: `cert-registry-backend/src/middleware/errorHandler.js`)
- Backend entry → Express application: starts server (evidence: `cert-registry-backend/src/index.js`)
- Backend entry → Stellar configuration: loads configuration (evidence: `cert-registry-backend/src/index.js`)
