# codesmith-23/copyright-detection-in-generative-ai architecture

> Architecture diagram of the GitHub repository codesmith-23/copyright-detection-in-generative-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codesmith-23/copyright-detection-in-generative-ai
- Repository: https://github.com/codesmith-23/copyright-detection-in-generative-ai

## Overview

This is a web application for detecting manipulated video and audio, protecting registered creator identities, and tracking analysis results. A user uploads media through the authenticated frontend; the video backend performs analysis, can request audio analysis and identity matching, combines findings, and records results for later review. Separate capabilities include account access, creator registration, licensing, and detailed evidence reporting. The README documents the service roles and orchestration; some frontend-to-service and audio-service internals are not shown in the excerpts, so those links are documented or left unverified rather than inferred from imports.

Main entry points: [`DeepFake/backend/app.py`](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/app.py) (Video Analysis Service), [`DeepFake/backend/identity_service.py`](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/identity_service.py) (Identity Matching), [`orchestrator.py`](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/orchestrator.py) (Service Launcher), [`Voice Deepfake/api_audio.py`](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/Voice%20Deepfake/api_audio.py) (Audio Analysis Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_detect_page["Detection Screen<br/>[page.tsx]"]
  node_detection_hook["Detection Workflow<br/>[useDetection.ts]"]
  node_detection_api["Detection API Client<br/>[api.ts]"]
  node_results["Analysis Results"]
  node_history_page["History Screen<br/>[page.tsx]"]
  node_identity_page["Creator Registration<br/>[page.tsx]"]
end

subgraph group_detection["Media Detection"]
  node_video_backend["Video Analysis Service<br/>[app.py]"]
  node_audio_api["Audio Analysis Service<br/>[api_audio.py]"]
  node_audio_inference["Audio Inference<br/>[inference.py]"]
  node_video_model_prep["Video Model Preparation<br/>[train_model.py]"]
  node_service_launcher["Service Launcher<br/>[orchestrator.py]"]
end

subgraph group_identity["Identity Protection"]
  node_identity_service["Identity Matching"]
  node_identity_store[("Protected Identities And Licenses")]
  node_face_extraction["Face Extraction<br/>[extract_faces.py]"]
end

subgraph group_accounts["Accounts And History"]
  node_analysis_store[("Analysis Records<br/>[app.py]")]
  node_account_pages["Login And Registration<br/>[page.tsx]"]
  node_auth_library["Authentication Helpers<br/>[auth.ts]"]
end

node_user(("Media User"))

node_user -->|"uploads media"| node_detect_page
node_detect_page -->|"starts analysis"| node_detection_hook
node_detection_hook -->|"requests analysis"| node_detection_api
node_detection_api -.->|"submits media"| node_video_backend
node_video_backend -->|"requests audio analysis"| node_audio_api
node_audio_api -.->|"runs inference"| node_audio_inference
node_video_backend -->|"requests identity match"| node_identity_service
node_identity_service -->|"reads identities"| node_identity_store
node_video_backend -->|"saves analysis"| node_analysis_store
node_video_backend -.->|"returns findings"| node_results
node_results -.->|"presents report"| node_user
node_history_page -.->|"retrieves history"| node_analysis_store
node_identity_page -.->|"registers identity"| node_identity_service
node_account_pages -.->|"uses authentication"| node_auth_library
node_video_backend -->|"logs violations"| node_identity_store
node_service_launcher -->|"starts service"| node_video_backend
node_service_launcher -->|"starts service"| node_audio_api
node_service_launcher -->|"starts service"| node_identity_service
node_video_model_prep -.->|"prepares model"| node_video_backend
node_face_extraction -.->|"supports face processing"| node_identity_service

click node_detect_page "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/detect/page.tsx"
click node_detection_hook "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/hooks/useDetection.ts"
click node_detection_api "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/lib/api.ts"
click node_results "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/components/DetectionResults.tsx"
click node_video_backend "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/app.py"
click node_audio_api "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/Voice%20Deepfake/api_audio.py"
click node_audio_inference "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/Voice%20Deepfake/inference.py"
click node_analysis_store "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/app.py"
click node_history_page "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/history/page.tsx"
click node_identity_page "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/creator-registration/page.tsx"
click node_identity_service "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/identity_service.py"
click node_identity_store "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/identity_service.py"
click node_account_pages "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/login/page.tsx"
click node_auth_library "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/lib/auth.ts"
click node_video_model_prep "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/train_model.py"
click node_face_extraction "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/extract_faces.py"
click node_service_launcher "https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/orchestrator.py"

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_detect_page,node_detection_hook,node_detection_api,node_results,node_history_page,node_identity_page,node_user toneBlue
class node_video_backend,node_audio_api,node_audio_inference,node_video_model_prep,node_service_launcher toneAmber
class node_identity_service,node_identity_store,node_face_extraction toneMint
class node_analysis_store,node_account_pages,node_auth_library toneRose
```

## Components

### Frontend

- [Detection Screen](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/detect/page.tsx): `DeepFake/frontend/src/app/detect/page.tsx`
- [Detection Workflow](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/hooks/useDetection.ts): `DeepFake/frontend/src/hooks/useDetection.ts`
- [Detection API Client](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/lib/api.ts): `DeepFake/frontend/src/lib/api.ts`
- [Analysis Results](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/components/DetectionResults.tsx): `DeepFake/frontend/src/components/DetectionResults.tsx`
- [History Screen](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/history/page.tsx): `DeepFake/frontend/src/app/history/page.tsx`
- [Creator Registration](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/creator-registration/page.tsx): `DeepFake/frontend/src/app/creator-registration/page.tsx`

### Media Detection

- [Video Analysis Service](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/app.py): `DeepFake/backend/app.py`
- [Audio Analysis Service](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/Voice%20Deepfake/api_audio.py): `Voice Deepfake/api_audio.py`
- [Audio Inference](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/Voice%20Deepfake/inference.py): `Voice Deepfake/inference.py`
- [Video Model Preparation](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/train_model.py): `DeepFake/backend/train_model.py`
- [Service Launcher](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/orchestrator.py): `orchestrator.py`

### Identity Protection

- [Identity Matching](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/identity_service.py): `DeepFake/backend/identity_service.py`
- [Protected Identities And Licenses](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/identity_service.py): `DeepFake/backend/identity_service.py`
- [Face Extraction](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/extract_faces.py): `DeepFake/backend/extract_faces.py`

### Accounts And History

- [Analysis Records](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/backend/app.py): `DeepFake/backend/app.py`
- [Login And Registration](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/app/login/page.tsx): `DeepFake/frontend/src/app/login/page.tsx`
- [Authentication Helpers](https://github.com/codesmith-23/copyright-detection-in-generative-ai/blob/main/DeepFake/frontend/src/lib/auth.ts): `DeepFake/frontend/src/lib/auth.ts`

### Other components

- **Media User**

## Connections

- Media User → Detection Screen: uploads media (evidence: `DeepFake/frontend/src/app/detect/page.tsx`)
- Detection Screen → Detection Workflow: starts analysis (evidence: `DeepFake/frontend/src/app/detect/page.tsx`)
- Detection Workflow → Detection API Client: requests analysis (evidence: `DeepFake/frontend/src/hooks/useDetection.ts`)
- Detection API Client → Video Analysis Service: submits media (evidence: `README.md`)
- Video Analysis Service → Audio Analysis Service: requests audio analysis (evidence: `DeepFake/backend/app.py`)
- Audio Analysis Service → Audio Inference: runs inference (evidence: `README.md`)
- Video Analysis Service → Identity Matching: requests identity match (evidence: `DeepFake/backend/app.py`)
- Identity Matching → Protected Identities And Licenses: reads identities (evidence: `DeepFake/backend/identity_service.py`)
- Video Analysis Service → Analysis Records: saves analysis (evidence: `DeepFake/backend/app.py`)
- Video Analysis Service → Analysis Results: returns findings (evidence: `README.md`)
- Analysis Results → Media User: presents report (evidence: `README.md`)
- History Screen → Analysis Records: retrieves history (evidence: `README.md`)
- Creator Registration → Identity Matching: registers identity (evidence: `README.md`)
- Login And Registration → Authentication Helpers: uses authentication
- Video Analysis Service → Protected Identities And Licenses: logs violations (evidence: `DeepFake/backend/app.py`)
- Service Launcher → Video Analysis Service: starts service (evidence: `README.md`)
- Service Launcher → Audio Analysis Service: starts service (evidence: `README.md`)
- Service Launcher → Identity Matching: starts service (evidence: `README.md`)
- Video Model Preparation → Video Analysis Service: prepares model
- Face Extraction → Identity Matching: supports face processing
