# groundupworks/flying-photo-booth architecture

> Architecture diagram of the GitHub repository groundupworks/flying-photo-booth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/groundupworks/flying-photo-booth
- Repository: https://github.com/groundupworks/flying-photo-booth

## Overview

##### Project Type and Purpose
- This is a multi-module Android mobile project delivering two distinct photo-booth applications (“Flying PhotoBooth” and “PartyPhotoBooth”) plus a shared library module (“lib-photo-booth”).
- Each app module provides UI flows (Activities & Fragments), business logic (Controllers & Helpers), and app-specific resources (graphics, layouts, HTML). The shared module encapsulates core photo-booth functionality (arrangements, filters, camera & beam helpers, framework base classes).

##### File Structure
- Top-level modules:
- flying-photo-booth/ – Android app #1
- party-photo-booth/   – Android app #2
- lib-photo-booth/     – Shared Android library
- Common build files: build.gradle, settings.gradle, Gradle wrapper
- Each app has: AndroidManifest.xml, res/, src/com/groundupworks/… (Activities, Fragments, Controllers, Helpers), graphics/, html/, proguard.cfg
- Tests for party app under yksp-tests/

##### README for Additional Insights
- Describes core features: photo capture workflow, swipe-to-retake, filters/arrangements, share endpoints (Facebook, Dropbox, GCP, Android Beam)
- Mentions dependency on Android SDK and Wings (external sharing service API)

a. Main Components
- Module Layer
– FlyingPhotoBooth App
– PartyPhotoBooth App
– CoreLibrary (lib-photo-booth)
- Runtime Components (for each app)
– UI Layer: Activities & Fragments
– Controller Layer: ShareController, PhotoStripController, BaseController
– Service/Helper Layer: CameraHelper, BeamHelper, ImageHelper, StorageHelper, PreferencesHelper, KioskService (party app)
– Processing Layer: Arrangement classes, Filter classes
– Data Layer: local file storage, Gallery, SharedPreferences
– External Services: Android Beam, Facebook API, Dropbox API, Google Cloud Print, Wings backend
b. Relationships & Interactions
- FlyingPhotoBooth & PartyPhotoBooth modules both depend on CoreLibrary
- Controllers orchestrate capture (via CameraHelper), apply filters/arrangements, save to storage, and invoke sharing helpers
- KioskService (Party app) holds the app in foreground and enforces passcode protections
- yksp-tests invoke capture flows against PartyPhotoBooth module
c. Architectural Patterns & Principles
- Modularization: Shared core library for reuse and separation of concerns
- MVC-like layering: Fragments (View), Controllers (Conductor), Helpers/Filters (Model/Service)
- Dependency Injection via Application subclass (MyApplication) initializing frameworks
- Gradle multi-project build orchestrates modules and dependencies
d. Key Technologies & Frameworks
- Android SDK (Activities, Fragments, Services)
- Gradle (multi-module build)
- Android Beam, Bluetooth remote integration
- Facebook SDK, Dropbox SDK, Google Cloud Print API
- Java-based image processing within lib-photo-booth

