# blcsntb/bluesky-expo architecture

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

- Interactive diagram: https://gitdiagram.com/blcsntb/bluesky-expo
- Repository: https://github.com/blcsntb/bluesky-expo

## Overview

Based on our review of the file tree and README, the Bluesky Social App is a full‐stack, cross-platform social application. It is primarily a React Native application (written in TypeScript) that covers mobile (iOS/Android) and web platforms. In addition to the mobile/web client code (in the src/ folder and several “bsky…” subdirectories like bskyembed, bskylink, bskyogcard), there is also a small Go-based web service (in the bskyweb folder) that serves the web version of the React Native app. External integration with the AT Protocol (via the @atproto packages) means that the app both consumes (and perhaps even contributes to) decentralized social media APIs.

##### Main Components
- Embeddable Modules: Separate out the “bskyembed”, “bskylink”, and “bskyogcard” directories as modular components that provide specialized functionality (e.g., embeddable content, link handling, og-card metadata). Show how these modules plug into or extend the main client.
- Web Service (bskyweb): Display the Go-based server component that serves the web build of the app and may handle backend functionalities like rendering templates, serving static assets, and acting as a lightweight API gateway.
- Build/CI/CD and Deployment: Although not “runtime” components, include components for automation (GitHub workflows, Dockerfiles, Makefile, etc.) which show the build pipeline, test suites (unit, E2E, mocks, jest), and deployment processes.
- Native Platform Bridges: For the mobile app, include any native modules (e.g., modules for notifications, bottom-sheet, expo modules) and plugins/extensions (like those in the plugins/ folder) that bridge to iOS/Android functionalities.

##### Relationships and Data Flows
- The web server (bskyweb) serves the React Native Web bundle (with static assets and HTML templates from the embedr-static and embedr-templates subdirectories) to web users.
- Shared module libraries (state, hooks, lib, and locale) to the client UI, indicating that these modules provide business logic, API communication, state management, and theming.
- Integration between native modules (iOS/Android code under modules/) and the React Native JavaScript layers. For example, show that modules like expo-background-notification-handler and bottom-sheet pass native events or data back to the JS layer.
- Optionally, include interaction flows from user input in the UI (compose screens, dialogs, modals) through data processing layers (e.g., state, API utilities) to the external AT Protocol endpoints.

##### Architectural Patterns and Design Principles
- Separation of concerns: distinct directories for UI (src/components, src/screens), state (src/state), and business logic (src/lib). This architecture adheres to common patterns found in React applications.
- Modular design: subprojects such as bskyembed, bskylink, and bskyogcard encapsulate isolated functionalities.
- That the project uses a multi-platform design—leveraging React Native for mobile, React for web, and Go for the lightweight server.
- Mention the use of modern CI/CD/CD practices (GitHub Actions workflows, linting and testing scripts) integrated within the repository.

##### Essential Elements
- Clear labels for each component (e.g., Mobile App UI, Web Service, AT Protocol Interface, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Mobile/Web Client"
        A["App.native.tsx"]:::client
        B["App.web.tsx"]:::client
        C["UI Components & State"]:::client
        D["Shared Libraries (components, icons, styles, hooks, state)"]:::client
        A -->|"feeds"| C
        B -->|"feeds"| C
        C -->|"leverages"| D
    end

    subgraph "Embeddable Modules"
        E1["bskyembed"]:::modules
        E2["bskylink"]:::modules
        E3["bskyogcard"]:::modules
    end

    F["Native Platform Bridges"]:::native
    G["AT Protocol Integration"]:::external
    H["Web Service (Go)"]:::server
    I["Build/CI/CD & Deployment"]:::deployment

    C -->|"integrates"| E1
    C -->|"integrates"| E2
    C -->|"integrates"| E3

    F -->|"bridges to"| C

    C -->|"calls"| G

    H -->|"serves-web-bundle"| B

    I -->|"builds"| A
    I -->|"builds"| B
    I -->|"builds"| E1
    I -->|"builds"| E2
    I -->|"builds"| E3
    I -->|"builds"| H

    click A "https://github.com/blcsntb/bluesky-expo/blob/main/src/App.native.tsx"
    click B "https://github.com/blcsntb/bluesky-expo/blob/main/src/App.web.tsx"
    click E1 "https://github.com/blcsntb/bluesky-expo/tree/main/bskyembed/"
    click E2 "https://github.com/blcsntb/bluesky-expo/tree/main/bskylink/"
    click E3 "https://github.com/blcsntb/bluesky-expo/tree/main/bskyogcard/"
    click H "https://github.com/blcsntb/bluesky-expo/tree/main/bskyweb/"
    click F "https://github.com/blcsntb/bluesky-expo/tree/main/modules/"
    click I "https://github.com/blcsntb/bluesky-expo/tree/main/.github/workflows/"
    click I "https://github.com/blcsntb/bluesky-expo/tree/main/Makefile"
    click I "https://github.com/blcsntb/bluesky-expo/tree/main/Dockerfile"
    click I "https://github.com/blcsntb/bluesky-expo/blob/main/Dockerfile.bskylink"
    click I "https://github.com/blcsntb/bluesky-expo/blob/main/Dockerfile.bskyogcard"
    click I "https://github.com/blcsntb/bluesky-expo/blob/main/Dockerfile.embedr"

    classDef client fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef modules fill:#B6EADA,stroke:#333,stroke-width:2px;
    classDef native fill:#D0E6A5,stroke:#333,stroke-width:2px;
    classDef external fill:#FFEDBC,stroke:#333,stroke-width:2px;
    classDef server fill:#C7F9CC,stroke:#333,stroke-width:2px;
    classDef deployment fill:#F9C0C0,stroke:#333,stroke-width:2px;
```
