# edith-farzana/prj_47-dv-evidence-preservation architecture

> Architecture diagram of the GitHub repository edith-farzana/prj_47-dv-evidence-preservation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edith-farzana/prj_47-dv-evidence-preservation
- Repository: https://github.com/edith-farzana/prj_47-dv-evidence-preservation

## Overview

Secure Evidence is a discreet Flutter app for capturing and preserving evidence for survivors of domestic violence. The user opens a calculator decoy, unlocks with a PIN and sequence, captures evidence in-app, then stores it encrypted and can review, verify, audit, or export it. The README describes implemented capabilities alongside planned or switched-off ones; paths below come from the repository tree, but Dart source was not sampled, so relationships are limited to those explicitly documented in the README.

Main entry points: [`lib/features/home/home_page.dart`](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/home/home_page.dart) (Home and helplines), [`lib/services/storage/evidence_storage.dart`](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/storage/evidence_storage.dart) (Encrypted local store), [`lib/features/auth/presentation/pin_page.dart`](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/auth/presentation/pin_page.dart) (PIN unlock), [`lib/features/evidence/detail/integrity_page.dart`](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/detail/integrity_page.dart) (Integrity verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Discreet Access"]
  node_app["App entry<br/>[main.dart]"]
  node_calculator["Calculator decoy"]
  node_unlock["PIN unlock<br/>[pin_page.dart]"]
  node_unlock_sequence["Unlock sequence"]
  node_home["Home and helplines<br/>[home_page.dart]"]
end

subgraph group_evidence["Evidence Lifecycle"]
  node_capture["Photo and video capture"]
  node_audio["Audio capture"]
  node_vault["Evidence vault"]
  node_detail["Evidence playback"]
end

subgraph group_security["Protection and Audit"]
  node_crypto["Evidence encryption"]
  node_keys["Key management<br/>[key_manager.dart]"]
  node_secure_store["Secure key storage<br/>[secure_store.dart]"]
  node_evidence_storage[("Encrypted local store")]
  node_evidence_index[("Encrypted evidence index")]
  node_audit[("Tamper-evident activity log<br/>[audit_log.dart]")]
end

subgraph group_preservation["Verification and Export"]
  node_integrity["Integrity verification"]
  node_sync["Evidence sync<br/>[evidence_sync.dart]"]
  node_firebase[("Firebase evidence records")]
  node_activity["Activity log view"]
  node_export["Court export bundle"]
  node_export_ui["Export selection<br/>[export_page.dart]"]
end

node_user(("User"))
node_cloud[("Firebase backend")]

node_user -->|"opens"| node_app
node_app -->|"shows decoy"| node_calculator
node_calculator -->|"starts unlock"| node_unlock
node_unlock -->|"checks sequence"| node_unlock_sequence
node_unlock -->|"unlocks"| node_home
node_home -->|"starts capture"| node_capture
node_home -->|"starts capture"| node_audio
node_capture -->|"stores evidence"| node_evidence_storage
node_audio -->|"stores evidence"| node_evidence_storage
node_evidence_storage -->|"encrypts files"| node_crypto
node_keys -->|"protects master key"| node_secure_store
node_unlock -->|"unlocks master key"| node_keys
node_evidence_storage -->|"updates index"| node_evidence_index
node_home -->|"opens vault"| node_vault
node_vault -->|"opens evidence"| node_detail
node_detail -->|"requests verification"| node_integrity
node_integrity -->|"checks local records"| node_evidence_storage
node_integrity -->|"checks server records"| node_firebase
node_firebase -->|"records fingerprints"| node_cloud
node_home -->|"opens activity log"| node_activity
node_audit -->|"provides history"| node_activity
node_home -->|"starts export"| node_export_ui
node_export_ui -->|"creates bundle"| node_export
node_export -->|"selects verified items"| node_evidence_storage
node_export -->|"includes custody history"| node_audit
node_sync -->|"sends fingerprints"| node_firebase
node_sync -.->|"backs up encrypted files"| node_cloud

click node_app "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/main.dart"
click node_calculator "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/calculator/presentation/calculator_page.dart"
click node_unlock "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/auth/presentation/pin_page.dart"
click node_unlock_sequence "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/auth/domain/unlock_sequence.dart"
click node_home "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/home/home_page.dart"
click node_capture "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/capture/in_app_camera_page.dart"
click node_audio "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/capture/audio_capture_page.dart"
click node_vault "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/vault/evidence_vault_page.dart"
click node_detail "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/detail/evidence_detail_page.dart"
click node_crypto "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/crypto_service.dart"
click node_keys "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/key_manager.dart"
click node_secure_store "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/secure_store.dart"
click node_evidence_storage "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/storage/evidence_storage.dart"
click node_evidence_index "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/storage/evidence_index.dart"
click node_audit "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/audit/audit_log.dart"
click node_integrity "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/detail/integrity_page.dart"
click node_sync "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/sync/evidence_sync.dart"
click node_firebase "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/sync/firebase_evidence_client.dart"
click node_activity "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/audit/activity_log_page.dart"
click node_export "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/export/court_exporter.dart"
click node_export_ui "https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/export/export_page.dart"

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_calculator,node_unlock,node_unlock_sequence,node_home,node_user toneBlue
class node_capture,node_audio,node_vault,node_detail,node_cloud toneAmber
class node_crypto,node_keys,node_secure_store,node_evidence_storage,node_evidence_index,node_audit toneMint
class node_integrity,node_sync,node_firebase,node_activity,node_export,node_export_ui toneRose
```

## Components

### Discreet Access

- [App entry](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/main.dart): `lib/main.dart`
- [Calculator decoy](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/calculator/presentation/calculator_page.dart): `lib/features/calculator/presentation/calculator_page.dart`
- [PIN unlock](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/auth/presentation/pin_page.dart): `lib/features/auth/presentation/pin_page.dart`
- [Unlock sequence](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/auth/domain/unlock_sequence.dart): `lib/features/auth/domain/unlock_sequence.dart`
- [Home and helplines](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/home/home_page.dart): `lib/features/home/home_page.dart`

### Evidence Lifecycle

- [Photo and video capture](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/capture/in_app_camera_page.dart): `lib/features/evidence/capture/in_app_camera_page.dart`
- [Audio capture](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/capture/audio_capture_page.dart): `lib/features/evidence/capture/audio_capture_page.dart`
- [Evidence vault](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/vault/evidence_vault_page.dart): `lib/features/vault/evidence_vault_page.dart`
- [Evidence playback](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/detail/evidence_detail_page.dart): `lib/features/evidence/detail/evidence_detail_page.dart`

### Protection and Audit

- [Evidence encryption](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/crypto_service.dart): `lib/services/crypto/crypto_service.dart`
- [Key management](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/key_manager.dart): `lib/services/crypto/key_manager.dart`
- [Secure key storage](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/crypto/secure_store.dart): `lib/services/crypto/secure_store.dart`
- [Encrypted local store](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/storage/evidence_storage.dart): `lib/services/storage/evidence_storage.dart`
- [Encrypted evidence index](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/storage/evidence_index.dart): `lib/services/storage/evidence_index.dart`
- [Tamper-evident activity log](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/audit/audit_log.dart): `lib/services/audit/audit_log.dart`

### Verification and Export

- [Integrity verification](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/evidence/detail/integrity_page.dart): `lib/features/evidence/detail/integrity_page.dart`
- [Evidence sync](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/sync/evidence_sync.dart): `lib/services/sync/evidence_sync.dart`
- [Firebase evidence records](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/sync/firebase_evidence_client.dart): `lib/services/sync/firebase_evidence_client.dart`
- [Activity log view](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/audit/activity_log_page.dart): `lib/features/audit/activity_log_page.dart`
- [Court export bundle](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/services/export/court_exporter.dart): `lib/services/export/court_exporter.dart`
- [Export selection](https://github.com/edith-farzana/prj_47-dv-evidence-preservation/blob/main/lib/features/export/export_page.dart): `lib/features/export/export_page.dart`

### Other components

- **User**
- **Firebase backend**

## Connections

- User → App entry: opens (evidence: `README.md`)
- App entry → Calculator decoy: shows decoy (evidence: `README.md`)
- Calculator decoy → PIN unlock: starts unlock (evidence: `README.md`)
- PIN unlock → Unlock sequence: checks sequence (evidence: `README.md`)
- PIN unlock → Home and helplines: unlocks (evidence: `README.md`)
- Home and helplines → Photo and video capture: starts capture (evidence: `README.md`)
- Home and helplines → Audio capture: starts capture (evidence: `README.md`)
- Photo and video capture → Encrypted local store: stores evidence (evidence: `README.md`)
- Audio capture → Encrypted local store: stores evidence (evidence: `README.md`)
- Encrypted local store → Evidence encryption: encrypts files (evidence: `README.md`)
- Key management → Secure key storage: protects master key (evidence: `README.md`)
- PIN unlock → Key management: unlocks master key (evidence: `README.md`)
- Encrypted local store → Encrypted evidence index: updates index (evidence: `README.md`)
- Home and helplines → Evidence vault: opens vault (evidence: `README.md`)
- Evidence vault → Evidence playback: opens evidence (evidence: `README.md`)
- Evidence playback → Integrity verification: requests verification (evidence: `README.md`)
- Integrity verification → Encrypted local store: checks local records (evidence: `README.md`)
- Integrity verification → Firebase evidence records: checks server records (evidence: `README.md`)
- Firebase evidence records → Firebase backend: records fingerprints (evidence: `README.md`)
- Home and helplines → Activity log view: opens activity log (evidence: `README.md`)
- Tamper-evident activity log → Activity log view: provides history (evidence: `README.md`)
- Home and helplines → Export selection: starts export (evidence: `README.md`)
- Export selection → Court export bundle: creates bundle (evidence: `README.md`)
- Court export bundle → Encrypted local store: selects verified items (evidence: `README.md`)
- Court export bundle → Tamper-evident activity log: includes custody history (evidence: `README.md`)
- Evidence sync → Firebase evidence records: sends fingerprints (evidence: `README.md`)
- Evidence sync → Firebase backend: backs up encrypted files (evidence: `README.md`)
