# eliasmolina023/provetecnia-sync-field architecture

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

- Interactive diagram: https://gitdiagram.com/eliasmolina023/provetecnia-sync-field
- Repository: https://github.com/eliasmolina023/provetecnia-sync-field

## Overview

##### Project type and purpose
- This is a single‐page dashboard application (SPA) implemented in React + TypeScript, built with Vite, styled via Tailwind CSS and shadcn-ui.
- Its purpose is to present multiple pages (Dashboard, Servicios, Usuarios, Viáticos, Reportes) under a common layout (ProvetecniaLayout) and a custom UI component library.

##### File structure
- Top-level config: package.json, tsconfig*.json, vite.config.ts, tailwind.config.ts, eslint.config.js.
- public/: static assets (index.html, robots.txt).
- src/main.tsx: application entry point.
- src/App.tsx & src/App.css: root component and global styles.
- src/pages/: route components for each view.
- src/components/layout/: the shell (ProvetecniaLayout).
- src/components/dashboard/: dashboard‐specific widgets.
- src/components/ui/: shadcn-ui primitives and custom UI building blocks (buttons, cards, dialogs, etc.).
- src/hooks/, src/lib/: custom hooks and utility functions.

##### Key insights from README
- No backend in repo; purely frontend.
- Dev flow revolves around Lovable (for in-browser editing & auto commits) and local IDE + npm/Vite dev server.
- Deployment is “Publish” via Lovable to a static host, with optional custom domains.

a. Main components
- Developer Workstation (IDE + Git CLI or Lovable UI)
- Source Repository (GitHub or Lovable’s Git backend)
- CI/CD / Build Pipeline (Vite bundler + Tailwind compiler + npm scripts)
- Hosting/CDN (Netlify/Vercel or Lovable’s static hosting)
- Browser (end user)

b. Relationships & data flows
- Developer pushes code → Git repo
- Git hook or Lovable UI auto-triggers build → Vite compiles TSX + tailwind → produces static assets
- Built assets deployed to CDN/host
- Browser requests index.html → JS bundles loaded → React Router renders src/pages under ProvetecniaLayout
- User interactions → React state/hooks/utility functions → UI updates

c. Architectural patterns & principles
- Component-based design: UI primitives in src/components/ui, composed into higher‐level widgets and pages
- Feature/route folder organization (pages)
- Single entry point (main.tsx → App.tsx) with client-side routing
- Utility abstraction (src/lib/utils.ts) and custom hooks (src/hooks)

d. Key technologies
- Vite (dev server & bundler)
- React + React Router (routing via pages folder)
- TypeScript
- Tailwind CSS & shadcn-ui (design system)
- npm/Yarn (package management)

##### Essential detail checklist
- Separation of concerns: Dev vs. Build vs. Runtime
- Central React App (main.tsx → App.tsx) and routing layer
- Detail component hierarchy: layout → pages → widgets → UI primitives
- Optional custom domain and DNS pointing at CDN/hosting

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer & Source Control
    subgraph "Developer & Source Control"
        Dev("Developer Workstation"):::dev
        Repo("Git Repository"):::repo
    end

    Dev -->|"push code"| Repo

    %% CI/CD & Build Pipeline
    subgraph "CI/CD / Build Pipeline"
        Build("Vite Build Pipeline"):::build
        Config("Build & Tooling Config"):::config
        Config --> Build
        Repo -->|"git hook / Lovable UI"| Build
    end

    %% Hosting
    subgraph "Static Hosting / CDN"
        CDN("Static Host / CDN"):::host
        Repo -->|"npm run build"| Build
        Build -->|"deploy static assets"| CDN
    end

    %% Browser Runtime
    subgraph "Browser (SPA Runtime)"
        Browser("Browser"):::browser
        CDN -->|"request index.html"| Browser

        subgraph "React Application"
            Entry["src/main.tsx"]:::module
            App["src/App.tsx"]:::module
            Styles["Global Styles (src/App.css, src/index.css)"]:::module
            Router("React Router"):::module
            subgraph "Layout Shell"
                Layout["ProvetecniaLayout"]:::submodule
            end
            subgraph "Pages"
                Index["Index.tsx"]:::submodule
                DashboardPage["Dashboard.tsx"]:::submodule
                Servicios["Servicios.tsx"]:::submodule
                Usuarios["Usuarios.tsx"]:::submodule
                Viaticos["Viaticos.tsx"]:::submodule
                Reportes["Reportes.tsx"]:::submodule
                NotFound["NotFound.tsx"]:::submodule
            end
            subgraph "Dashboard Widgets"
                RecentServices["RecentServices.tsx"]:::submodule
                StatsCard["StatsCard.tsx"]:::submodule
            end
            subgraph "UI Primitives"
                UIPkg["src/components/ui/"]:::primitive
            end
            subgraph "Hooks & Utils"
                Hooks["src/hooks/"]:::primitive
                Utils["src/lib/utils.ts"]:::primitive
            end
        end

        Browser -->|"load bundles"| Entry
        Entry --> App
        App --> Styles
        App --> Router
        Router --> Layout
        Layout --> Pages
        DashboardPage --> RecentServices
        DashboardPage --> StatsCard
        RecentServices --> UIPkg
        StatsCard --> UIPkg
        Pages --> UIPkg
        App --> Hooks
        App --> Utils
    end

    %% Click Events
    click Entry "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/main.tsx"
    click App "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/App.tsx"
    click Styles "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/App.css"
    click Styles "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/index.css"
    click Layout "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/components/layout/ProvetecniaLayout.tsx"
    click Index "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Index.tsx"
    click DashboardPage "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Dashboard.tsx"
    click Servicios "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Servicios.tsx"
    click Usuarios "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Usuarios.tsx"
    click Viaticos "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Viaticos.tsx"
    click Reportes "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/Reportes.tsx"
    click NotFound "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/pages/NotFound.tsx"
    click RecentServices "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/components/dashboard/RecentServices.tsx"
    click StatsCard "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/components/dashboard/StatsCard.tsx"
    click UIPkg "https://github.com/eliasmolina023/provetecnia-sync-field/tree/main/src/components/ui/"
    click Hooks "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/hooks/use-mobile.tsx"
    click Hooks "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/src/lib/utils.ts"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/vite.config.ts"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/tailwind.config.ts"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/postcss.config.js"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/tsconfig.json"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/tsconfig.app.json"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/tsconfig.node.json"
    click Config "https://github.com/eliasmolina023/provetecnia-sync-field/blob/main/eslint.config.js"

    %% Styles
    classDef dev fill:#f9f,stroke:#333,stroke-width:1px
    classDef repo fill:#bbf,stroke:#333,stroke-width:1px
    classDef build fill:#bfb,stroke:#333,stroke-width:1px
    classDef config fill:#fea,stroke:#333,stroke-width:1px
    classDef host fill:#afa,stroke:#333,stroke-width:1px
    classDef browser fill:#fef,stroke:#333,stroke-width:1px
    classDef module fill:#def,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef submodule fill:#ffd,stroke:#333,stroke-width:1px
    classDef primitive fill:#dff,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
