# dsatriia/muslimboard architecture

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

- Interactive diagram: https://gitdiagram.com/dsatriia/muslimboard
- Repository: https://github.com/dsatriia/muslimboard

## Overview

1. **Overall shape**
   Muslim Board is a multi-surface product with three main runtime pieces: a **browser extension UI**, a **Go backend webservice**, and a **marketing website**. The repo also contains a **macOS Safari Web Extension app** for App Store distribution. The main architectural split is between **static client-side presentation** and a **server-side API that aggregates external data**.

2. **Browser extension as the primary product**
   The `extension/` folder is the core application. It is a mostly static front end built from HTML, CSS, and JavaScript, with no obvious framework layer in the tree. The extension uses:
   - `extension/index.html` and `extension/assets/internal/scripts/app.js` as the application shell and main behavior entrypoint
   - `constant.js`, `utility.js`, and `i18n.js` for shared logic, helpers, and localization
   - bundled third-party libraries for UI behavior and polish, including jQuery, Moment, SweetAlert2, Toast, Tooltipster, Draggable, Normalize, and Font Awesome

3. **Extension data model**
   The extension’s content is driven by static JSON assets under `extension/data/`. These include:
   - `data-content-*.json` for localized dashboard content
   - `data-location-id.json` for location mapping
   - `data-background.json` for background configuration
   This suggests the extension renders a personalized dashboard using a mix of local data packs and runtime-provided data.

4. **Localization boundary**
   Localization is a first-class concern. The repository supports multiple languages, and the extension includes language-specific content files plus an internal i18n script. The supported languages listed in the README are English, Bahasa Indonesia, Russian, Arabic, Traditional Chinese, Simplified Chinese, Hindi, and Bengali. The architecture likely separates **UI chrome/translations** from **content data**, so language changes do not require server changes.

5. **Backend API as aggregation layer**
   The `webservice/` directory is a Go service that acts as the integration and data-aggregation layer. It follows a layered structure:
   - `router/` for HTTP route wiring
   - `controller/` for request handlers
   - `usecase/` for business logic
   - `repositories/` for provider-specific integrations
   - `pkg/` for shared infrastructure concerns
   This is the main boundary between the client and external APIs.

6. **External data providers**
   The backend integrates multiple third-party sources via repositories:
   - `repositories/go-prayer` for prayer-time calculations or API wrapping
   - `repositories/aladhan` for prayer-time/location-related data
   - `repositories/openstreetmap` for geocoding or location lookup
   - `repositories/unsplash` for imagery/backgrounds
   This indicates the backend is not just a CRUD API; it is a federation layer that combines geospatial, prayer time, and visual content services.

7. **Operational concerns in the backend**
   The Go service includes infrastructure packages for:
   - `pkg/http` for HTTP server concerns
   - `pkg/redis` for caching or shared state
   - `pkg/logger` for structured logging
   - `pkg/sentry` for error reporting
   This implies the backend is designed for runtime reliability and observability, and Redis likely sits in the request path for caching external lookups or computed results.

8. **Data flow between client and backend**
   The likely request path is: **extension UI → Go API → third-party providers/cache → response back to extension**. The extension keeps presentation logic local, while the backend centralizes network calls, provider normalization, and any caching/error tracking. This reduces client complexity and lets the product support multiple browsers and locales with a shared service layer.

9. **Safari/macOS packaging**
   The `macos/` directory is a separate Xcode project for a Safari Web Extension. It contains:
   - a native macOS app shell
   - a Safari WebExtension handler
   - extension manifest resources
   This is not a separate product logic stack; it is a packaging and distribution wrapper around the same web-extension style code, used for App Store submission and Safari compatibility.

10. **Marketing site**
   The `website/` directory contains the public landing page assets. It appears to be a separate static site with its own CSS/JS bundles and image assets, including a slider library (`slippry`). It is architecturally distinct from the product runtime: its role is acquisition, documentation, and promotion rather than dashboard functionality.

11. **Shared assets and resources**
   The `resources/` folder holds reusable media and guide materials, while some assets are shared across extension and website surfaces. This suggests the repo treats branding and visual content as a common asset set, with each surface consuming what it needs rather than duplicating media pipelines.

12. **Build/deployment surface**
   The repository includes packaging artifacts for browser stores and app distribution: `extension/manifest.json` plus per-browser manifests, GitHub Actions for code scanning, and store-specific documentation (`WEBSTORE.md`). The architecture therefore spans multiple deployment targets: Chrome/Edge/Firefox extension stores, Safari App Store, and a public website, all fed from the same source repository.