##### Essential Details to Capture
- Module dependencies: both apps → lib-photo-booth
- Core workflow:
1) User triggers capture (UI)
2) Controller uses CameraHelper → returns bitmaps
3) Controller applies arrangement/filter via lib module
4) StorageHelper saves strip, updates Gallery
5) ShareController invokes appropriate sharing helper (Facebook, Dropbox, GCP, Beam)
6) Background retry scheduler if share fails
- Party app kiosk extension: KioskService & passcode fragments controlling app foreground

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Modules
    subgraph "FlyingPhotoBooth Module"
        direction TB
        LA["LaunchActivity"]:::frontend
        MA["MyApplication"]:::service
        CF["CaptureFragment"]:::frontend
        SF["ShareFragment"]:::frontend
        EF["ErrorDialogFragment"]:::frontend
        SC["ShareController"]:::controller
        LA --> MA
        MA --> CF
        CF --> SC
        SF --> SC
        SC --> CH
        SC --> IH
        SC --> SH
        SC --> BH
    end

    subgraph "PartyPhotoBooth Module"
        direction TB
        PSC["PhotoStripController"]:::controller
        PHH["PreferencesHelper"]:::service
        KS["KioskService"]:::service
        PSC --> CH
        PSC --> IH
        PSC --> SH
        PHH --> SP
        KS --> SP
        PSC --> KS
    end

    subgraph "CoreLibrary (lib-photo-booth)"
        direction TB
        subgraph "Framework"
            direction TB
            BFA["BaseFragmentActivity"]:::service
            CBF["ControllerBackedFragment"]:::service
            BC["BaseController"]:::controller
        end
        subgraph "Helpers"
            direction TB
            CH["CameraHelper"]:::processing
            BH["BeamHelper"]:::processing
            IH["ImageHelper"]:::processing
            SH["StorageHelper"]:::processing
        end
        subgraph "Arrangements"
            direction TB
            BA["BaseArrangement"]:::processing
            BoxA["BoxArrangement"]:::processing
            HorA["HorizontalArrangement"]:::processing
            VerA["VerticalArrangement"]:::processing
            BC --> BA
            BA --> BoxA
            BA --> HorA
            BA --> VerA
        end
        subgraph "Filters"
            direction TB
            Sepia["SepiaFilter"]:::processing
            BW["BlackAndWhiteFilter"]:::processing
            Line["LineArtFilter"]:::processing
        end
        CV["CenteredPreview"]:::service
    end

    %% Data Stores
    SP["SharedPreferences"]:::datastore
    FS["File System"]:::datastore
    GAL["Gallery"]:::datastore

    %% External Services
    AB["Android Beam"]:::external
    FB["Facebook API"]:::external
    DB["Dropbox API"]:::external
    GCP["Google Cloud Print"]:::external
    WG["Wings Backend"]:::external

    %% Cross-module Dependencies
    LA -.-> BC
    PSC -.-> BC

    %% Data Flow Arrows
    CH --> IH
    IH --> SH
    SH --> FS
    SH --> GAL
    SC --> FB
    SC --> DB
    SC --> GCP
    SC --> AB
    SC --> WG
    PSC --> FB
    PSC --> DB
    PSC --> GCP
    PSC --> AB
    PSC --> WG

    %% Tests
    subgraph "YKSP Tests"
        direction TB
        CT["CaptureModeAutomaticTest.py"]:::service
        CS["CaptureModeSelfServeTest.py"]:::service
        CT --> PSC
        CS --> PSC
    end

    %% Click Events
    click LA "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/LaunchActivity.java"
    click MA "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/MyApplication.java"
    click CF "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/fragments/CaptureFragment.java"
    click SF "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/fragments/ShareFragment.java"
    click EF "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/fragments/ErrorDialogFragment.java"
    click SC "https://github.com/groundupworks/flying-photo-booth/blob/master/flying-photo-booth/src/com/groundupworks/flyingphotobooth/controllers/ShareController.java"
    click PSC "https://github.com/groundupworks/flying-photo-booth/blob/master/party-photo-booth/src/com/groundupworks/partyphotobooth/controllers/PhotoStripController.java"
    click PHH "https://github.com/groundupworks/flying-photo-booth/blob/master/party-photo-booth/src/com/groundupworks/partyphotobooth/helpers/PreferencesHelper.java"
    click KS "https://github.com/groundupworks/flying-photo-booth/blob/master/party-photo-booth/src/com/groundupworks/partyphotobooth/kiosk/KioskService.java"
    click BC "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/framework/BaseController.java"
    click CH "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/helpers/CameraHelper.java"
    click BH "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/helpers/BeamHelper.java"
    click IH "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/helpers/ImageHelper.java"
    click SH "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/helpers/StorageHelper.java"
    click BFA "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/framework/BaseFragmentActivity.java"
    click CBF "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/framework/ControllerBackedFragment.java"
    click CV "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/views/CenteredPreview.java"
    click BA "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/arrangements/BaseArrangement.java"
    click BoxA "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/arrangements/BoxArrangement.java"
    click HorA "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/arrangements/HorizontalArrangement.java"
    click VerA "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/arrangements/VerticalArrangement.java"
    click Sepia "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/filters/SepiaFilter.java"
    click BW "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/filters/BlackAndWhiteFilter.java"
    click Line "https://github.com/groundupworks/flying-photo-booth/blob/master/lib-photo-booth/src/com/groundupworks/lib/photobooth/filters/LineArtFilter.java"
    click CT "https://github.com/groundupworks/flying-photo-booth/blob/master/party-photo-booth/yksp-tests/scripts/CaptureModeAutomaticTest.py"
    click CS "https://github.com/groundupworks/flying-photo-booth/blob/master/party-photo-booth/yksp-tests/scripts/CaptureModeSelfServeTest.py"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000
    classDef controller fill:#90EE90,stroke:#000
    classDef processing fill:#FFA500,stroke:#000
    classDef datastore fill:#D3D3D3,stroke:#000
    classDef external fill:#DDA0DD,stroke:#000
    classDef service fill:#98FB98,stroke:#000
```
