# nike/community-edition architecture

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

- Interactive diagram: https://gitdiagram.com/nike/community-edition
- Repository: https://github.com/nike/community-edition

## Overview

#### Purpose and Entry Points
Rambox CE is an end-of-life, cross-platform Electron desktop container for multiple messaging/email web applications. The browser renderer is an Ext JS application; Electron supplies desktop lifecycle, tray, menus, window behavior, and updates.
- `package.json`
- `electron/main.js`
- `index.html`
- `app.js`

#### Electron Desktop Shell
Electron’s main process creates and controls the native application window, while separate modules define native menu, tray integration, updater behavior, and display positioning. This is the boundary between Chromium-rendered UI and OS-specific functionality.
- `electron/main.js`
- `electron/menu.js`
- `electron/tray.js`
- `electron/updater.js`
- `electron/utils/positionOnScreen.js`

#### Renderer Application Composition
The Ext JS application bootstraps the renderer and organizes behavior around application lifecycle, online/offline profiles, a main workspace, and dedicated add-service and preferences flows. `Main` is the central UI composition point; controllers mediate user actions and state transitions.
- `app/Application.js`
- `app/profile/Online.js`
- `app/profile/Offline.js`
- `app/view/main/Main.js`
- `app/view/main/MainController.js`
- `app/view/add/Add.js`
- `app/view/preferences/Preferences.js`

#### Service Domain and State
A service represents a configured third-party web app. Models and stores hold individual services and service lists, feeding the workspace and configuration UI. The repository’s service catalog is a static resource; user configuration is intended to persist locally and may be synced externally.
- `app/model/Service.js`
- `app/model/ServiceList.js`
- `app/store/Services.js`
- `app/store/ServicesList.js`
- `resources/services.json`

#### Embedded Web-App Runtime
Each configured service is rendered through a custom WebView abstraction, isolating embedded web application content from the Rambox renderer. Per the README, sessions persist through Electron `partition:persist` webview partitions until a service is removed. Renderer-side APIs expose service and modal integration points to embedded content.
- `app/ux/WebView.js`
- `resources/js/rambox-service-api.js`
- `resources/js/rambox-modal-api.js`

#### Authentication, Sync, and Security Boundaries
Configuration sync uses Auth0 for SSO and token-based authentication; the associated renderer integration is isolated in a resource script. A separate master-password entry page indicates a lock/unlock boundary distinct from the main application workspace. The app does not claim to host third-party service credentials itself; those remain in persisted webview sessions.
- `resources/js/AuthService.js`
- `masterpassword.html`
- `resources/js/GALocalStorage.js`

#### Notifications and Presentation Support
Application-level utilities handle icon loading, formatting, unread counts, and notification delivery, connecting service/webview events to main UI badges and native-facing notification behavior. Localization is resource-based and includes many language bundles.
- `app/util/Notifier.js`
- `app/util/UnreadCounter.js`
- `app/util/IconLoader.js`
- `resources/languages/en.js`
- `languages.js`

#### Build and Runtime Dependencies
The project is primarily JavaScript running in Electron and Chromium, with Ext JS bundled in-repo and Sencha Cmd build/watch infrastructure. The substantial `ext/` tree is framework/vendor source and packaged themes, rather than Rambox product logic. CI configuration targets Travis and AppVeyor; packaging assets include macOS entitlements and installer resources.
- `app.json`
- `.sencha/app/build-impl.xml`
- `ext/build/ext-all.js`
- `build.xml`
- `resources/installer/entitlements.mac.plist`

