# claudiosalazar/blog-fotografo architecture

> Architecture diagram of the GitHub repository claudiosalazar/blog-fotografo, 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/claudiosalazar/blog-fotografo
- Repository: https://github.com/claudiosalazar/blog-fotografo

## Overview

##### Main Components
- Frontend Application (Next.js/React):
- Contains the user interface divided into several areas:
▪ Authentication section ((auth)) – for login and session management.
▪ Dashboard section ((dashboard)) – where administrative functions such as managing biografia, blog content, galleries, and a general summary are handled.
▪ Public site section ((sitio-publico)) – where end users access the published blog posts, galleries, biografía and the home page.
- Shared components (found in src/app/components) for reusable UI elements like Header, Footer, Loading component, and other specialized widgets (e.g., carousels, modals, image galleries).
- Styles and theme files using SCSS, Tailwind, and PostCSS.

- Backend Server (Node.js based):
- Acts as a RESTful (or possibly GraphQL) API server listening on port 3001 (as indicated in the README).
- Responsible for interfacing with the MySQL database to serve dynamic content to the frontend.

- Database (MySQL):
- Manages the persistent storage of blog posts, images, user data and other necessary content.

##### Relationships and Interactions
- Client Browser ↔ Frontend (Next.js):
- Users access the public site (and authenticate via the auth route) via their web browsers.
- In the dashboard, administrators interact with the system to update or manage content.

- Frontend ↔ Backend (Node.js API):
- The Next.js application makes API calls (e.g., via fetchData.tsx) to the backend running at http://localhost:3001 for dynamic content retrieval and data manipulation.

- Backend ↔ MySQL Database:
- The backend server communicates with the MySQL database, executing queries to load or update blog content, images, and related details.

##### Architectural Patterns & Design Principles
- Modular Design – Separation between concerns:
- Clear separation between public site, authentication, and dashboard modules within the frontend.
- The use of components to promote reusability (as seen in the src/app/components folders).
- MVC/Component-Based UI (React’s declarative components) in the frontend.
- RESTful API layer between the frontend and backend.
- Responsive design principles using Next.js and Tailwind/PostCSS for styling.

##### Relevant Technologies, Frameworks, and Libraries
- Frontend:
- Next.js (v15) and React (v19)
- SCSS for styling, Tailwind CSS, PostCSS
- Utility components for common functions such as date formatting (FormatoFecha.tsx) and URL handling.

- Backend:
- Node.js (runtime environment for JavaScript)
- Likely an Express.js or similar framework to handle HTTP requests.

- Database:
- MySQL
- Libraries/drivers for interfacing with MySQL (e.g., mysql2 or sequelize if using an ORM).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client"
        Browser["Browser"]:::client
    end

    subgraph "Frontend Application (Next.js/React)"
        Auth["Authentication (auth)"]:::frontend
        Dashboard["Dashboard (admin)"]:::frontend
        Public["Public Site (sitio-publico)"]:::frontend
        Shared["Shared Components"]:::frontend
        Utility["Utility Functions"]:::frontend
        subgraph "Styling & Themes"
            Global["Global Styles"]:::styles
            SCSS["SCSS Files"]:::styles
            Config["Tailwind/PostCSS Conf"]:::styles
        end
    end

    subgraph "Backend Server (Node.js API)"
        Backend["API Server (Node.js)\n(http://localhost:3001)"]:::backend
    end

    subgraph "Database"
        Database[(MySQL Database)]:::database
    end

    Browser -->|"Accesses"| Public
    Browser -->|"Accesses"| Auth
    Browser -->|"Accesses"| Dashboard

    Public -->|"API_Request"| Backend
    Auth -->|"API_Request"| Backend
    Dashboard -->|"API_Request"| Backend

    Backend -->|"Data_Operations"| Database

    Dashboard ---|"Uses"| Shared
    Public ---|"Uses"| Shared
    Auth ---|"Uses"| Shared

    Shared ---|"Utilizes"| Utility
    Shared ---|"Styled_By"| Global
    Shared ---|"Styled_By"| SCSS
    Shared ---|"Styled_By"| Config

    click Auth "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/(auth)"
    click Dashboard "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/(dashboard)"
    click Public "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/(sitio-publico)"
    click Shared "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/components"
    click Utility "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/utility"
    click Global "https://github.com/claudiosalazar/blog-fotografo/blob/main/src/app/globals.scss"
    click SCSS "https://github.com/claudiosalazar/blog-fotografo/tree/main/src/app/scss"
    click Config "https://github.com/claudiosalazar/blog-fotografo/blob/main/tailwind.config.ts / postcss.config.mjs"

    classDef client fill:#FFD700,stroke:#DAA520,stroke-width:2px;
    classDef frontend fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#008000,stroke-width:2px;
    classDef database fill:#FFB6C1,stroke:#FF69B4,stroke-width:2px;
    classDef styles fill:#E6E6FA,stroke:#8A2BE2,stroke-width:2px;
```
