# ehsanpo/astro-template architecture

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

- Interactive diagram: https://gitdiagram.com/ehsanpo/astro-template
- Repository: https://github.com/ehsanpo/astro-template

## Overview

##### Main System Components

The system architecture should be divided into these key components:

a) Frontend Layer
- Main Website (Astro + React)
- Admin Panel (React/TypeScript)
- Client-side Routing
- Theme System (Dark/Light mode)

b) Content Management Layer
- Static Content (Markdown files)
- JSON Data Store
- Asset Management

c) Build & Deployment Layer
- Static Site Generation
- Asset Pipeline
- GitHub Actions Workflow

##### Component Relationships

**[GitHub Actions] → [Build Process] → [Static Site]**
- ↑
**[Admin Panel] → [Content Management] → [JSON/MD Files]**
- ↑
- [Assets/Images]

##### Detailed Component Breakdown

a) Core Applications (Rectangles):
- Blue: Main Astro Application
- Green: Admin Panel
- Purple: Build System

- Yellow: JSON Data Files
- Orange: Markdown Content
- Gray: Static Assets

c) Features (Rounded Rectangles):
- Portfolio Showcase
- Skills & Experience
- Services Section
- Contact Form
- Dark Mode Toggle

##### Data Flow Indicators

- Content update flow
- Build process flow
- Asset delivery
- Client-side navigation
- Theme switching

##### Architectural Patterns to Highlight

- Island Architecture (Astro)
- Static Site Generation
- Component-based Structure
- Content-driven Architecture

##### Implementation Details

a) Frontend Structure:
**[Pages] → [Layouts] → [Components]**
- ↑
**[Styles/TailwindCSS] → [UI Components]**

b) Content Management:
**[Admin Panel] → [File Handlers] → [Content Files]**
- → [Data JSON]
- → [Assets]

##### Build/Deploy Layer (Side)

This will help developers understand both the current architecture and potential areas for future expansion or modification.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        MainWeb["Main Website (Astro + React)"]
        AdminUI["Admin Panel"]
        Router["Client-side Routing"]
        Theme["Theme System"]
        
        subgraph Features
            Portfolio["Portfolio Section"]
            Skills["Skills & Experience"]
            Services["Services Section"]
            Contact["Contact Form"]
            Resume["Resume Section"]
            Timeline["Timeline Display"]
        end
        
        subgraph Layout
            Header["Header/Navigation"]
            Footer["Footer"]
            UIComps["UI Components"]
        end
    end
    
    subgraph "Content Management"
        CMS["Content Management System"]
        FileHandler["File Handlers"]
        Types["Type Definitions"]
        Utils["Utility Functions"]
    end
    
    subgraph Storage
        StaticContent["Static Content (MD)"]
        JSONStore["JSON Data Store"]
        Assets["Asset Storage"]
    end
    
    subgraph "Build & Deploy"
        Actions["GitHub Actions"]
        Build["Build Process"]
        Config["Build Configuration"]
    end
    
    MainWeb --> Router
    MainWeb --> Theme
    MainWeb --> Features
    MainWeb --> Layout
    
    AdminUI --> FileHandler
    FileHandler --> StaticContent
    FileHandler --> JSONStore
    FileHandler --> Assets
    
    CMS --> Types
    CMS --> Utils
    
    Build --> MainWeb
    Actions --> Build
    Config --> Build
    
    %% Component Mappings
    click AdminUI "https://github.com/ehsanpo/astro-template/tree/main/AdminPanel"
    click MainWeb "https://github.com/ehsanpo/astro-template/tree/main/src"
    click StaticContent "https://github.com/ehsanpo/astro-template/tree/main/src/content"
    click JSONStore "https://github.com/ehsanpo/astro-template/tree/main/src/data"
    click Assets "https://github.com/ehsanpo/astro-template/tree/main/public"
    click Config "https://github.com/ehsanpo/astro-template/blob/main/astro.config.mjs"
    click Actions "https://github.com/ehsanpo/astro-template/blob/main/.github/workflows/deploy.yml"
    click Portfolio "https://github.com/ehsanpo/astro-template/tree/main/src/components/portfolio"
    click Skills "https://github.com/ehsanpo/astro-template/tree/main/src/components/skills"
    click Services "https://github.com/ehsanpo/astro-template/tree/main/src/components/services"
    click Contact "https://github.com/ehsanpo/astro-template/tree/main/src/components/contact"
    click Theme "https://github.com/ehsanpo/astro-template/blob/main/src/components/ThemeToggle.astro"
    click Router "https://github.com/ehsanpo/astro-template/tree/main/src/pages"
    click Types "https://github.com/ehsanpo/astro-template/blob/main/src/content/config.ts"
    click UIComps "https://github.com/ehsanpo/astro-template/tree/main/src/components/ui"
    click Layout "https://github.com/ehsanpo/astro-template/tree/main/src/layouts"
    click FileHandler "https://github.com/ehsanpo/astro-template/blob/main/AdminPanel/src/utils/fileHandlers.ts"
    click Resume "https://github.com/ehsanpo/astro-template/tree/main/src/components/resume"
    click Timeline "https://github.com/ehsanpo/astro-template/tree/main/src/components/timeline"
    click Header "https://github.com/ehsanpo/astro-template/tree/main/src/components/nav"
    click Footer "https://github.com/ehsanpo/astro-template/tree/main/src/components/footer"
    click Utils "https://github.com/ehsanpo/astro-template/blob/main/src/lib/utils.ts"
    
    %% Styling
    classDef frontend fill:#3b82f6,color:#fff
    classDef storage fill:#f59e0b,color:#fff
    classDef cms fill:#10b981,color:#fff
    classDef build fill:#8b5cf6,color:#fff
    classDef feature fill:#6366f1,color:#fff
    
    class MainWeb,AdminUI,Router,Theme,Layout,UIComps,Header,Footer frontend
    class StaticContent,JSONStore,Assets storage
    class CMS,FileHandler,Types,Utils cms
    class Actions,Build,Config build
    class Portfolio,Skills,Services,Contact,Resume,Timeline feature
```
