# newlode/jirafeau architecture

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

- Interactive diagram: https://gitdiagram.com/newlode/jirafeau
- Repository: https://github.com/newlode/jirafeau

## Overview

Jirafeau is a lightweight PHP file-sharing service: users upload files, receive download and delete links, and recipients retrieve or remove them. The documented feature set includes expiring and one-time links, passwords, previews, deduplication, optional encryption, administration, a basic API, installation, language support, themes, and a terms page. Source excerpts show browser uploads reaching script.php and shared file/link operations; the implementation of several other capabilities was not sampled, so those branches are identified from the README without speculative call relationships.

Main entry points: [`lib/functions.php`](https://github.com/newlode/jirafeau/blob/master/lib/functions.php) (File and link operations), [`index.php`](https://github.com/newlode/jirafeau/blob/master/index.php) (Upload page), [`lib/template/header.php`](https://github.com/newlode/jirafeau/blob/master/lib/template/header.php) (Page shell), [`script.php`](https://github.com/newlode/jirafeau/blob/master/script.php) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_upload["Upload flow"]
  node_upload_page["Upload page<br/>[index.php]"]
  node_browser_upload["Browser upload client<br/>[functions.js.php]"]
  node_api["HTTP API<br/>[script.php]"]
end

subgraph group_files["File and link lifecycle"]
  node_core["File and link operations<br/>[functions.php]"]
  node_upload_store[("File/link storage")]
  node_download["Download and preview<br/>[f.php]"]
end

subgraph group_operations["Site operations"]
  node_admin["Administration<br/>[admin.php]"]
  node_cleanup["Expired-file cleanup<br/>[script.php]"]
  node_installer["Setup wizard<br/>[install.php]"]
  node_configuration["Configuration"]
end

subgraph group_presentation["Presentation"]
  node_language["Language support<br/>[lang.php]"]
  node_translations["Translation catalogues"]
  node_page_shell["Page shell<br/>[header.php]"]
  node_terms["Terms page<br/>[tos.php]"]
  node_themes["Themes"]
end

node_visitor(("Uploader / recipient"))
node_command_line(("Bash upload client"))

node_visitor -->|"opens"| node_upload_page
node_upload_page -->|"loads"| node_browser_upload
node_browser_upload -->|"posts upload"| node_api
node_api -.->|"dispatches operations"| node_core
node_core -.->|"reads / writes"| node_upload_store
node_visitor -->|"opens link"| node_download
node_download -.->|"resolves file link"| node_core
node_visitor -->|"manages service"| node_admin
node_admin -.->|"manages links"| node_core
node_command_line -->|"uses API"| node_api
node_visitor -->|"configures service"| node_installer
node_installer -.->|"writes settings"| node_configuration
node_visitor -->|"views terms"| node_terms
node_upload_page -.->|"renders with"| node_page_shell
node_page_shell -->|"loads theme"| node_themes
node_page_shell -.->|"uses translations"| node_language
node_language -.->|"loads catalogue"| node_translations
node_cleanup -.->|"removes expired links"| node_core

click node_upload_page "https://github.com/newlode/jirafeau/blob/master/index.php"
click node_browser_upload "https://github.com/newlode/jirafeau/blob/master/lib/functions.js.php"
click node_api "https://github.com/newlode/jirafeau/blob/master/script.php"
click node_core "https://github.com/newlode/jirafeau/blob/master/lib/functions.php"
click node_download "https://github.com/newlode/jirafeau/blob/master/f.php"
click node_admin "https://github.com/newlode/jirafeau/blob/master/admin.php"
click node_cleanup "https://github.com/newlode/jirafeau/blob/master/script.php"
click node_installer "https://github.com/newlode/jirafeau/blob/master/install.php"
click node_configuration "https://github.com/newlode/jirafeau/blob/master/lib/config.original.php"
click node_language "https://github.com/newlode/jirafeau/blob/master/lib/lang.php"
click node_translations "https://github.com/newlode/jirafeau/tree/master/lib/locales"
click node_page_shell "https://github.com/newlode/jirafeau/blob/master/lib/template/header.php"
click node_terms "https://github.com/newlode/jirafeau/blob/master/tos.php"
click node_themes "https://github.com/newlode/jirafeau/tree/master/media"

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_upload_page,node_browser_upload,node_api,node_command_line toneBlue
class node_core,node_upload_store,node_download toneAmber
class node_admin,node_cleanup,node_installer,node_configuration toneMint
class node_language,node_translations,node_page_shell,node_terms,node_themes toneRose
class node_visitor toneIndigo
```

## Components

### Upload flow

- [Upload page](https://github.com/newlode/jirafeau/blob/master/index.php): `index.php`
- [Browser upload client](https://github.com/newlode/jirafeau/blob/master/lib/functions.js.php): `lib/functions.js.php`
- [HTTP API](https://github.com/newlode/jirafeau/blob/master/script.php): `script.php`

### File and link lifecycle

- [File and link operations](https://github.com/newlode/jirafeau/blob/master/lib/functions.php): `lib/functions.php`
- **File/link storage**
- [Download and preview](https://github.com/newlode/jirafeau/blob/master/f.php): `f.php`

### Site operations

- [Administration](https://github.com/newlode/jirafeau/blob/master/admin.php): `admin.php`
- [Expired-file cleanup](https://github.com/newlode/jirafeau/blob/master/script.php): `script.php`
- [Setup wizard](https://github.com/newlode/jirafeau/blob/master/install.php): `install.php`
- [Configuration](https://github.com/newlode/jirafeau/blob/master/lib/config.original.php): `lib/config.original.php`

### Presentation

- [Language support](https://github.com/newlode/jirafeau/blob/master/lib/lang.php): `lib/lang.php`
- [Translation catalogues](https://github.com/newlode/jirafeau/tree/master/lib/locales): `lib/locales`
- [Page shell](https://github.com/newlode/jirafeau/blob/master/lib/template/header.php): `lib/template/header.php`
- [Terms page](https://github.com/newlode/jirafeau/blob/master/tos.php): `tos.php`
- [Themes](https://github.com/newlode/jirafeau/tree/master/media): `media`

### Other components

- **Uploader / recipient**
- **Bash upload client**

## Connections

- Uploader / recipient → Upload page: opens (evidence: `README.md`)
- Upload page → Browser upload client: loads
- Browser upload client → HTTP API: posts upload (evidence: `lib/functions.js.php`)
- HTTP API → File and link operations: dispatches operations
- File and link operations → File/link storage: reads / writes
- Uploader / recipient → Download and preview: opens link (evidence: `README.md`)
- Download and preview → File and link operations: resolves file link
- Uploader / recipient → Administration: manages service (evidence: `README.md`)
- Administration → File and link operations: manages links
- Bash upload client → HTTP API: uses API (evidence: `README.md`)
- Uploader / recipient → Setup wizard: configures service (evidence: `README.md`)
- Setup wizard → Configuration: writes settings
- Uploader / recipient → Terms page: views terms
- Upload page → Page shell: renders with
- Page shell → Themes: loads theme (evidence: `lib/template/header.php`)
- Page shell → Language support: uses translations
- Language support → Translation catalogues: loads catalogue
- Expired-file cleanup → File and link operations: removes expired links
