# dmoyadev/genoma architecture

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

- Interactive diagram: https://gitdiagram.com/dmoyadev/genoma
- Repository: https://github.com/dmoyadev/genoma

## Overview

##### Main Components
- Frontend UI: The heart of the application built with Vue components. Organize this into logical modules:
- Auth Module: Contains authentication-related UI (e.g., LoginPage.vue), background images, and composable functions (useAuth.ts) to handle user sessions.
- App Module: Encompasses the main dashboard areas such as the header, error handling, configuration, and home pages. Look at components like TheHeader.vue and pages in src/modules/app/pages.
- People Module: Manages the family tree. It includes models (e.g., Person.ts), views (PersonPage.vue, InfiniteWorkspace.vue), and composables (usePeopleService.ts, useTreeService.ts) that encapsulate business logic.
- Onboarding Module: Provides user onboarding flows and pages.
- Module: Demonstrates UI components and acts as a sandbox for components.
- Router: The src/router.ts defines the navigation routes connecting these modules.
- Utility & Config: Contains helper functions, the Firebase utility (src/utils/firebase.ts), and configuration files (environment variables, firebase.json, .env.example).

##### External and Integration Layers
- Firebase Services: The existence of firebase.json, useDB.ts, and useStorage.ts suggests integration with Firebase for:
- Database storage (family tree and user data).
- Cloud storage (perhaps for images or documents).
- Authentication services.
- GitHub Workflows: The .github/workflows files (firebase-hosting-merge.yml, firebase-hosting-pull-request.yml) indicate automated deployment and hosting processes on Firebase.

- UI Components from each module interact with their respective composables (for instance, useAuth in the Auth module or usePeopleService in the People module) to fetch and manipulate data.
- The Router (in src/router.ts) connects various pages and links the UI layers together.
- The frontend communicates with Firebase services through specific utilities and composable layers to persist data, authenticate users, and store files.
- Configuration files such as environment settings and Vite configuration (vite.config.ts) tie the build and runtime environment together.

