# jamf/depnotify-starter architecture

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

- Interactive diagram: https://gitdiagram.com/jamf/depnotify-starter
- Repository: https://github.com/jamf/depnotify-starter

## Overview

##### Main Components
- DEPNotify Starter Bash Script: This is the core component (e.g., depNotify.sh) that orchestrates the overall process. It drives the launching of DEPNotify, handles configuration variables (like TESTING_MODE), and defines the POLICY_ARRAY that triggers the installation of software via Jamf Pro.
- Jamf Pro Server: Even though it’s not part of the repository’s code, Jamf Pro is an external management system with which the script interacts. The policies you create in Jamf Pro are triggered by this script during enrollment.
- DEPNotify Application: This external DEPNotify package (referenced in the README and available via the provided GitLab link) provides the GUI for end-users. It visually communicates progress and status as the enrollment process occurs.
- User Provisioning Inputs: Elements such as the optional EULA text file (expected in /Users/Shared), the registration inputs (departments, buildings, custom text inputs), and test/production mode toggles. These represent pieces of user configuration feed into the process.
- FileVault Integration: A conditional component where the script checks for FileVault’s deferred enablement and triggers either a logout or quits DEPNotify based on that state.
- Configuration Assets & Documentation: Although not active in the runtime flow, files like CHANGELOG.md, CONTRIBUTORS.md, and images (in example-img) confirm supporting documentation and visual aids that help understand the UI workflow. These can be shown as “documentation” nodes to provide context in your overall architecture.

##### Relationships and Data Flow
- Conditional Branches: Include decision points (for example, testing mode vs. production mode, and FileVault check) as branch nodes – the “TESTING_MODE” flag can lead to either a sleep/emulation of deployment (in testing) or trigger actual deployment actions (in production). Similarly, illustrate the FileVault deferred enablement check leading to either logout or normal termination.

##### Architectural Patterns and Design Principles
- Modularity and Separation of Concerns: Emphasize that the script itself is modular (with clearly separated “core logic” that should not be modified lightly) while the Jamf Pro configuration handles the policy management.
- Configurable Workflow: Highlight that the script supports dynamic configuration via variables (such as TESTING_MODE, policy arrays, and optional EULA/registration workflows). This is an example of a highly customizable provisioning system.
- Policy-Driven Interactions: The system follows a policy-driven execution model where a series of predetermined actions (policies) are sequentially triggered during enrollment.

##### Technologies, Frameworks, and Libraries
- Bash Shell Scripting: The core logic of the project is implemented as a bash script.
- Jamf Pro: This is the external device management and policy engine that interacts with the script.
- DEPNotify (App): This is the GUI application for displaying progress and collecting user input.
- Optional Components: EULA text files and registration inputs, which are expected by the script.

- Be very detailed – capture every action of the script as an independent component if possible.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Flow
    A("Enrollment Process"):::start
    C("User Provisioning Inputs"):::inputs
    B("DEPNotify Starter Script"):::bash
    D{"Check_TESTING_MODE"}:::decision
    E("Simulate_Deployment_(Sleep_Command)"):::bash
    F("Jamf_Pro_Policy_Trigger"):::jamf
    G("DEPNotify_App_Invocation"):::ui
    H{"FileVault_Check"}:::decision
    I("Perform_Logout"):::bash
    J("Quit_DEPNotify_(Normal_Termination)"):::bash

    %% Documentation & Assets Subgraph
    subgraph "Documentation & Assets"
        R("README.md"):::doc
        CH("CHANGELOG.md"):::doc
        CO("CONTRIBUTORS.md"):::doc
        RE("RELEASES.md"):::doc
        IMG("Visual_Assets:_example-img"):::doc
        VID("Visual_Assets:_example-video"):::doc
    end

    %% Connections
    A --> B
    C --> B
    B --> D
    D -- "true" --> E
    D -- "false" --> F
    B --> G
    B --> H
    H -- "yes" --> I
    H -- "no" --> J

    %% Click Events
    click B "https://github.com/jamf/depnotify-starter/blob/master/depNotify.sh"
    click R "https://github.com/jamf/depnotify-starter/blob/master/README.md"
    click CH "https://github.com/jamf/depnotify-starter/blob/master/CHANGELOG.md"
    click CO "https://github.com/jamf/depnotify-starter/blob/master/CONTRIBUTORS.md"
    click RE "https://github.com/jamf/depnotify-starter/blob/master/RELEASES.md"
    click IMG "https://github.com/jamf/depnotify-starter/tree/master/example-img"
    click VID "https://github.com/jamf/depnotify-starter/tree/master/example-video"

    %% Styles
    classDef start fill:#a2d9ff,stroke:#333,stroke-width:2px;
    classDef bash fill:#ffdd88,stroke:#333,stroke-width:2px;
    classDef jamf fill:#ffaaaa,stroke:#333,stroke-width:2px;
    classDef ui fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef decision fill:#ffeb3b,stroke:#333,stroke-width:2px,shape:diamond;
    classDef inputs fill:#d1c4e9,stroke:#333,stroke-width:2px;
    classDef doc fill:#e0e0e0,stroke:#333,stroke-width:2px;
```
