# cavo789/blog architecture

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

- Interactive diagram: https://gitdiagram.com/cavo789/blog
- Repository: https://github.com/cavo789/blog

## Overview

##### Main Components

a. Development Environment:
- Docker Container (Development)
- VSCode with DevContainer support
- Local File System (blog content)
- Node.js/Yarn Environment

b. Production Environment:
- Docker Container (Production)
- Built Static Files
- Web Server (Apache/Nginx)

c. CI/CD Pipeline:
- GitHub Repository
- GitHub Actions
- FTP Deployment

##### Architecture Representation

- Development Layer                                       |

- Local Dev Env  |->| Docker Dev       |->| Docusaurus Dev   |->| Browser Preview  |   |
- (VSCode)       |  | Container        |  | Server           |  | (Live Reload)    |   |

- Build/Deploy Layer                                      |

- GitHub Repo    |->| GitHub Actions    |->| Build Process    |->| FTP Deployment   |   |
- (Source Code)  |  | (CI/CD Pipeline)  |  | (yarn build)     |  | to Host         |   |

- Production Layer                                        |

- Docker Prod    |->| Static Files      |->| Web Server       |                        |
- Container      |  | (Optimized)       |  | (Production)     |                        |

##### Important Elements to Highlight

- Docker configurations (show both dev and prod containers)
- Volume mappings for development
- GitHub Actions workflow
- Content organization (blog posts structure)
- Build process flow

##### Additional Details

Annotations for:
- Environment variables (MODE=development/production)
- Make commands for different operations
- Port mappings
- Mounted volumes
- Dependencies flow

##### Data Flow Indicators

Show:
- Local development file changes → Live reload
- Git push → GitHub Actions trigger
- Build process → Static file generation
- Deployment → Production server

##### Component Relationships

Emphasize:
- Development/Production container differences
- Content synchronization mechanisms
- Build pipeline stages
- Deployment process steps

Remember to:
- Use consistent symbols and notation
- Version information
- Document key configuration points

This architecture represents a modern JAMstack approach with clear separation between development, build, and production environments, while maintaining flexibility through Docker containerization and automated deployment processes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef development fill:#e1f5fe,stroke:#01579b
    classDef production fill:#e8f5e9,stroke:#1b5e20
    classDef deployment fill:#fff3e0,stroke:#e65100
    classDef config fill:#f3e5f5,stroke:#4a148c
    
    subgraph Development
        VSCode["VSCode DevContainer"]:::development
        DockerDev["Docker Development Container"]:::development
        DevServer["Docusaurus Dev Server"]:::development
        Preview["Browser Preview<br/>(Live Reload)"]:::development
        
        VSCode --> DockerDev
        DockerDev --> DevServer
        DevServer --> Preview
    end
    
    subgraph "Build and Deploy"
        GitRepo["GitHub Repository"]:::deployment
        GHActions["GitHub Actions<br/>CI/CD Pipeline"]:::deployment
        BuildProcess["Build Process<br/>(yarn build)"]:::deployment
        FTPDeploy["FTP Deployment"]:::deployment
        
        GitRepo --> GHActions
        GHActions --> BuildProcess
        BuildProcess --> FTPDeploy
    end
    
    subgraph Production
        DockerProd["Docker Production Container"]:::production
        StaticFiles["Static Files<br/>(Optimized)"]:::production
        WebServer["Web Server<br/>(Production)"]:::production
        
        DockerProd --> StaticFiles
        StaticFiles --> WebServer
    end
    
    subgraph Configuration
        EnvVars["Environment Variables"]:::config
        BuildConfig["Build Configuration"]:::config
        SiteConfig["Site Configuration"]:::config
        ContentMgmt["Content Management"]:::config
    end
    
    %% Relationships
    Development --> |"Git Push"| GitRepo
    BuildProcess --> StaticFiles
    
    %% Click Events
    click VSCode "https://github.com/cavo789/blog/blob/main/.devcontainer/devcontainer.json"
    click DockerDev "https://github.com/cavo789/blog/blob/main/docker-compose-dev.yml"
    click DockerProd "https://github.com/cavo789/blog/blob/main/docker-compose-prod.yml"
    click GHActions "https://github.com/cavo789/blog/blob/main/.github/workflows/deploy.yml"
    click WebServer "https://github.com/cavo789/blog/blob/main/static/.htaccess"
    click EnvVars "https://github.com/cavo789/blog/blob/main/.env.example"
    click BuildConfig "https://github.com/cavo789/blog/blob/main/babel.config.js"
    click SiteConfig "https://github.com/cavo789/blog/blob/main/docusaurus.config.js"
    click ContentMgmt "https://github.com/cavo789/blog/tree/main/blog"
    
    %% Legend
    classDef legend fill:#fff,stroke:#000
    subgraph Legend
        Dev["Development"]:::development
        Prod["Production"]:::production
        Dep["Deployment"]:::deployment
        Conf["Configuration"]:::config
    end
```
