# srikanth200217/forensic-evidence-management architecture

> Architecture diagram of the GitHub repository srikanth200217/forensic-evidence-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srikanth200217/forensic-evidence-management
- Repository: https://github.com/srikanth200217/forensic-evidence-management

## Overview

##### Project type and purpose
- This is a domain-specific full-stack system for forensic evidence management, leveraging blockchain to guarantee data integrity and non-repudiation of evidence.
- Its primary goal is to secure, track, and manage digital and physical evidence across its entire lifecycle, from collection through analysis to presentation in court.

##### (minimal) file structure
- At present, we only see a README, but we can infer key components:
- A blockchain layer (smart contracts, ledger nodes)
- An off-chain storage layer for large evidence files
- A backend/API service to mediate between clients and the blockchain
- A frontend/user interface for investigators, lab technicians, auditors, and legal staff
- Authentication/authorization and audit‐logging subsystems

##### README for additional insights
- The README emphasizes immutability and decentralized trust via blockchain.
- We know the system will record evidence metadata (e.g., hash, timestamp, custody chain) on-chain and store bulk data off-chain.

a. Main Components
1. User Clients – Browser or mobile interface for different roles (Investigator, Lab Tech, Auditor)
2. API Gateway / Backend Service – REST or GraphQL endpoints, business logic
3. Blockchain Network – Smart contracts, consensus nodes, ledger
4. Off-Chain Storage – IPFS, S3, or other blob storage for actual evidence files
5. Identity & Access Management – OAuth2/OpenID Connect or custom IAM
6. Audit & Monitoring – Logging service, analytics dashboard
7. External Integrations – Court systems, law-enforcement databases

b. Relationships & Interactions
- Users authenticate via IAM → receive tokens → call API
- For new evidence: Frontend uploads file to Off-Chain Storage → computes hash → calls Backend
- Backend invokes Smart Contract → writes hash + metadata to Blockchain
- For verification: Frontend requests record → Backend reads from blockchain → retrieves metadata and compares stored hash with off-chain file hash
- Audit logs capture every transaction and API call for compliance

c. Architectural Patterns & Principles
- Layered Architecture (Presentation → API/Service → Blockchain/Storage)
- CQRS for read vs. write paths (writes go on-chain, reads can be served from a read-optimized cache)
- Use of smart contracts as “trust anchor”
- Separation of concerns: evidence data vs. metadata

d. Key Technologies & Frameworks
- Blockchain: Ethereum/Hyperledger Fabric, Solidity chaincode
- Backend: Node.js/Express or Python/Flask
- Frontend: React/Vue/Angular
- Storage: IPFS or AWS S3
- Auth: Keycloak/Auth0 or custom JWT service
- Logging: ELK stack or Prometheus/Grafana

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Documentation
    Docs["Project Documentation (README)"]:::docs

    %% Users
    subgraph "User Roles" 
        Investigator["Investigator"]:::frontend
        LabTech["Lab Technician"]:::frontend
        Auditor["Auditor"]:::frontend
        Legal["Legal Staff"]:::frontend
    end

    %% Frontend
    UI["Web/Mobile App"]:::frontend

    %% Backend Services
    subgraph "Backend Services"
        APIGateway["API Gateway / Backend Service"]:::backend
        EvidenceService["Evidence Service"]:::backend
        UserService["User / Auth Service"]:::backend
        AuditService["Audit & Monitoring Service"]:::backend
    end

    %% Blockchain & Storage
    Blockchain["Blockchain Network (Smart Contracts & Nodes)"]:::blockchain
    Storage["Off-Chain Storage (IPFS/S3)"]:::storage

    %% Identity & Logging
    IAM["Identity & Access Management"]:::auth
    Logging["Logging & Monitoring"]:::monitor

    %% External Systems
    subgraph "External Integrations"
        Court["Court Systems"]:::external
        LawDB["Law-Enforcement DB"]:::external
    end

    %% Flows
    Docs --> UI
    Investigator --> UI
    LabTech --> UI
    Auditor --> UI
    Legal --> UI

    UI -->|HTTPS / REST| APIGateway
    APIGateway -->|Route to Service| EvidenceService
    APIGateway -->|Route to Service| UserService
    APIGateway -->|Route to Service| AuditService

    EvidenceService -->|Store File| Storage
    EvidenceService -->|Record Hash & Metadata| Blockchain
    EvidenceService -->|Verification Query| Blockchain
    Blockchain -->|Return Metadata| EvidenceService

    UserService -->|Auth Requests| IAM
    AuditService -->|Log Events| Logging

    APIGateway -->|Sync & Notify| Court
    APIGateway -->|Sync & Notify| LawDB

    %% Click Events
    click Docs "https://github.com/srikanth200217/forensic-evidence-management/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D6EFFF,stroke:#0288D1,color:#000
    classDef backend fill:#C8E6C9,stroke:#2E7D32,color:#000
    classDef blockchain fill:#FFE0B2,stroke:#EF6C00,color:#000
    classDef storage fill:#E0E0E0,stroke:#616161,color:#000
    classDef auth fill:#F3E5F5,stroke:#6A1B9A,color:#000
    classDef monitor fill:#FFF9C4,stroke:#FBC02D,color:#000
    classDef external fill:#FFCDD2,stroke:#C62828,color:#000
    classDef docs fill:#E1F5FE,stroke:#0277BD,color:#000
```
