# brunofischergermany/fuji architecture

> Architecture diagram of the GitHub repository brunofischergermany/fuji, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brunofischergermany/fuji
- Repository: https://github.com/brunofischergermany/fuji

## Overview

##### Project Type & Purpose
- Fuji is a specialized, open source forensic acquisition tool aimed at performing live, logical acquisitions on Mac computers.
- Its primary purpose is to generate a DMG file that digital forensics programs can ingest. It supports different acquisition modes (ASR, Rsync, Sysdiagnose) and includes preliminary system checks (folders, free space, network).
- The README and file structure clearly indicate that this is not a web (full-stack) application but rather a command-line/desktop tool developed in Python and packaged as a Universal2 app for macOS.

##### Key Components Identified from the File Tree
- Main Entry Point:
- fuji.py – This seems to be the central script which likely coordinates the acquisition process.
- meta.py – For managing metadata (versioning, configuration details).
- Acquisition Module:
- The “acquisition” directory contains specific implementations:
▪ abstract.py – Base class/interface for acquisition methods.
▪ asr.py – Implements acquisition using Apple’s ASR (Apple Software Restore) capabilities.
▪ rsync.py – Implements the Rsync mode for file collection.
▪ sysdiagnose.py – Likely gathers system diagnostic information.
- Checks Module:
- The “checks” directory features modules used to verify prerequisites:
▪ abstract.py – Base checks interface.
▪ folders.py, free_space.py, network.py – Check implementations that ensure folders, disk space, network conditions are adequate.
- Packaging:
- The “packaging” directory holds resources and scripts for building, code-signing, and creating the final DMG:
▪ Fuji.icns, Fuji.sh, dmgbuild.py – Used for packaging the app.
▪ The inclusion of the DMG build script and other packaging assets reflect the need to produce a distributable artifact.
- Shared Utilities:
- The “shared” folder includes common utility functions (utils.py) that may be used by both acquisition and checks modules.

##### Relationships and Interactions
- fuji.py likely acts as the orchestrator:
- It imports modules from the “acquisition” and “checks” directories to perform necessary operations.
- It may also use the “shared” utilities for cross-cutting concerns.
- The acquisition methods (ASR, Rsync, Sysdiagnose) are designed to be interchangeable or selected based on system conditions, while the Checks module ensures that the system meets preconditions for a successful forensic image.
- Packaging scripts are used post-acquisition to bundle the work into a DMG suitable for digital forensic import.
- Meta information from meta.py and configuration details (requirements.txt, PyInstaller spec via Fuji.spec) further tie the build and execution environments together.

##### Architectural Patterns & Technologies
- Modular design – Separation of concerns between acquisition, checking system prerequisites, and packaging.
- Plugin-like architecture – The use of abstract modules (in both acquisition and checks) suggests that new acquisition or check methods could be added with minimal impact on the main orchestrator.
- Technology stack:
- Python 3.10 is used for development.
- PyInstaller (via Fuji.spec) is used for packaging.
- Standard macOS executables and utilities are leveraged for disk imaging and system interactions.
- The design leverages well-defined modules, each with a single responsibility, which is a common and effective design principle for tools like these.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Level
    U["User Input/Configuration"]:::input
    F["Main Controller (fuji.py)"]:::core
    M["Metadata Management (meta.py)"]:::core
    S["Shared Utilities (utils.py)"]:::core
    E["macOS System Executables"]:::external

    U --> F
    F --> M
    F --> S

    %% Checks Subsystem
    subgraph "Checks Subsystem"
        C0["Checks Base (abstract.py)"]:::checks
        C1["Folder Check (folders.py)"]:::checks
        C2["Free Space Check (free_space.py)"]:::checks
        C3["Network Check (network.py)"]:::checks
    end

    %% Acquisition Subsystem
    subgraph "Acquisition Subsystem"
        A0["Acquisition Base (abstract.py)"]:::acquisition
        A1["ASR Acquisition (asr.py)"]:::acquisition
        A2["Rsync Acquisition (rsync.py)"]:::acquisition
        A3["Sysdiagnose Acquisition (sysdiagnose.py)"]:::acquisition
    end

    %% Packaging Subsystem
    subgraph "Packaging Subsystem"
        P1["DMG Build Script (dmgbuild.py)"]:::packaging
        P2["Packaging Resources (Fuji.icns & Fuji.sh)"]:::packaging
    end

    %% Flows
    F -->|"initiate checks"| C0
    C0 --> C1
    C0 --> C2
    C0 --> C3
    F -->|"select acquisition"| A0
    A0 --> A1
    A0 --> A2
    A0 --> A3
    A1 -->|"uses"| E
    A2 -->|"uses"| E
    A3 -->|"uses"| E
    F -->|"send acquired data"| P1
    P1 --> P2

    %% Styling Classes
    classDef core fill:#D1E8E2,stroke:#333,stroke-width:2px;
    classDef acquisition fill:#F9E79F,stroke:#A67C00,stroke-width:2px;
    classDef checks fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef packaging fill:#D5F5E3,stroke:#28B463,stroke-width:2px;
    classDef external fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef input fill:#FDEBD0,stroke:#D35400,stroke-width:2px;

    %% Click Events for Core Components
    click F "https://github.com/brunofischergermany/fuji/blob/master/fuji.py"
    click M "https://github.com/brunofischergermany/fuji/blob/master/meta.py"
    click S "https://github.com/brunofischergermany/fuji/blob/master/shared/utils.py"

    %% Click Events for Acquisition Subsystem
    click A0 "https://github.com/brunofischergermany/fuji/blob/master/acquisition/abstract.py"
    click A1 "https://github.com/brunofischergermany/fuji/blob/master/acquisition/asr.py"
    click A2 "https://github.com/brunofischergermany/fuji/blob/master/acquisition/rsync.py"
    click A3 "https://github.com/brunofischergermany/fuji/blob/master/acquisition/sysdiagnose.py"

    %% Click Events for Checks Subsystem
    click C0 "https://github.com/brunofischergermany/fuji/blob/master/checks/abstract.py"
    click C1 "https://github.com/brunofischergermany/fuji/blob/master/checks/folders.py"
    click C2 "https://github.com/brunofischergermany/fuji/blob/master/checks/free_space.py"
    click C3 "https://github.com/brunofischergermany/fuji/blob/master/checks/network.py"

    %% Click Events for Packaging Subsystem
    click P1 "https://github.com/brunofischergermany/fuji/blob/master/packaging/dmgbuild.py"
    click P2 "https://github.com/brunofischergermany/fuji/blob/master/packaging/Fuji.icns"
    click P2 "https://github.com/brunofischergermany/fuji/blob/master/packaging/Fuji.sh"
```
