# greidal/picdrop architecture

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

- Interactive diagram: https://gitdiagram.com/greidal/picdrop
- Repository: https://github.com/greidal/picdrop

## Overview

PicDrop is a PHP/MySQL event-photo gallery with organizer accounts and event management, guest photo uploads, and event participation features. Organizers create and configure events, then share a guest link or QR code; guests upload photos and can check in drinks. Organizers and guests browse galleries, slideshows, leaderboards, and (when enabled) estimated BAC stories. The graph preserves these documented product branches and shows the sampled upload and drink-processing responsibilities. Some page-to-page and unsampled subsystem wiring is documented only at the capability level, so those relationships are omitted rather than inferred.

Main entry points: [`src/lib/uploads.php`](https://github.com/greidal/picdrop/blob/main/src/lib/uploads.php) (Upload Processing), [`src/lib/drinks.php`](https://github.com/greidal/picdrop/blob/main/src/lib/drinks.php) (Drink & BAC Logic), [`src/index.php`](https://github.com/greidal/picdrop/blob/main/src/index.php) (Guest Upload Page), [`src/lib/auth.php`](https://github.com/greidal/picdrop/blob/main/src/lib/auth.php) (Authentication & Access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts &amp; Events"]
  node_dashboard["Event Dashboard<br/>[admin.php]"]
  node_event_settings["Event Settings<br/>[manage_event.php]"]
  node_account_flow["Account Access<br/>[account.php]"]
  node_auth["Authentication &amp; Access<br/>[auth.php]"]
end

subgraph group_photos["Photo Gallery"]
  node_guest_upload_page["Guest Upload Page<br/>[index.php]"]
  node_upload_processing["Upload Processing<br/>[uploads.php]"]
  node_image_variants["Image Variants<br/>[images.php]"]
  node_gallery["Gallery<br/>[gallery.php]"]
  node_image_delivery["Image Delivery<br/>[image.php]"]
  node_slideshow["Live Slideshow<br/>[slideshow.php]"]
end

subgraph group_participation["Guest Participation"]
  node_drink_api["Drink Check-in API<br/>[drink_api.php]"]
  node_drink_domain["Drink &amp; BAC Logic<br/>[drinks.php]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.php]"]
  node_bac_story["BAC Story<br/>[pegel.php]"]
  node_guest_identity["Guest Identity UI<br/>[guest_nav.php]"]
end

subgraph group_platform["Shared Services"]
  node_database[("MySQL Database<br/>[db.php]")]
  node_metadata["Location Metadata Removal<br/>[metadata.php]"]
  node_mail["Email Notifications<br/>[mail.php]"]
  node_migrations["Schema Migrations<br/>[migrations.php]"]
end

node_organizer(("Organizer"))
node_guest(("Event Guest"))
node_smtp{{"SMTP Mail Server"}}

node_organizer -->|"opens dashboard"| node_dashboard
node_organizer -->|"configures event"| node_event_settings
node_guest -->|"uploads photos"| node_guest_upload_page
node_guest_upload_page -->|"processes uploads"| node_upload_processing
node_upload_processing -->|"creates variants"| node_image_variants
node_upload_processing -->|"strips location data"| node_metadata
node_guest_upload_page -->|"uses drink logic"| node_drink_domain
node_guest_upload_page -->|"uses guest identity"| node_guest_identity
node_guest -->|"checks in drinks"| node_drink_api
node_drink_api -->|"dispatches actions"| node_drink_domain
node_drink_api -->|"accepts photo uploads"| node_upload_processing
node_drink_domain -->|"supplies rankings"| node_leaderboard
node_drink_domain -->|"supplies BAC estimates"| node_bac_story
node_organizer -->|"views event photos"| node_gallery
node_gallery -->|"uses image variants"| node_image_variants
node_image_delivery -->|"generates variants"| node_image_variants
node_guest -->|"views live slideshow"| node_slideshow
node_organizer -->|"registers or signs in"| node_account_flow
node_account_flow -->|"uses access functions"| node_auth
node_dashboard -->|"checks access"| node_auth
node_event_settings -->|"checks access"| node_auth
node_event_settings -->|"sends event mail"| node_mail
node_mail -->|"sends messages"| node_smtp
node_auth -->|"queries access data"| node_database
node_upload_processing -->|"stores upload records"| node_database
node_drink_domain -->|"reads and writes check-ins"| node_database
node_migrations -->|"updates schema"| node_database

click node_dashboard "https://github.com/greidal/picdrop/blob/main/src/admin.php"
click node_event_settings "https://github.com/greidal/picdrop/blob/main/src/manage_event.php"
click node_account_flow "https://github.com/greidal/picdrop/blob/main/src/lib/account.php"
click node_auth "https://github.com/greidal/picdrop/blob/main/src/lib/auth.php"
click node_guest_upload_page "https://github.com/greidal/picdrop/blob/main/src/index.php"
click node_upload_processing "https://github.com/greidal/picdrop/blob/main/src/lib/uploads.php"
click node_image_variants "https://github.com/greidal/picdrop/blob/main/src/lib/images.php"
click node_gallery "https://github.com/greidal/picdrop/blob/main/src/gallery.php"
click node_image_delivery "https://github.com/greidal/picdrop/blob/main/src/image.php"
click node_slideshow "https://github.com/greidal/picdrop/blob/main/src/slideshow.php"
click node_drink_api "https://github.com/greidal/picdrop/blob/main/src/drink_api.php"
click node_drink_domain "https://github.com/greidal/picdrop/blob/main/src/lib/drinks.php"
click node_leaderboard "https://github.com/greidal/picdrop/blob/main/src/leaderboard.php"
click node_bac_story "https://github.com/greidal/picdrop/blob/main/src/pegel.php"
click node_guest_identity "https://github.com/greidal/picdrop/blob/main/src/lib/guest_nav.php"
click node_database "https://github.com/greidal/picdrop/blob/main/src/lib/db.php"
click node_metadata "https://github.com/greidal/picdrop/blob/main/src/lib/metadata.php"
click node_mail "https://github.com/greidal/picdrop/blob/main/src/lib/mail.php"
click node_migrations "https://github.com/greidal/picdrop/blob/main/src/lib/migrations.php"

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_dashboard,node_event_settings,node_account_flow,node_auth toneBlue
class node_guest_upload_page,node_upload_processing,node_image_variants,node_gallery,node_image_delivery,node_slideshow toneAmber
class node_drink_api,node_drink_domain,node_leaderboard,node_bac_story,node_guest_identity,node_smtp toneMint
class node_database,node_metadata,node_mail,node_migrations toneRose
class node_organizer,node_guest toneIndigo
```

## Components

### Accounts & Events

- [Event Dashboard](https://github.com/greidal/picdrop/blob/main/src/admin.php): `src/admin.php`
- [Event Settings](https://github.com/greidal/picdrop/blob/main/src/manage_event.php): `src/manage_event.php`
- [Account Access](https://github.com/greidal/picdrop/blob/main/src/lib/account.php): `src/lib/account.php`
- [Authentication & Access](https://github.com/greidal/picdrop/blob/main/src/lib/auth.php): `src/lib/auth.php`

### Photo Gallery

- [Guest Upload Page](https://github.com/greidal/picdrop/blob/main/src/index.php): `src/index.php`
- [Upload Processing](https://github.com/greidal/picdrop/blob/main/src/lib/uploads.php): `src/lib/uploads.php`
- [Image Variants](https://github.com/greidal/picdrop/blob/main/src/lib/images.php): `src/lib/images.php`
- [Gallery](https://github.com/greidal/picdrop/blob/main/src/gallery.php): `src/gallery.php`
- [Image Delivery](https://github.com/greidal/picdrop/blob/main/src/image.php): `src/image.php`
- [Live Slideshow](https://github.com/greidal/picdrop/blob/main/src/slideshow.php): `src/slideshow.php`

### Guest Participation

- [Drink Check-in API](https://github.com/greidal/picdrop/blob/main/src/drink_api.php): `src/drink_api.php`
- [Drink & BAC Logic](https://github.com/greidal/picdrop/blob/main/src/lib/drinks.php): `src/lib/drinks.php`
- [Leaderboard](https://github.com/greidal/picdrop/blob/main/src/leaderboard.php): `src/leaderboard.php`
- [BAC Story](https://github.com/greidal/picdrop/blob/main/src/pegel.php): `src/pegel.php`
- [Guest Identity UI](https://github.com/greidal/picdrop/blob/main/src/lib/guest_nav.php): `src/lib/guest_nav.php`

### Shared Services

- [MySQL Database](https://github.com/greidal/picdrop/blob/main/src/lib/db.php): `src/lib/db.php`
- [Location Metadata Removal](https://github.com/greidal/picdrop/blob/main/src/lib/metadata.php): `src/lib/metadata.php`
- [Email Notifications](https://github.com/greidal/picdrop/blob/main/src/lib/mail.php): `src/lib/mail.php`
- [Schema Migrations](https://github.com/greidal/picdrop/blob/main/src/lib/migrations.php): `src/lib/migrations.php`

### Other components

- **Organizer**
- **Event Guest**
- **SMTP Mail Server**

## Connections

- Organizer → Event Dashboard: opens dashboard (evidence: `README.md`)
- Organizer → Event Settings: configures event (evidence: `README.md`)
- Event Guest → Guest Upload Page: uploads photos (evidence: `README.md`)
- Guest Upload Page → Upload Processing: processes uploads (evidence: `src/index.php`)
- Upload Processing → Image Variants: creates variants (evidence: `src/lib/uploads.php`)
- Upload Processing → Location Metadata Removal: strips location data (evidence: `src/lib/uploads.php`)
- Guest Upload Page → Drink & BAC Logic: uses drink logic (evidence: `src/index.php`)
- Guest Upload Page → Guest Identity UI: uses guest identity (evidence: `src/index.php`)
- Event Guest → Drink Check-in API: checks in drinks (evidence: `README.md`)
- Drink Check-in API → Drink & BAC Logic: dispatches actions (evidence: `src/drink_api.php`)
- Drink Check-in API → Upload Processing: accepts photo uploads (evidence: `src/drink_api.php`)
- Drink & BAC Logic → Leaderboard: supplies rankings (evidence: `README.md`)
- Drink & BAC Logic → BAC Story: supplies BAC estimates (evidence: `README.md`)
- Organizer → Gallery: views event photos (evidence: `README.md`)
- Gallery → Image Variants: uses image variants (evidence: `src/gallery.php`)
- Image Delivery → Image Variants: generates variants (evidence: `src/image.php`)
- Event Guest → Live Slideshow: views live slideshow (evidence: `README.md`)
- Organizer → Account Access: registers or signs in (evidence: `README.md`)
- Account Access → Authentication & Access: uses access functions (evidence: `src/lib/account.php`)
- Event Dashboard → Authentication & Access: checks access (evidence: `src/admin.php`)
- Event Settings → Authentication & Access: checks access (evidence: `src/manage_event.php`)
- Event Settings → Email Notifications: sends event mail (evidence: `src/manage_event.php`)
- Email Notifications → SMTP Mail Server: sends messages (evidence: `src/lib/mail.php`)
- Authentication & Access → MySQL Database: queries access data (evidence: `src/lib/auth.php`)
- Upload Processing → MySQL Database: stores upload records (evidence: `src/lib/uploads.php`)
- Drink & BAC Logic → MySQL Database: reads and writes check-ins (evidence: `src/lib/drinks.php`)
- Schema Migrations → MySQL Database: updates schema (evidence: `README.md`)
