# ahmedgannoun/arcto architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedgannoun/arcto
- Repository: https://github.com/ahmedgannoun/arcto

## Overview

##### Main Components
- Landing-Page (Next.js marketing site)
- Remote PWA (React/Vite Progressive Web App)
- Electron Controller (Desktop app – Node/Electron)
- Shared Utilities (common code if present)

##### Component Responsibilities
a. Landing-Page
– Serves marketing content, download links, and documentation via Next.js pages.
b. Remote PWA
– Runs in mobile browsers or installed as PWA; provides UI for navigation, media, volume, fullscreen, and power toggle.
– Communicates over WebSocket or HTTP to Electron Controller.
c. Electron Controller
– Runs on desktop; hosts a local server or WebSocket endpoint.
– Receives remote commands and triggers OS events or presentation APIs.
d. Shared Utilities (if “shared/” exists or later added)
– Houses shared TypeScript types, constants, and helper functions used by both PWA and Electron.
e. Public Assets
– Static images and manifest files for PWA and landing site.

##### Interactions and Data Flows
– Remote PWA → Electron Controller: WebSocket/HTTP for command messages (e.g., “next slide,” “play media”).
– Electron Controller → OS/Presentation App: Emulates keyboard or uses presentation API.
– Landing-Page → User’s Browser: Static site hosting via Next.js server or static export.
– Optionally: Telemetry or error reporting from Remote PWA back to a monitoring service if present.

##### Architectural Patterns
- Monorepo structure for code sharing and unified tooling (npm scripts, TypeScript config).
- Frontend–Backend separation: PWA as client, Electron as server.
- PWA pattern: service worker, manifest.json, offline support.
- Micro-apps under “apps/” directory.
- Next.js for SSR/SSG on Landing-Page.
- Vite for fast local dev on Remote PWA.
- Electron bridging Node.js backend with desktop capabilities.

– Clear component labels (include framework/tech under each).
– Group apps visually under a “Monorepo” boundary to emphasize shared repository.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "External Actors"
        Mobile["User's Mobile Browser"]:::external
        Internet["Public Internet"]:::external
        Desktop["User's Desktop"]:::external
    end

    subgraph "Arcto Monorepo"
        LP["Landing-Page\n(Next.js, Tailwind CSS)"]:::frontend
        PWA["Remote PWA\n(React, Vite, Service Worker)"]:::frontend
        EC["Electron Controller\n(Electron, Node.js, Local WS Server)"]:::backend
    end

    OS["OS/Presentation App"]:::backend
    PublicCDN["Public CDN/GitHub Pages"]:::static
    PublicAssets["Public Assets\n(icons, manifest)"]:::static

    Internet -->|hosts| LP
    PublicCDN -->|serves| LP
    Mobile -->|accesses| PWA
    Desktop -->|runs| EC
    PWA -->|"WebSocket/HTTP commands"| EC
    EC -->|"Keyboard Events"| OS
    LP -.->|"uses static assets"| PublicAssets
    PWA -.->|"references assets"| PublicAssets

    click LP "https://github.com/ahmedgannoun/arcto/tree/main/apps/landing-page"
    click PWA "https://github.com/ahmedgannoun/arcto/tree/main/apps/remote-pwa"
    click PublicAssets "https://github.com/ahmedgannoun/arcto/tree/main/public"

    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#FFFACD,stroke:#000,stroke-width:1px
```
