# superioroil4373/unboxit architecture

> Architecture diagram of the GitHub repository superioroil4373/unboxit, 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/superioroil4373/unboxit
- Repository: https://github.com/superioroil4373/unboxit

## Overview

unBoxit routes Box links to local macOS files through two user-facing entry points: a Finder button on Box.com and actionable buttons in Slack. Both produce a `boxlocal://` URL handled locally; the handler resolves the Box Drive path and opens it in Finder. The Slack bot also retrieves Box metadata to build a named local path and unfurl. The browser and bot implementations are excerpted; handler behavior and cross-component links are based on the README, so details beyond its description are not inferred.

Main entry points: [`macos-handler/handler.sh`](https://github.com/superioroil4373/unboxit/blob/main/macos-handler/handler.sh) (Path handler), [`slackbot/app.js`](https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js) (Link processor), [`browser-extension/content.js`](https://github.com/superioroil4373/unboxit/blob/main/browser-extension/content.js) (Finder button)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser extension"]
  node_extension["Finder button<br/>[content.js]"]
end

subgraph group_macos["macOS handler"]
  node_protocol["Local URL protocol<br/>[handler.sh]"]
  node_handler["Path handler<br/>[handler.sh]"]
end

subgraph group_slack["Slack companion"]
  node_link_processor["Link processor<br/>[app.js]"]
  node_box_metadata["Metadata lookup<br/>[app.js]"]
  node_unfurl["Unfurl and actions<br/>[app.js]"]
end

subgraph group_external["External services"]
  node_finder["Finder"]
  node_box_drive["Box Drive"]
  node_slack_platform["Slack platform"]
  node_box_api["Box API"]
end

node_box_user(("Box user"))
node_slack_user(("Slack user"))

node_box_user -->|"clicks"| node_extension
node_extension -->|"opens URL"| node_protocol
node_protocol -->|"dispatches"| node_handler
node_handler -->|"resolves path"| node_box_drive
node_handler -->|"opens or reveals"| node_finder
node_slack_user -->|"shares link"| node_slack_platform
node_slack_platform -->|"delivers message"| node_link_processor
node_link_processor -->|"looks up item"| node_box_metadata
node_box_metadata -->|"fetches metadata"| node_box_api
node_link_processor -->|"builds response"| node_unfurl
node_unfurl -->|"posts buttons"| node_slack_platform
node_slack_platform -->|"shows actions"| node_slack_user
node_slack_user -->|"opens action URL"| node_protocol

click node_extension "https://github.com/superioroil4373/unboxit/blob/main/browser-extension/content.js"
click node_protocol "https://github.com/superioroil4373/unboxit/blob/main/macos-handler/handler.sh"
click node_handler "https://github.com/superioroil4373/unboxit/blob/main/macos-handler/handler.sh"
click node_link_processor "https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js"
click node_box_metadata "https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js"
click node_unfurl "https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js"

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_extension,node_box_user,node_slack_user toneBlue
class node_protocol,node_handler toneAmber
class node_link_processor,node_box_metadata,node_unfurl toneMint
class node_finder,node_box_drive,node_slack_platform,node_box_api toneRose
```

## Components

### Browser extension

- [Finder button](https://github.com/superioroil4373/unboxit/blob/main/browser-extension/content.js): `browser-extension/content.js`

### macOS handler

- [Local URL protocol](https://github.com/superioroil4373/unboxit/blob/main/macos-handler/handler.sh): `macos-handler/handler.sh`
- [Path handler](https://github.com/superioroil4373/unboxit/blob/main/macos-handler/handler.sh): `macos-handler/handler.sh`

### Slack companion

- [Link processor](https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js): `slackbot/app.js`
- [Metadata lookup](https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js): `slackbot/app.js`
- [Unfurl and actions](https://github.com/superioroil4373/unboxit/blob/main/slackbot/app.js): `slackbot/app.js`

### External services

- **Finder**
- **Box Drive**
- **Slack platform**
- **Box API**

### Other components

- **Box user**
- **Slack user**

## Connections

- Box user → Finder button: clicks (evidence: `README.md`)
- Finder button → Local URL protocol: opens URL (evidence: `browser-extension/content.js`)
- Local URL protocol → Path handler: dispatches (evidence: `README.md`)
- Path handler → Box Drive: resolves path (evidence: `README.md`)
- Path handler → Finder: opens or reveals (evidence: `README.md`)
- Slack user → Slack platform: shares link (evidence: `README.md`)
- Slack platform → Link processor: delivers message (evidence: `slackbot/app.js`)
- Link processor → Metadata lookup: looks up item (evidence: `slackbot/app.js`)
- Metadata lookup → Box API: fetches metadata (evidence: `slackbot/app.js`)
- Link processor → Unfurl and actions: builds response (evidence: `slackbot/app.js`)
- Unfurl and actions → Slack platform: posts buttons (evidence: `slackbot/app.js`)
- Slack platform → Slack user: shows actions (evidence: `README.md`)
- Slack user → Local URL protocol: opens action URL (evidence: `README.md`)
