# lrodriguesg12/mi-pagina-web architecture

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

- Interactive diagram: https://gitdiagram.com/lrodriguesg12/mi-pagina-web
- Repository: https://github.com/lrodriguesg12/mi-pagina-web

## Overview

##### Project type and purpose
- This is a full-stack React application template built on Vite + React Router, offering server-side rendering (SSR), hot-module replacement (HMR), asset bundling, TypeScript, and TailwindCSS.
- It’s designed to run in development via `npm run dev`, build a static client/server bundle via `npm run build`, and deploy either in a Docker container or directly to Firebase Hosting via GitHub Actions.

##### File structure
Top-level artifacts:
- Dockerfile – containerizes the Node/Vite SSR server and client assets
- firebase.json / .firebaserc / .firebase/* – Firebase Hosting configuration and deployment cache
- .github/workflows/*.yml – CI pipelines to build and deploy to Firebase on PR/merge
- vite.config.ts, tsconfig.json – Vite and TypeScript compiler setups
- package.json / package-lock.json – dependencies & scripts
Source layout:
- app/ – React entry point (root.tsx), CSS, and route components under app/routes/* and app/welcome
- react-router.config.ts – explicit route definitions (alternatively could be file-based routing)
- public/ – static assets served as-is
Key patterns:
- SSR + hydration: root.tsx boots on server and client
- File-based routing under app/routes
- CI/CD → Docker build → Firebase deploy

##### README for additional insights
- Emphasizes SSR, HMR, asset optimization, data loading/mutations, TypeScript, TailwindCSS
- Outlines Docker deployment and “DIY” static‐server option
- Mentions generated build artifacts: build/client and build/server

##### Detail without overthinking
- Both SSR rendering and client hydration steps
- Call out configuration files (Dockerfile, firebase.json) as part of the deployment component
- Automated triggers (GitHub Actions) that tie source changes to production

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Environment
    subgraph "Development Environment"
        Browser["Client (Browser)\napp/root.tsx\napp/app.css"]:::client
        StaticAssets["Public Assets\npublic/"]:::external
        DevServer["Vite Dev Server\nvite.config.ts\ntsconfig.json\npackage.json"]:::server
        subgraph "Routing"
            FileRoutes["File-Based Routing\napp/routes/home.tsx\napp/routes.ts\napp/welcome/welcome.tsx"]:::server
            ExplicitRoutes["Explicit Route Definitions\nreact-router.config.ts\n.react-router/types/"]:::server
        end
    end

    %% Production Deployment
    subgraph "Production Deployment"
        SSR["Production SSR Server\nDockerfile\n.dockerignore"]:::server
        Docker["Docker Container"]:::server
        FirebaseHosting["Firebase Hosting CDN\nfirebase.json\n.firebaserc\n.firebase/hosting.*.cache"]:::external
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        GH_PR["GitHub Actions PR Workflow\n.github/workflows/firebase-hosting-pull-request.yml"]:::ci
        GH_MERGE["GitHub Actions Merge Workflow\n.github/workflows/firebase-hosting-merge.yml"]:::ci
        Build["Build & Deploy"]:::ci
    end

    %% Data Layer
    DataLayer["Data Layer\n(Firebase APIs)"]:::external

    %% Connections - Development
    Browser -->|"Request (HTTP) "| DevServer
    DevServer -->|"Serves Assets / SSR"| Browser
    DevServer --> FileRoutes
    DevServer --> ExplicitRoutes
    Browser --> StaticAssets

    %% Connections - Production
    Browser -->|"Request (HTTPS)"| FirebaseHosting
    FirebaseHosting -->|"Serves Static Assets"| Browser
    Browser -->|"Request (HTTPS)"| SSR
    SSR -->|"Internal Data Calls"| DataLayer
    SSR --> FirebaseHosting

    SSR --> Docker

    %% CI/CD Connections
    GH_PR --> Build
    GH_MERGE --> Build
    Build --> Docker
    Build --> FirebaseHosting

    %% Click Events
    click Browser "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/app/root.tsx"
    click Browser "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/app/app.css"
    click StaticAssets "https://github.com/lrodriguesg12/mi-pagina-web/tree/main/public/"
    click DevServer "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/vite.config.ts"
    click DevServer "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/tsconfig.json"
    click DevServer "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/package.json"
    click FileRoutes "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/app/routes/home.tsx"
    click FileRoutes "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/app/routes.ts"
    click FileRoutes "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/app/welcome/welcome.tsx"
    click ExplicitRoutes "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/react-router.config.ts"
    click SSR "https://github.com/lrodriguesg12/mi-pagina-web/tree/main/Dockerfile"
    click SSR "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/.dockerignore"
    click FirebaseHosting "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/firebase.json"
    click FirebaseHosting "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/.firebaserc"
    click FirebaseHosting "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/.firebase/hosting.*.cache"
    click GH_PR "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/.github/workflows/firebase-hosting-pull-request.yml"
    click GH_MERGE "https://github.com/lrodriguesg12/mi-pagina-web/blob/main/.github/workflows/firebase-hosting-merge.yml"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366D6,stroke-width:1px;
    classDef server fill:#E2F5D7,stroke:#22863A,stroke-width:1px;
    classDef external fill:#F0DEFF,stroke:#6F42C1,stroke-width:1px;
    classDef ci fill:#FFEFD5,stroke:#D2691E,stroke-width:1px;
```