Main entry points: [`extension/assets/internal/scripts/app.js`](https://github.com/dsatriia/muslimboard/blob/master/extension/assets/internal/scripts/app.js) (App logic), [`extension/index.html`](https://github.com/dsatriia/muslimboard/blob/master/extension/index.html) (Extension shell), [`webservice/usecase/usecase.go`](https://github.com/dsatriia/muslimboard/blob/master/webservice/usecase/usecase.go) (Use cases), [`website/assets/ext/main.js`](https://github.com/dsatriia/muslimboard/blob/master/website/assets/ext/main.js) (Landing site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_extension["Extension"]
  node_node_extension_shell["Extension shell<br/>static app shell<br/>[index.html]"]
  node_node_extension_app["App logic<br/>client script<br/>[app.js]"]
  node_node_extension_core["Core scripts<br/>helpers/i18n<br/>[constant.js]"]
  node_node_extension_data[("Data packs<br/>json content")]
  node_node_extension_vendor["UI libraries<br/>third-party libs"]
end

subgraph group_grp_webservice["Webservice"]
  node_node_api_router["Router<br/>Go routing<br/>[router.go]"]
  node_node_api_controller["Controllers<br/>request handlers<br/>[controller.go]"]
  node_node_api_usecase["Use cases<br/>business logic<br/>[usecase.go]"]
  node_node_api_repo["Provider adapters<br/>integration layer<br/>[aladhan.go]"]
  node_node_api_ops["Ops stack<br/>infra pkg<br/>[http.go]"]
end

subgraph group_grp_macos["macOS"]
  node_node_safari_pkg["Safari package<br/>distribution wrapper<br/>[manifest.json]"]
  node_node_safari_native["Native shell<br/>macOS app<br/>[AppDelegate.swift]"]
end

subgraph group_grp_website["Website"]
  node_node_website_site["Landing site<br/>static site<br/>[main.js]"]
  node_node_website_ui["Site assets<br/>frontend assets<br/>[base.css]"]
end

subgraph group_grp_shared["Shared"]
  node_node_shared_assets["Brand assets<br/>media/resources<br/>[logo.psb]"]
end

node_node_extension_shell -->|"boots"| node_node_extension_app
node_node_extension_app -->|"uses"| node_node_extension_core
node_node_extension_app -->|"renders"| node_node_extension_data
node_node_extension_app -->|"depends on"| node_node_extension_vendor
node_node_extension_app -->|"requests"| node_node_api_router
node_node_api_router -->|"dispatches to"| node_node_api_controller
node_node_api_controller -->|"delegates"| node_node_api_usecase
node_node_api_usecase -->|"integrates"| node_node_api_repo
node_node_api_usecase -->|"uses"| node_node_api_ops
node_node_api_repo -->|"cached/observed by"| node_node_api_ops
node_node_safari_native -->|"hosts"| node_node_safari_pkg
node_node_safari_pkg -->|"packages"| node_node_extension_shell
node_node_website_site -->|"uses"| node_node_website_ui
node_node_website_site -->|"consumes"| node_node_shared_assets
node_node_extension_shell -.->|"consumes"| node_node_shared_assets

click node_node_extension_shell "https://github.com/dsatriia/muslimboard/blob/master/extension/index.html"
click node_node_extension_app "https://github.com/dsatriia/muslimboard/blob/master/extension/assets/internal/scripts/app.js"
click node_node_extension_core "https://github.com/dsatriia/muslimboard/blob/master/extension/assets/internal/scripts/constant.js"
click node_node_extension_data "https://github.com/dsatriia/muslimboard/blob/master/extension/data/data-content-en.json"
click node_node_extension_vendor "https://github.com/dsatriia/muslimboard/tree/master/extension/assets/3rd-parties/jquery"
click node_node_api_router "https://github.com/dsatriia/muslimboard/blob/master/webservice/router/router.go"
click node_node_api_controller "https://github.com/dsatriia/muslimboard/blob/master/webservice/controller/controller.go"
click node_node_api_usecase "https://github.com/dsatriia/muslimboard/blob/master/webservice/usecase/usecase.go"
click node_node_api_repo "https://github.com/dsatriia/muslimboard/blob/master/webservice/repositories/aladhan/aladhan.go"
click node_node_api_ops "https://github.com/dsatriia/muslimboard/blob/master/webservice/pkg/http/http.go"
click node_node_safari_pkg "https://github.com/dsatriia/muslimboard/blob/master/macos/Muslim Board Extension/manifest.json"
click node_node_safari_native "https://github.com/dsatriia/muslimboard/blob/master/macos/Muslim Board/AppDelegate.swift"
click node_node_website_site "https://github.com/dsatriia/muslimboard/blob/master/website/assets/ext/main.js"
click node_node_website_ui "https://github.com/dsatriia/muslimboard/blob/master/website/assets/base/base.css"
click node_node_shared_assets "https://github.com/dsatriia/muslimboard/blob/master/resources/logo.psb"

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_node_extension_shell,node_node_extension_app,node_node_extension_core,node_node_extension_data,node_node_extension_vendor toneBlue
class node_node_api_router,node_node_api_controller,node_node_api_usecase,node_node_api_repo,node_node_api_ops toneAmber
class node_node_safari_pkg,node_node_safari_native toneMint
class node_node_website_site,node_node_website_ui toneRose
class node_node_shared_assets toneIndigo
```

## Components

### Extension

Browser extension runtime and bundled client assets.

- [Extension shell](https://github.com/dsatriia/muslimboard/blob/master/extension/index.html): static app shell · Main browser-extension entrypoint and UI container. · `extension/index.html`
- [App logic](https://github.com/dsatriia/muslimboard/blob/master/extension/assets/internal/scripts/app.js): client script · Primary extension behavior and UI orchestration. · `extension/assets/internal/scripts/app.js`
- [Core scripts](https://github.com/dsatriia/muslimboard/blob/master/extension/assets/internal/scripts/constant.js): helpers/i18n · Shared constants, utilities, and localization logic. · `extension/assets/internal/scripts/constant.js`
- [Data packs](https://github.com/dsatriia/muslimboard/blob/master/extension/data/data-content-en.json): json content · Localized content, location mapping, and background configuration. · `extension/data/data-content-en.json`
- [UI libraries](https://github.com/dsatriia/muslimboard/tree/master/extension/assets/3rd-parties/jquery): third-party libs · Bundled browser-side dependencies for interaction and presentation. · `extension/assets/3rd-parties/jquery`

### Webservice

Go API that aggregates external data and serves clients.

- [Router](https://github.com/dsatriia/muslimboard/blob/master/webservice/router/router.go): Go routing · HTTP route wiring for the backend service. · `webservice/router/router.go`
- [Controllers](https://github.com/dsatriia/muslimboard/blob/master/webservice/controller/controller.go): request handlers · Entry handlers that adapt HTTP requests into use cases. · `webservice/controller/controller.go`
- [Use cases](https://github.com/dsatriia/muslimboard/blob/master/webservice/usecase/usecase.go): business logic · Core backend orchestration and domain rules. · `webservice/usecase/usecase.go`
- [Provider adapters](https://github.com/dsatriia/muslimboard/blob/master/webservice/repositories/aladhan/aladhan.go): integration layer · External data providers for prayer times, geocoding, and imagery. · `webservice/repositories/aladhan/aladhan.go`
- [Ops stack](https://github.com/dsatriia/muslimboard/blob/master/webservice/pkg/http/http.go): infra pkg · Shared runtime services for HTTP, cache, logging, and error tracking. · `webservice/pkg/http/http.go`

### macOS

Safari Web Extension packaging and native shell.

- [Safari package](https://github.com/dsatriia/muslimboard/blob/HEAD/macos/Muslim%20Board%20Extension/manifest.json): distribution wrapper · macOS Safari Web Extension app and manifest packaging. · `macos/Muslim Board Extension/manifest.json`
- [Native shell](https://github.com/dsatriia/muslimboard/blob/HEAD/macos/Muslim%20Board/AppDelegate.swift): macOS app · Xcode app container and WebExtension host. · `macos/Muslim Board/AppDelegate.swift`

### Website

Public marketing site and static assets.

- [Landing site](https://github.com/dsatriia/muslimboard/blob/master/website/assets/ext/main.js): static site · Public marketing and informational website. · `website/assets/ext/main.js`
- [Site assets](https://github.com/dsatriia/muslimboard/blob/master/website/assets/base/base.css): frontend assets · Website CSS, JS, and slider assets. · `website/assets/base/base.css`

### Shared

Repository-wide resources and branding assets.

- [Brand assets](https://github.com/dsatriia/muslimboard/blob/master/resources/logo.psb): media/resources · Reusable repository-wide media and guide materials. · `resources/logo.psb`

## Connections

- Extension shell → App logic: boots · The extension shell loads the main client script.
- App logic → Core scripts: uses · UI logic depends on shared constants, utilities, and localization.
- App logic → Data packs: renders · Dashboard content and settings come from static data packs.
- App logic → UI libraries: depends on · Client behavior relies on bundled third-party libraries.
- App logic → Router: requests · The extension calls the backend API for aggregated data.
- Router → Controllers: dispatches to · Routes forward requests to HTTP handlers.
- Controllers → Use cases: delegates · Controllers pass application work into use cases.
- Use cases → Provider adapters: integrates · Use cases fetch and normalize data from external providers.
- Use cases → Ops stack: uses · Business logic relies on HTTP, cache, logging, and error-reporting infrastructure.
- Provider adapters → Ops stack: cached/observed by · Provider calls are supported by shared runtime infrastructure.
- Native shell → Safari package: hosts · The native macOS app contains the Safari Web Extension bundle.
- Safari package → Extension shell: packages · Safari distribution reuses the same web-extension surface.
- Landing site → Site assets: uses · The marketing site is built from its own static asset set.
- Landing site → Brand assets: consumes · Public-facing pages reuse shared branding and media assets.
- Extension shell → Brand assets: consumes · The extension can draw from shared repository assets.