Main entry points: [`electron/main.js`](https://github.com/nike/community-edition/blob/master/electron/main.js) (Electron main process), [`app/Application.js`](https://github.com/nike/community-edition/blob/master/app/Application.js) (Application lifecycle), [`app/view/main/Main.js`](https://github.com/nike/community-edition/blob/master/app/view/main/Main.js) (Main workspace), [`app/store/Services.js`](https://github.com/nike/community-edition/blob/master/app/store/Services.js) (Service models & stores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Electron Desktop"]
  node_electron_main["Electron main process<br/>[main.js]"]
  node_native_menu["Native menu<br/>menu module<br/>[menu.js]"]
  node_tray["Tray integration<br/>tray module<br/>[tray.js]"]
  node_updater["Application updater<br/>updater module<br/>[updater.js]"]
end

subgraph group_renderer["Renderer Application"]
  node_renderer_entry["Renderer entry<br/>HTML bootstrap<br/>[index.html]"]
  node_app_bootstrap["Ext JS bootstrap<br/>renderer bootstrap<br/>[app.js]"]
  node_application["Application lifecycle<br/>Ext application<br/>[Application.js]"]
  node_profiles["Online/offline profiles<br/>Ext profiles<br/>[Online.js]"]
  node_workspace["Main workspace<br/>Ext view/controller<br/>[Main.js]"]
  node_service_flows["Service setup &amp; preferences<br/>Ext views<br/>[Add.js]"]
  node_notifications["Notifications &amp; unread state<br/>renderer utilities<br/>[Notifier.js]"]
end

subgraph group_services["Service Runtime"]
  node_service_state[("Service models &amp; stores<br/>Ext state layer<br/>[Services.js]")]
  node_service_catalog["Service catalog<br/>static catalog<br/>[services.json]"]
  node_webview["WebView runtime<br/>Ext webview abstraction<br/>[WebView.js]"]
  node_embedded_apis["Embedded service APIs<br/>renderer bridge APIs"]
end

subgraph group_security["Auth &amp; Persistence"]
  node_auth_sync["Auth0 configuration sync<br/>authentication integration<br/>[AuthService.js]"]
  node_master_password["Master-password lock<br/>security entry page"]
  node_local_storage[("Local configuration storage<br/>storage adapter<br/>[GALocalStorage.js]")]
end

node_package["Project manifest<br/>npm manifest<br/>[package.json]"]
node_build{{"Sencha build pipeline<br/>build infrastructure<br/>[app.json]"}}

node_package -->|"launches"| node_electron_main
node_package -.->|"defines build"| node_build
node_electron_main -->|"loads window"| node_renderer_entry
node_electron_main -->|"installs"| node_native_menu
node_electron_main -->|"controls"| node_tray
node_electron_main -->|"runs"| node_updater
node_renderer_entry -->|"boots"| node_app_bootstrap
node_app_bootstrap -->|"initializes"| node_application
node_application -->|"selects"| node_profiles
node_application -->|"creates"| node_workspace
node_workspace -->|"opens"| node_service_flows
node_workspace -->|"reads and updates"| node_service_state
node_service_flows -->|"configures"| node_service_state
node_service_state -->|"uses catalog"| node_service_catalog
node_workspace -->|"hosts services"| node_webview
node_service_state -->|"configures instances"| node_webview
node_webview -->|"exposes"| node_embedded_apis
node_webview -->|"emits events"| node_notifications
node_notifications -->|"updates badges"| node_workspace
node_application -.->|"uses optional sync"| node_auth_sync
node_auth_sync -.->|"syncs configuration"| node_local_storage
node_master_password -->|"unlocks access"| node_application
node_build -->|"bundles"| node_app_bootstrap

click node_package "https://github.com/nike/community-edition/blob/master/package.json"
click node_electron_main "https://github.com/nike/community-edition/blob/master/electron/main.js"
click node_native_menu "https://github.com/nike/community-edition/blob/master/electron/menu.js"
click node_tray "https://github.com/nike/community-edition/blob/master/electron/tray.js"
click node_updater "https://github.com/nike/community-edition/blob/master/electron/updater.js"
click node_renderer_entry "https://github.com/nike/community-edition/blob/master/index.html"
click node_app_bootstrap "https://github.com/nike/community-edition/blob/master/app.js"
click node_application "https://github.com/nike/community-edition/blob/master/app/Application.js"
click node_profiles "https://github.com/nike/community-edition/blob/master/app/profile/Online.js"
click node_workspace "https://github.com/nike/community-edition/blob/master/app/view/main/Main.js"
click node_service_flows "https://github.com/nike/community-edition/blob/master/app/view/add/Add.js"
click node_service_state "https://github.com/nike/community-edition/blob/master/app/store/Services.js"
click node_service_catalog "https://github.com/nike/community-edition/blob/master/resources/services.json"
click node_webview "https://github.com/nike/community-edition/blob/master/app/ux/WebView.js"
click node_embedded_apis "https://github.com/nike/community-edition/blob/master/resources/js/rambox-service-api.js"
click node_notifications "https://github.com/nike/community-edition/blob/master/app/util/Notifier.js"
click node_auth_sync "https://github.com/nike/community-edition/blob/master/resources/js/AuthService.js"
click node_master_password "https://github.com/nike/community-edition/blob/master/masterpassword.html"
click node_local_storage "https://github.com/nike/community-edition/blob/master/resources/js/GALocalStorage.js"
click node_build "https://github.com/nike/community-edition/blob/master/app.json"

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_electron_main,node_native_menu,node_tray,node_updater toneBlue
class node_renderer_entry,node_app_bootstrap,node_application,node_profiles,node_workspace,node_service_flows,node_notifications toneAmber
class node_service_state,node_service_catalog,node_webview,node_embedded_apis toneMint
class node_auth_sync,node_master_password,node_local_storage toneRose
class node_package,node_build toneNeutral
```

## Components

### Electron Desktop

Native-process boundary and OS integration.

- [Electron main process](https://github.com/nike/community-edition/blob/master/electron/main.js): Electron main · Owns application lifecycle and native window creation. · `electron/main.js`
- [Native menu](https://github.com/nike/community-edition/blob/master/electron/menu.js): menu module · `electron/menu.js`
- [Tray integration](https://github.com/nike/community-edition/blob/master/electron/tray.js): tray module · `electron/tray.js`
- [Application updater](https://github.com/nike/community-edition/blob/master/electron/updater.js): updater module · `electron/updater.js`

### Renderer Application

Ext JS workspace and user flows.

- [Renderer entry](https://github.com/nike/community-edition/blob/master/index.html): HTML bootstrap · `index.html`
- [Ext JS bootstrap](https://github.com/nike/community-edition/blob/master/app.js): renderer bootstrap · `app.js`
- [Application lifecycle](https://github.com/nike/community-edition/blob/master/app/Application.js): Ext application · Selects online or offline renderer behavior. · `app/Application.js`
- [Online/offline profiles](https://github.com/nike/community-edition/blob/master/app/profile/Online.js): Ext profiles · `app/profile/Online.js`
- [Main workspace](https://github.com/nike/community-edition/blob/master/app/view/main/Main.js): Ext view/controller · Central composition point for service tabs and user actions. · `app/view/main/Main.js`
- [Service setup & preferences](https://github.com/nike/community-edition/blob/master/app/view/add/Add.js): Ext views · Add-service and preferences user flows. · `app/view/add/Add.js`
- [Notifications & unread state](https://github.com/nike/community-edition/blob/master/app/util/Notifier.js): renderer utilities · Converts service events into workspace badges and notifications. · `app/util/Notifier.js`

### Service Runtime

Configured services and embedded web apps.

- [Service models & stores](https://github.com/nike/community-edition/blob/master/app/store/Services.js): Ext state layer · Holds configured services and catalog records. · `app/store/Services.js`
- [Service catalog](https://github.com/nike/community-edition/blob/master/resources/services.json): static catalog · `resources/services.json`
- [WebView runtime](https://github.com/nike/community-edition/blob/master/app/ux/WebView.js): Ext webview abstraction · Loads each service in a persistent Electron webview partition. · `app/ux/WebView.js`
- [Embedded service APIs](https://github.com/nike/community-edition/blob/master/resources/js/rambox-service-api.js): renderer bridge APIs · Exposes Rambox and modal integration to embedded content. · `resources/js/rambox-service-api.js`

### Auth & Persistence

Local protection and optional configuration sync.

- [Auth0 configuration sync](https://github.com/nike/community-edition/blob/master/resources/js/AuthService.js): authentication integration · Provides token-based SSO for external configuration sync. · `resources/js/AuthService.js`
- [Master-password lock](https://github.com/nike/community-edition/blob/master/masterpassword.html): security entry page · Separate lock and unlock boundary before the workspace. · `masterpassword.html`
- [Local configuration storage](https://github.com/nike/community-edition/blob/master/resources/js/GALocalStorage.js): storage adapter · `resources/js/GALocalStorage.js`

### Other components

- [Project manifest](https://github.com/nike/community-edition/blob/master/package.json): npm manifest · `package.json`
- [Sencha build pipeline](https://github.com/nike/community-edition/blob/master/app.json): build infrastructure · Bundles the Ext JS renderer application. · `app.json`

## Connections

- Project manifest → Electron main process: launches
- Project manifest → Sencha build pipeline: defines build
- Electron main process → Renderer entry: loads window
- Electron main process → Native menu: installs
- Electron main process → Tray integration: controls
- Electron main process → Application updater: runs
- Renderer entry → Ext JS bootstrap: boots
- Ext JS bootstrap → Application lifecycle: initializes
- Application lifecycle → Online/offline profiles: selects
- Application lifecycle → Main workspace: creates
- Main workspace → Service setup & preferences: opens
- Main workspace → Service models & stores: reads and updates
- Service setup & preferences → Service models & stores: configures
- Service models & stores → Service catalog: uses catalog
- Main workspace → WebView runtime: hosts services
- Service models & stores → WebView runtime: configures instances
- WebView runtime → Embedded service APIs: exposes
- WebView runtime → Notifications & unread state: emits events
- Notifications & unread state → Main workspace: updates badges
- Application lifecycle → Auth0 configuration sync: uses optional sync
- Auth0 configuration sync → Local configuration storage: syncs configuration
- Master-password lock → Application lifecycle: unlocks access
- Sencha build pipeline → Ext JS bootstrap: bundles
