# eliasmolina023/carrier-connect-app architecture

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

- Interactive diagram: https://gitdiagram.com/eliasmolina023/carrier-connect-app
- Repository: https://github.com/eliasmolina023/carrier-connect-app

## Overview

##### Project type and purpose
- This is a single­-page front-end application built with Vite, React, TypeScript, Tailwind CSS, and the shadcn-ui component library.
- It has no dedicated backend in this repo; it’s meant to be served as static assets (via Lovable, a CDN, or other static hosts).

##### File structure
- Top level:
- vite.config.ts, tsconfig*.json, tailwind.config.ts – build & config files
- package.json, bun.lockb, package-lock.json – dependency manifests
- index.html – the HTML host
- public/ – static assets (robots.txt, images, etc.)
- src/ – application code
- main.tsx – entry point
- App.tsx & App.css – root component + global styles
- components/ – reusable UI and page­-specific components
– ui/ – shadcn-ui primitives and wrappers
– feature components: TrackingSearch, TrackingResult, RoleSelector, Header, Footer, etc.
- pages/ – route entrypoints (Index.tsx, NotFound.tsx)
- hooks/ – custom React hooks (use-mobile, use-toast)
- lib/ – shared utilities

##### README for additional insights
- Confirms tech stack: Vite, TS, React, shadcn-ui, Tailwind.
- Deployment is static via Lovable, no server code.

##### Final recommendations
- Related source directories into logical clusters (Routing, UI Library, Features, Utilities).
- Component with its folder path (e.g., `components/ui/*` for primitives).
- Build pipeline as a first step, then the runtime flow inside the browser.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        Dev["Developer Machine"]:::build
        Vite["Vite Build"]:::build
        Dev -->|npm run build| Vite

        subgraph "Config Files"
            direction TB
            ViteConfig["vite.config.ts"]:::build
            TSConfigs["tsconfig.json,\ntsconfig.app.json,\ntsconfig.node.json"]:::build
            TailwindConfig["tailwind.config.ts"]:::build
            PackageManifests["package.json,\npackage-lock.json,\nbun.lockb"]:::build
        end
        Vite -->|reads| ViteConfig
        Vite -->|reads| TSConfigs
        Vite -->|reads| TailwindConfig
        Vite -->|reads| PackageManifests

        Dist["dist/ (static output)"]:::host
        Vite -->|outputs| Dist
    end

    %% Hosting
    subgraph "Hosting / CDN"
        direction TB
        Host["Static Host / CDN"]:::host
        HTML["index.html"]:::host
        Public["public/"]:::host
        Dist --> Host
        Host -->|serves| HTML
        Host -->|serves| Public
    end

    %% Runtime in Browser
    Host -->|browser GET| Browser["Browser / Client"]:::runtime

    subgraph "React App (SPA)" 
        direction TB
        Entry["src/main.tsx"]:::runtime
        Browser -->|loads| HTML
        HTML -->|loads| Entry

        subgraph "Routing Layer"
            direction TB
            IndexPage["Index.tsx"]:::component
            NotFoundPage["NotFound.tsx"]:::component
            Entry --> Router["React Router"]:::runtime
            Router -->|route '/ '| IndexPage
            Router -->|route '*'| NotFoundPage
        end

        subgraph "UI Layer"
            direction TB
            Primitives["shadcn-ui Primitives"]:::component
            FeatureUI["Feature Components"]:::component
            Entry --> UI["UI Layer"]:::runtime
            UI --> Primitives
            UI --> FeatureUI
        end

        subgraph "Feature Components"
            direction TB
            TrackingSearch["TrackingSearch.tsx"]:::component
            TrackingResult["TrackingResult.tsx"]:::component
            RoleSelector["RoleSelector.tsx"]:::component
            Header["Header.tsx"]:::component
            Footer["Footer.tsx"]:::component
            FeaturesWrapper["Features.tsx"]:::component
            FeatureUI --> TrackingSearch
            FeatureUI --> TrackingResult
            FeatureUI --> RoleSelector
            FeatureUI --> Header
            FeatureUI --> Footer
            FeatureUI --> FeaturesWrapper
        end

        subgraph "Hooks & State"
            direction TB
            UseMobile["use-mobile.tsx"]:::hook
            UseToast["use-toast.ts"]:::hook
            UI --> Hooks["Hooks & State"]:::runtime
            Hooks --> UseMobile
            Hooks --> UseToast
        end

        subgraph "Utilities"
            direction TB
            Utils["src/lib/utils.ts"]:::util
            Entry --> Utils
        end

        subgraph "External Services"
            direction TB
            API["Shipment Tracking API"]:::external
            TrackingSearch -->|fetch| API
            TrackingResult -->|fetch| API
        end
    end

    %% Click Events
    click ViteConfig "https://github.com/eliasmolina023/carrier-connect-app/blob/main/vite.config.ts"
    click TSConfigs "https://github.com/eliasmolina023/carrier-connect-app/blob/main/tsconfig.json"
    click TSConfigs "https://github.com/eliasmolina023/carrier-connect-app/blob/main/tsconfig.app.json"
    click TSConfigs "https://github.com/eliasmolina023/carrier-connect-app/blob/main/tsconfig.node.json"
    click TailwindConfig "https://github.com/eliasmolina023/carrier-connect-app/blob/main/tailwind.config.ts"
    click PackageManifests "https://github.com/eliasmolina023/carrier-connect-app/blob/main/package.json"
    click PackageManifests "https://github.com/eliasmolina023/carrier-connect-app/blob/main/package-lock.json"
    click PackageManifests "https://github.com/eliasmolina023/carrier-connect-app/blob/main/bun.lockb"
    click HTML "https://github.com/eliasmolina023/carrier-connect-app/blob/main/index.html"
    click Public "https://github.com/eliasmolina023/carrier-connect-app/tree/main/public/"
    click Entry "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/main.tsx"
    click IndexPage "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/pages/Index.tsx"
    click NotFoundPage "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/pages/NotFound.tsx"
    click Primitives "https://github.com/eliasmolina023/carrier-connect-app/tree/main/src/components/ui/"
    click UseMobile "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/lib/utils.ts"
    click TrackingSearch "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/TrackingSearch.tsx"
    click TrackingResult "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/TrackingResult.tsx"
    click RoleSelector "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/RoleSelector.tsx"
    click Header "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/Header.tsx"
    click Footer "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/Footer.tsx"
    click FeaturesWrapper "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/components/Features.tsx"
    click Entry "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/App.tsx"
    click Entry "https://github.com/eliasmolina023/carrier-connect-app/blob/main/src/App.css"

    %% Styles
    classDef build fill:#cccccc,stroke:#333,stroke-width:1px
    classDef host fill:#bbdefb,stroke:#1e88e5,stroke-width:1px
    classDef runtime fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px
    classDef component fill:#ffe082,stroke:#f57f17,stroke-width:1px
    classDef hook fill:#ffcc80,stroke:#ef6c00,stroke-width:1px
    classDef util fill:#d7ccc8,stroke:#5d4037,stroke-width:1px
    classDef external fill:#ffab91,stroke:#d84315,stroke-width:1px
```
