# ollehuss/softsec-project-group4 architecture

> Architecture diagram of the GitHub repository ollehuss/softsec-project-group4, 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/ollehuss/softsec-project-group4
- Repository: https://github.com/ollehuss/softsec-project-group4

## Overview

Tatou is a PDF-watermarking web platform, with a companion command-line toolkit. In the web workflow, a user submits PDF and watermark details; the server handles API requests and database operations, while the watermarking registry dispatches to a selected method. Users can also inspect PDFs and recover watermarks through the toolkit. The graph includes each indexed core module and the documented website/API and CLI capabilities. Some server routes and static-page wiring were not shown, so those links are omitted or marked unverified.

Main entry points: [`server/src/watermarking_utils.py`](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_utils.py) (Registry and PDF tools), [`server/src/watermarking_method.py`](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_method.py) (Watermark method contract), [`server/src/server.py`](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/server.py) (Web API), [`server/src/static`](https://github.com/ollehuss/softsec-project-group4/tree/main/server/src/static) (Web pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web platform"]
  node_webui["Web pages"]
  node_api["Web API<br/>[server.py]"]
end

subgraph group_toolkit["Watermark toolkit"]
  node_cli["CLI commands"]
  node_utils["Registry and PDF tools"]
end

subgraph group_methods["Watermark methods"]
  node_contract["Watermark method contract"]
  node_aftereof["Append-after-EOF<br/>[add_after_eof.py]"]
  node_metadata["Metadata watermark"]
  node_bashbridge["Bash bridge watermark"]
  node_visible["Visible repeat watermark"]
  node_hidden["Hidden-object watermark"]
end

subgraph group_state["Persistent state"]
  node_db[("Application database<br/>[tatou.sql]")]
end

node_user(("User"))

node_user -->|"uses"| node_webui
node_webui -.->|"calls API"| node_api
node_api -->|"queries"| node_db
node_api -->|"uses registry"| node_utils
node_cli -->|"calls tools"| node_utils
node_utils -->|"dispatches methods"| node_contract
node_utils -->|"registers method"| node_aftereof
node_utils -->|"registers method"| node_metadata
node_utils -->|"registers method"| node_bashbridge
node_utils -->|"registers method"| node_visible
node_utils -->|"registers method"| node_hidden
node_aftereof -->|"implements"| node_contract
node_metadata -->|"implements"| node_contract
node_bashbridge -->|"implements"| node_contract
node_visible -->|"implements"| node_contract
node_hidden -->|"implements"| node_contract

click node_webui "https://github.com/ollehuss/softsec-project-group4/tree/main/server/src/static"
click node_api "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/server.py"
click node_db "https://github.com/ollehuss/softsec-project-group4/blob/main/db/tatou.sql"
click node_cli "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_cli.py"
click node_utils "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_utils.py"
click node_contract "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_method.py"
click node_aftereof "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/add_after_eof.py"
click node_metadata "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/olles_metadata_watermark.py"
click node_bashbridge "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/unsafe_bash_bridge_append_eof.py"
click node_visible "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/visible_repeat_watermark.py"
click node_hidden "https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_joshua.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_user toneBlue
class node_cli,node_utils toneAmber
class node_contract,node_aftereof,node_metadata,node_bashbridge,node_visible,node_hidden toneMint
class node_db toneRose
```

## Components

### Web platform

- [Web pages](https://github.com/ollehuss/softsec-project-group4/tree/main/server/src/static): `server/src/static`
- [Web API](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/server.py): `server/src/server.py`

### Watermark toolkit

- [CLI commands](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_cli.py): `server/src/watermarking_cli.py`
- [Registry and PDF tools](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_utils.py): `server/src/watermarking_utils.py`

### Watermark methods

- [Watermark method contract](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_method.py): `server/src/watermarking_method.py`
- [Append-after-EOF](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/add_after_eof.py): `server/src/add_after_eof.py`
- [Metadata watermark](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/olles_metadata_watermark.py): `server/src/olles_metadata_watermark.py`
- [Bash bridge watermark](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/unsafe_bash_bridge_append_eof.py): `server/src/unsafe_bash_bridge_append_eof.py`
- [Visible repeat watermark](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/visible_repeat_watermark.py): `server/src/visible_repeat_watermark.py`
- [Hidden-object watermark](https://github.com/ollehuss/softsec-project-group4/blob/main/server/src/watermarking_joshua.py): `server/src/watermarking_joshua.py`

### Persistent state

- [Application database](https://github.com/ollehuss/softsec-project-group4/blob/main/db/tatou.sql): `db/tatou.sql`

### Other components

- **User**

## Connections

- User → Web pages: uses (evidence: `README.md`)
- Web pages → Web API: calls API
- Web API → Application database: queries (evidence: `server/src/server.py`)
- Web API → Registry and PDF tools: uses registry (evidence: `server/src/server.py`)
- CLI commands → Registry and PDF tools: calls tools (evidence: `server/src/watermarking_cli.py`)
- Registry and PDF tools → Watermark method contract: dispatches methods (evidence: `server/src/watermarking_utils.py`)
- Registry and PDF tools → Append-after-EOF: registers method (evidence: `server/src/watermarking_utils.py`)
- Registry and PDF tools → Metadata watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Registry and PDF tools → Bash bridge watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Registry and PDF tools → Visible repeat watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Registry and PDF tools → Hidden-object watermark: registers method (evidence: `server/src/watermarking_utils.py`)
- Append-after-EOF → Watermark method contract: implements (evidence: `server/src/add_after_eof.py`)
- Metadata watermark → Watermark method contract: implements (evidence: `server/src/olles_metadata_watermark.py`)
- Bash bridge watermark → Watermark method contract: implements (evidence: `server/src/unsafe_bash_bridge_append_eof.py`)
- Visible repeat watermark → Watermark method contract: implements (evidence: `server/src/visible_repeat_watermark.py`)
- Hidden-object watermark → Watermark method contract: implements (evidence: `server/src/watermarking_joshua.py`)
