# 99mini/voyage architecture

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

- Interactive diagram: https://gitdiagram.com/99mini/voyage
- Repository: https://github.com/99mini/voyage

## Overview

##### Overall Structure & Components
- Major tiers in the system:
- Frontend Applications: Several React/TypeScript apps (Home, Tool, Tech, Admin, Awesome, and Todo) each with their own subdirectories and distinct features. Note that “Tech” uses Docusaurus while “Home” also incorporates Remix.
- Backend Services: A “server” folder that splits into “Rest” (NestJS for REST API), “Functions” (serverless functions written in Node/TypeScript), and “Batch” (batch processing API – TODO).
- Shared Packages: Under “packages,” there are components like “api-client” (for making API calls), “pb-api” (integrating Pocketbase), and “VDS (Voyage Design System)” which standardizes UI components across the frontends.
- CLI: A command-line interface under the “apps/cli” directory that, while minimal now, forms a part of the ecosystem.

##### Architectural Relationships & Data Flow
- Frontend to Backend:
- The “api-client” package is a shared client library used by frontends to consume REST or Functions APIs.
- Backend Internals:
- “Batch” as a component that might interact with asynchronous processes.
- Shared Components & Design System:
- “VDS (Voyage Design System)” package as a common library that feeds UI consistency into the frontends.
- That the shared packages like “api-client” and “pb-api” are integrated both at the application level and possibly in backend services where needed.

##### Architectural Patterns/Design Principles
- Separation of Concerns: Clearly separate UI (frontend) from business logic and API logic (backend). Each application is self-contained yet uses shared libraries.
- Modular Design: With multiple distinct apps and packages, emphasize modularity. Each frontend app, backend service, and package can be visualized as modules that interact via well-defined interfaces (like API calls).
- Extensibility & Reusability: The shared packages (e.g., VDS and api-client) should be marked as reusable libraries that all apps depend on.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Presentation Layer"
        HF["Home Frontend (React + Remix)"]:::frontend
        TF["Tool Frontend (React + Tailwind)"]:::frontend
        TechF["Tech Frontend (React with Docusaurus)"]:::frontend
        AdminF["Admin Frontend (React)"]:::frontend
        AwesomeF["Awesome Frontend (React)"]:::frontend
        TodoF["Todo Frontend (React)"]:::frontend
    end

    subgraph "Backend Services"
        RestApi["REST API (NestJS)"]:::backend
        Serverless["Serverless Functions (Node/TypeScript)"]:::backend
        Batch["Batch Processing API (TODO)"]:::backend
    end

    subgraph "Shared Packages"
        ApiClient["API Client (Shared Library)"]:::shared
        PbApi["Pocketbase API (Shared Library)"]:::shared
        VDS["VDS - Voyage Design System (Shared UI Components)"]:::shared
    end

    subgraph "DevOps & Tooling"
        CICD["CI/CD Workflows"]:::cicd
        CLI["CLI (Command-line Interface)"]:::cli
    end

    %% Frontend to Shared Packages
    HF -->|"uses"| ApiClient
    TF -->|"uses"| ApiClient
    TechF -->|"uses"| ApiClient
    AdminF -->|"uses"| ApiClient
    AwesomeF -->|"uses"| ApiClient
    TodoF -->|"uses"| ApiClient

    HF -->|"uses"| VDS
    TF -->|"uses"| VDS
    TechF -->|"uses"| VDS
    AdminF -->|"uses"| VDS
    AwesomeF -->|"uses"| VDS
    TodoF -->|"uses"| VDS

    %% Shared Packages to Backend Services
    ApiClient -->|"calls"| RestApi
    ApiClient -->|"calls"| Serverless

    %% Direct Frontend to Backend interaction (example for Admin)
    AdminF -->|"monitors"| RestApi

    %% Backend internal integration
    RestApi -->|"integrates"| PbApi

    %% CI/CD deploying targets
    CICD -->|"deploys"| HF
    CICD -->|"deploys"| TF
    CICD -->|"deploys"| TechF
    CICD -->|"deploys"| AdminF
    CICD -->|"deploys"| AwesomeF
    CICD -->|"deploys"| TodoF
    CICD -->|"deploys"| RestApi
    CICD -->|"deploys"| Serverless
    CICD -->|"deploys"| Batch
    CICD -->|"deploys"| CLI

    %% CLI invoking backend service
    CLI -->|"invokes"| RestApi

    %% Click Events
    click HF "https://github.com/99mini/voyage/tree/main/apps/frontend/home"
    click TF "https://github.com/99mini/voyage/tree/main/apps/frontend/tool"
    click TechF "https://github.com/99mini/voyage/tree/main/apps/frontend/tech"
    click AdminF "https://github.com/99mini/voyage/tree/main/apps/frontend/admin"
    click AwesomeF "https://github.com/99mini/voyage/tree/main/apps/frontend/awesome"
    click TodoF "https://github.com/99mini/voyage/tree/main/apps/frontend/todo"
    click RestApi "https://github.com/99mini/voyage/tree/main/apps/server/rest"
    click Serverless "https://github.com/99mini/voyage/tree/main/apps/server/functions"
    click Batch "https://github.com/99mini/voyage/tree/main/apps/server/batch"
    click ApiClient "https://github.com/99mini/voyage/tree/main/packages/api-client"
    click PbApi "https://github.com/99mini/voyage/tree/main/packages/pb-api"
    click VDS "https://github.com/99mini/voyage/tree/main/packages/vds"
    click CLI "https://github.com/99mini/voyage/tree/main/apps/cli"
    click CICD "https://github.com/99mini/voyage/tree/main/.github/workflows"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef backend fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef shared fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef cicd fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef cli fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
