# rmit-nct/hub architecture

> Architecture diagram of the GitHub repository rmit-nct/hub, 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/rmit-nct/hub
- Repository: https://github.com/rmit-nct/hub

## Overview

##### Main Components
- Monorepo (Turborepo): Show the overall organization with separate “apps” and “packages.”
- Web Application (apps/web): Represent it as a full‑stack Next.js app that includes both the frontend interface and backend API endpoints. Note that its file structure shows Next.js file-based routing (including extensive API routes under apps/web/src/app/api).
- Documentation Site (apps/docs): A Mintlify-powered documentation portal.
- Shared Libraries (under packages folder):
– UI components (packages/ui)
– TypeScript configurations (packages/typescript-config)
– ESLint configurations (packages/eslint-config)
– Transactional emails and related utilities (packages/transactional)

##### Relationships and Data Flows
- The Web Application (frontend) built with Next.js and Tailwind CSS renders the public user interface while internally using shared UI packages.
- It also consumes the API endpoints (organized under apps/web/src/app/api) for authentication, chat/AI interactions, workspace management, meeting planning (meet-together), and other business features.
- The shared packages are used by the web app and possibly other services. Indicate these as “libraries” that the Web App imports.
- The Docs App is mostly standalone but potentially references shared configurations or UI components if reuse is needed.

##### Important Architectural Patterns and Design Principles
- File‑based routing: Indicate that the Web App’s routing structure (pages and API endpoints) is defined by directory organization – a clear signal of the Next.js convention.
- CI/CD and Development Workflow: Optionally include external continuous integration/deployment mechanisms (e.g., GitHub workflows, pnpm scripts, Docker for Supabase) since the repo contains dedicated configurations (GitHub workflows in .github and pnpm, Turborepo, etc.).
- Shared configuration: Emphasize the use of packages (for UI, ESLint, TypeScript) as a way to enforce consistency and reusability across apps.

##### Relevant Technologies and Frameworks
- Next.js with React for the web application.
- Tailwind CSS (and Shadcn UI) for UI styling.
- Supabase as the backend database and real‑time service.
- Turborepo for monorepo management.
- PNPM for dependency management.
- Docker for running the local Supabase instance.
- GitHub Actions as visible in the .github/workflows folder for testing, code analysis, and deployment pipelines.

b. Under “Apps,” branch into “Web Application (apps/web)” and “Documentation Site (apps/docs).”
– Frontend UI (Next.js pages, components, Tailwind, Shadcn UI)
– Backend/API layer (Next.js API routes, organized under apps/web/src/app/api)
g. External dependencies (e.g., Node.js, Vercel [if used for deployment]) for context.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    M["Monorepo (Turborepo)"]:::monorepo

    subgraph "Apps"
        WA["Next.js Web App"]:::app
        DS["Documentation Site (Mintlify)"]:::doc
    end

    subgraph "Packages"
        UI["Shared UI Components"]:::pkg
        TS["Shared TypeScript Configurations"]:::pkg
        ESL["Shared ESLint Configurations"]:::pkg
        TX["Transactional Emails & Utilities"]:::pkg
    end

    DevOps["DevOps & CI/CD Tools"]:::devops
    SUP["Supabase Backend"]:::db

    %% Monorepo contains apps and packages
    M -->|"contains"| WA
    M -->|"contains"| DS
    M -->|"contains"| UI
    M -->|"contains"| TS
    M -->|"contains"| ESL
    M -->|"contains"| TX
    M -->|"contains"| DevOps

    %% Next.js Web App internal separation
    subgraph "Web Application"
        FE["Frontend (Next.js Pages, Tailwind CSS)"]:::frontend
        API["API Layer (apps/web/src/app/api)"]:::backend
    end

    WA -->|"comprises"| FE
    WA -->|"comprises"| API

    %% Web App integrations
    FE -->|"renders"| WA
    API -->|"calls"| SUP

    %% Web App depends on shared packages
    WA -->|"uses"| UI
    WA -->|"uses"| TS
    WA -->|"uses"| ESL
    WA -->|"uses"| TX

    %% Documentation Site may reuse shared components
    DS -->|"may-use"| UI
    DS -->|"may-use"| TS

    %% DevOps interactions
    DevOps -->|"deploys"| WA
    DevOps -->|"integrates"| M

    %% Styles
    classDef monorepo fill:#fde2e2,stroke:#333,stroke-width:2px;
    classDef app fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef doc fill:#d3f8e2,stroke:#333,stroke-width:2px;
    classDef pkg fill:#e2d8fd,stroke:#333,stroke-width:2px;
    classDef devops fill:#fdf6e3,stroke:#333,stroke-width:2px;
    classDef frontend fill:#ffffff,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef backend fill:#ffcccc,stroke:#333,stroke-width:2px;
    classDef db fill:#fff2ae,stroke:#333,stroke-width:2px,stroke-dasharray: 3 3;

    %% Supabase is external (represented as a database)
    %% Click Events
    click M "https://github.com/rmit-nct/hub/blob/main/turbo.json"
    click WA "https://github.com/rmit-nct/hub/tree/main/apps/web"
    click FE "https://github.com/rmit-nct/hub/tree/main/apps/web/src/app"
    click API "https://github.com/rmit-nct/hub/tree/main/apps/web/src/app/api"
    click DS "https://github.com/rmit-nct/hub/tree/main/apps/docs"
    click UI "https://github.com/rmit-nct/hub/tree/main/packages/ui"
    click TS "https://github.com/rmit-nct/hub/tree/main/packages/typescript-config"
    click ESL "https://github.com/rmit-nct/hub/tree/main/packages/eslint-config"
    click TX "https://github.com/rmit-nct/hub/tree/main/packages/transactional"
    click SUP "https://github.com/rmit-nct/hub/tree/main/apps/web/supabase"
    click DevOps "https://github.com/rmit-nct/hub/tree/main/.github/workflows"
```