##### Architectural Patterns & Design Principles
- Component-Based Design: The application is built using reusable Vue components (e.g., BaseButton, BaseIcon) which promotes modularity.
- Domain-Based Module Separation: Each domain such as authentication, people (family tree), and onboarding is clearly separated into its own module with dedicated components, pages, and utilities.
- Service Abstraction: Use of composables (like useDB, useAuth, usePeopleService) abstracts the interaction with external services.
- Clear Separation of Concerns: There’s a distinction between presentation (layouts, pages), business logic (composables, services), and utility/configuration layers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend UI"
        subgraph "Auth Module"
            auth1["LoginPage.vue"]:::ui
            auth2["useAuth.ts"]:::ui
            auth3["BackgroundImage.vue"]:::ui
        end
        subgraph "App Module"
            app1["TheHeader.vue"]:::ui
            app2["HomePage.vue"]:::ui
            app3["ConfigPage.vue"]:::ui
            app4["NotFoundPage.vue"]:::ui
            app5["useDB.ts"]:::ui
            app6["useStorage.ts"]:::ui
        end
        subgraph "People Module"
            ppl1["Person.ts"]:::ui
            ppl2["PersonPage.vue"]:::ui
            ppl3["InfiniteWorkspace.vue"]:::ui
            ppl4["usePeopleService.ts"]:::ui
            ppl5["useTreeService.ts"]:::ui
            ppl6["People Components/Partials"]:::ui
        end
        subgraph "Onboarding Module"
            onb1["OnboardingPage.vue"]:::ui
        end
        subgraph "Showcase Module"
            show1["Showcase (Directory)"]:::ui
        end
    end

    subgraph "Layouts & Themes"
        lay1["AuthLayout.vue"]:::layout
        lay2["OnboardingLayout.vue"]:::layout
        lay3["Themes (Directory)"]:::layout
    end

    router["router.ts"]:::router

    subgraph "Utility & Config"
        util1["firebase.ts"]:::config
        util2[".env.example"]:::config
        util3["firebase.json"]:::config
        util4["vite.config.ts"]:::config
        util5["tsconfig.json"]:::config
    end

    subgraph "Firebase Services"
        fs1["Firebase Authentication"]:::service
        fs2["Firebase Database"]:::service
        fs3["Firebase Storage"]:::service
    end

    subgraph "Deployment Automation"
        dep1["firebase-hosting-merge.yml"]:::deploy
        dep2["firebase-hosting-pull-request.yml"]:::deploy
    end

    %% Router connections to UI Modules
    router -->|"routes"| auth1
    router -->|"routes"| app2
    router -->|"routes"| ppl2
    router -->|"routes"| onb1
    router -->|"routes"| show1

    %% Composable functions to Firebase Services
    auth2 -->|"auth_req"| fs1
    app5 -->|"data_query"| fs2
    app6 -->|"file_fetch"| fs3
    ppl4 -->|"data_query"| fs2
    ppl5 -->|"data_query"| fs2

    %% Utility & Config linking to Firebase Services
    util1 -->|"config"| fs1
    util1 -->|"config"| fs2
    util1 -->|"config"| fs3
    util3 -->|"config"| fs1
    util3 -->|"config"| fs2
    util3 -->|"config"| fs3
    util4 -->|"build_config"| dep1
    util4 -->|"build_config"| dep2

    %% Deployment Automation triggering deployment to Firebase Services
    dep1 -->|"deploy"| fs1
    dep1 -->|"deploy"| fs2
    dep1 -->|"deploy"| fs3
    dep2 -->|"deploy"| fs1
    dep2 -->|"deploy"| fs2
    dep2 -->|"deploy"| fs3

    %% Layouts supporting UI Modules
    lay1 -->|"layout"| auth1
    lay1 -->|"layout"| app1
    lay2 -->|"layout"| onb1

    %% Class Definitions
    classDef ui fill:#cce5ff,stroke:#000,stroke-width:1px;
    classDef service fill:#d4edda,stroke:#000,stroke-width:1px;
    classDef deploy fill:#f8d7da,stroke:#000,stroke-width:1px;
    classDef config fill:#fff3cd,stroke:#000,stroke-width:1px;
    classDef router fill:#d1c4e9,stroke:#000,stroke-width:1px;
    classDef layout fill:#e2e3e5,stroke:#000,stroke-width:1px;

    %% Click Events
    click auth1 "https://github.com/dmoyadev/genoma/blob/main/src/modules/auth/pages/LoginPage.vue"
    click auth2 "https://github.com/dmoyadev/genoma/blob/main/src/modules/auth/composables/useAuth.ts"
    click auth3 "https://github.com/dmoyadev/genoma/blob/main/src/modules/auth/components/BackgroundImage.vue"
    click app1 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/components/TheHeader.vue"
    click app2 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/pages/HomePage.vue"
    click app3 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/pages/ConfigPage.vue"
    click app4 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/pages/NotFoundPage.vue"
    click app5 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/composables/useDB.ts"
    click app6 "https://github.com/dmoyadev/genoma/blob/main/src/modules/app/composables/useStorage.ts"
    click ppl1 "https://github.com/dmoyadev/genoma/blob/main/src/modules/people/models/Person.ts"
    click ppl2 "https://github.com/dmoyadev/genoma/blob/main/src/modules/people/pages/PersonPage.vue"
    click ppl3 "https://github.com/dmoyadev/genoma/blob/main/src/modules/people/pages/InfiniteWorkspace.vue"
    click ppl4 "https://github.com/dmoyadev/genoma/blob/main/src/modules/people/composables/usePeopleService.ts"
    click ppl5 "https://github.com/dmoyadev/genoma/blob/main/src/modules/people/composables/useTreeService.ts"
    click onb1 "https://github.com/dmoyadev/genoma/blob/main/src/modules/onboarding/pages/OnboardingPage.vue"
    click show1 "https://github.com/dmoyadev/genoma/tree/main/src/showcase"
    click lay1 "https://github.com/dmoyadev/genoma/blob/main/src/layouts/AuthLayout.vue"
    click lay2 "https://github.com/dmoyadev/genoma/blob/main/src/layouts/OnboardingLayout.vue"
    click lay3 "https://github.com/dmoyadev/genoma/tree/main/src/theme"
    click router "https://github.com/dmoyadev/genoma/blob/main/src/router.ts"
    click util1 "https://github.com/dmoyadev/genoma/blob/main/src/utils/firebase.ts"
    click util2 "https://github.com/dmoyadev/genoma/blob/main/.env.example"
    click util3 "https://github.com/dmoyadev/genoma/blob/main/firebase.json"
    click util4 "https://github.com/dmoyadev/genoma/blob/main/vite.config.ts"
    click util5 "https://github.com/dmoyadev/genoma/blob/main/tsconfig.json"
    click dep1 "https://github.com/dmoyadev/genoma/blob/main/.github/workflows/firebase-hosting-merge.yml"
    click dep2 "https://github.com/dmoyadev/genoma/blob/main/.github/workflows/firebase-hosting-pull-request.yml"
```
