# mrredu/site architecture

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

- Interactive diagram: https://gitdiagram.com/mrredu/site
- Repository: https://github.com/mrredu/site

## Overview

##### Main Components

Frontend Layer:
- Next.js Application (React)
- Pages/Routes Structure
- Component Architecture (Atomic Design)
- Client-side State Management
- UI Components Library

Backend Layer:
- Strapi Backend (indicated by the config structure)
- API Routes
- Admin Panel
- Authentication System
- Content Management System
- File Upload System

Database Layer:
- Database System (likely SQL based on Strapi's default)
- Migrations Management

**[Client Tier]**
- ↕️
**[Application Tier]**
- ↕️
**[Data Tier]**

##### Connection and Flow Representation

- → for HTTP/API calls
- ⇢ for internal component communication
- ⇄ for two-way data flow

- Blue: Frontend components
- Green: Backend services
- Yellow: Database layer
- Purple: External services/APIs

##### Additional Elements

- Component types
- Environment boundaries

##### Technical Stack Indicators

- Next.js
- Strapi
- Tailwind CSS
- TypeScript
- Database system

Remember to include:
- Authentication flow
- Media handling
- Cart state management
- Collection/Product data flow
- Admin panel integration

This will provide a comprehensive view of the system while maintaining clarity and usefulness for development team members.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE[Next.js Frontend]
        subgraph Pages
            PR["Pages Router"]:::frontend
            Cart["Cart Management"]:::frontend
            Col["Collections"]:::frontend
            Contact["Contact System"]:::frontend
        end
        
        subgraph Components
            subgraph Atomic["Atomic Design"]
                Atoms["Atoms"]:::frontend
                Mol["Molecules"]:::frontend
                Org["Organisms"]:::frontend
            end
            UI["UI Components"]:::frontend
        end
        
        subgraph Utils
            Lib["Libraries & Utils"]:::frontend
        end
    end
    
    subgraph Server
        BE[Strapi Backend]
        subgraph Backend
            API["API Routes"]:::backend
            Admin["Admin Panel"]:::backend
            CMS["Content Types"]:::backend
            Auth["Authentication"]:::backend
            Ext["Extensions"]:::backend
            Media["Media Handler"]:::backend
        end
    end
    
    subgraph Data
        DB[(Database)]:::database
        Files["File Storage"]:::storage
    end
    
    %% Connections
    FE --> BE
    PR --> API
    Cart --> API
    Col --> API
    Contact --> API
    
    BE --> DB
    Media --> Files
    
    %% Component Relationships
    Atoms --> Mol
    Mol --> Org
    Org --> PR
    
    %% Styling
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef backend fill:#4CAF50,stroke:#2E7D32,color:white
    classDef database fill:#FFC107,stroke:#FFA000,color:black
    classDef storage fill:#9C27B0,stroke:#7B1FA2,color:white
    
    %% Click Events
    click PR "https://github.com/MrRedu/site/tree/main/frontend/src/app/(pages)"
    click Cart "https://github.com/MrRedu/site/tree/main/frontend/src/app/(pages)/cart"
    click Col "https://github.com/MrRedu/site/tree/main/frontend/src/app/(pages)/collections"
    click Contact "https://github.com/MrRedu/site/tree/main/frontend/src/app/(pages)/contact"
    click Atoms "https://github.com/MrRedu/site/tree/main/frontend/src/components/atoms"
    click Mol "https://github.com/MrRedu/site/tree/main/frontend/src/components/molecules"
    click Org "https://github.com/MrRedu/site/tree/main/frontend/src/components/organisms"
    click UI "https://github.com/MrRedu/site/tree/main/frontend/src/components/ui"
    click Lib "https://github.com/MrRedu/site/tree/main/frontend/src/lib"
    click Admin "https://github.com/MrRedu/site/tree/main/backend/src/admin"
    click API "https://github.com/MrRedu/site/tree/main/backend/src/api"
    click DB "https://github.com/MrRedu/site/blob/main/backend/config/database.ts"
    click Files "https://github.com/MrRedu/site/tree/main/backend/public/uploads"
    click Ext "https://github.com/MrRedu/site/tree/main/backend/src/extensions"
```
