# ashwiz03/softwaresec-grp05 architecture

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

- Interactive diagram: https://gitdiagram.com/ashwiz03/softwaresec-grp05
- Repository: https://github.com/ashwiz03/softwaresec-grp05

## Overview

Tatou is a web platform and CLI for PDF watermarking. In the web workflow, a user signs up or authenticates, manages uploaded documents, and can list documents or request watermark operations; the server validates input, accesses document records, and delegates watermark work to the method registry. The CLI independently explores PDFs or embeds and extracts secrets. The README documents the website and deployment, but sampled excerpts do not show the full upload, download, or frontend/API wiring, so those connections are left unasserted or dashed.

Main entry points: [`server/src/watermarking_utils.py`](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_utils.py) (Method registry and PDF tools), [`server/src/server.py`](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/server.py) (Flask API), [`server/src/static/index.html`](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/static/index.html) (Website pages), [`server/src/watermarking_cli.py`](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_cli.py) (PDF watermark CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webui["Website pages<br/>[index.html]"]
  node_api["Flask API<br/>[server.py]"]
  node_validation["Input validation<br/>[validation.py]"]
end

subgraph group_wm["Watermarking"]
  node_registry["Method registry and PDF tools"]
  node_method_contract["Watermark method contract"]
  node_eof_method["EOF append watermark<br/>[add_after_eof.py]"]
  node_signed_eof["Signed EOF watermark<br/>[hmac_signed_eof.py]"]
  node_text_render["Encrypted text watermark"]
  node_invisible_text["Invisible text watermark"]
  node_metadata["Metadata watermark"]
  node_bash_bridge["Bash bridge watermark"]
end

subgraph group_cli["Command line"]
  node_cli["PDF watermark CLI"]
end

subgraph group_persistence["Persistence"]
  node_records[("User and document records<br/>[tatou.sql]")]
end

node_browser(("Browser user"))

node_browser -->|"opens website"| node_webui
node_webui -.->|"uses API"| node_api
node_api -->|"validates input"| node_validation
node_api -->|"queries records"| node_records
node_api -->|"lists methods"| node_registry
node_registry -->|"uses contract"| node_method_contract
node_registry -.->|"registers method"| node_eof_method
node_registry -.->|"registers method"| node_signed_eof
node_registry -.->|"registers method"| node_text_render
node_registry -.->|"registers method"| node_invisible_text
node_registry -.->|"registers method"| node_metadata
node_registry -.->|"registers method"| node_bash_bridge
node_cli -->|"calls tools"| node_registry

click node_webui "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/static/index.html"
click node_api "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/server.py"
click node_validation "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/validation.py"
click node_records "https://github.com/ashwiz03/softwaresec-grp05/blob/main/db/tatou.sql"
click node_registry "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_utils.py"
click node_method_contract "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_method.py"
click node_eof_method "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/add_after_eof.py"
click node_signed_eof "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/hmac_signed_eof.py"
click node_text_render "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/hmac_text_render.py"
click node_invisible_text "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/invisible_text_renderer.py"
click node_metadata "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/metadata_watermark.py"
click node_bash_bridge "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/unsafe_bash_bridge_append_eof.py"
click node_cli "https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_cli.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_webui,node_api,node_validation,node_browser toneBlue
class node_registry,node_method_contract,node_eof_method,node_signed_eof,node_text_render,node_invisible_text,node_metadata,node_bash_bridge toneAmber
class node_cli toneMint
class node_records toneRose
```

## Components

### Web application

- [Website pages](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/static/index.html): `server/src/static/index.html`
- [Flask API](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/server.py): `server/src/server.py`
- [Input validation](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/validation.py): `server/src/validation.py`

### Watermarking

- [Method registry and PDF tools](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_utils.py): `server/src/watermarking_utils.py`
- [Watermark method contract](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_method.py): `server/src/watermarking_method.py`
- [EOF append watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/add_after_eof.py): `server/src/add_after_eof.py`
- [Signed EOF watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/hmac_signed_eof.py): `server/src/hmac_signed_eof.py`
- [Encrypted text watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/hmac_text_render.py): `server/src/hmac_text_render.py`
- [Invisible text watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/invisible_text_renderer.py): `server/src/invisible_text_renderer.py`
- [Metadata watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/metadata_watermark.py): `server/src/metadata_watermark.py`
- [Bash bridge watermark](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/unsafe_bash_bridge_append_eof.py): `server/src/unsafe_bash_bridge_append_eof.py`

### Command line

- [PDF watermark CLI](https://github.com/ashwiz03/softwaresec-grp05/blob/main/server/src/watermarking_cli.py): `server/src/watermarking_cli.py`

### Persistence

- [User and document records](https://github.com/ashwiz03/softwaresec-grp05/blob/main/db/tatou.sql): `db/tatou.sql`

### Other components

- **Browser user**

## Connections

- Browser user → Website pages: opens website (evidence: `README.md`)
- Website pages → Flask API: uses API
- Flask API → Input validation: validates input (evidence: `server/src/server.py`)
- Flask API → User and document records: queries records (evidence: `server/src/server.py`)
- Flask API → Method registry and PDF tools: lists methods (evidence: `server/src/server.py`)
- Method registry and PDF tools → Watermark method contract: uses contract (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → EOF append watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → Signed EOF watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → Encrypted text watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → Invisible text watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → Metadata watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Method registry and PDF tools → Bash bridge watermark: registers method
- PDF watermark CLI → Method registry and PDF tools: calls tools (evidence: `server/src/watermarking_cli.py`)
