# steve958/plant-centar architecture

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

- Interactive diagram: https://gitdiagram.com/steve958/plant-centar
- Repository: https://github.com/steve958/plant-centar

## Overview

##### Main Application Architecture Components

a) Frontend Layer (React + TypeScript)
- Present this as the topmost layer
- Sections:
- Public Area (Homepage, Gallery, Categories, etc.)
- E-commerce Area (WebShop)
- Admin Panel
- Authentication System

b) Backend Services
- Firebase Integration (noted from firebase.ts)
- Data Storage
- Authentication Services

##### Component Breakdown

Create distinct sections for:

a) Core Features
- Navigation System (Header, Menu)
- Content Management
- Shopping System
- Admin Management
- Image Gallery System

b) Business Logic Layer
- Shopping Cart Management
- Product Management
- User Authentication
- Admin Controls

##### Data Flow Representation

Following interactions:

a) Client-Side Routes
- Public Routes
- Protected Admin Routes
- E-commerce Routes

b) State Management
- Shopping Cart State
- Product State
- User Session State

##### Specific Implementation Details

- Public Components
- Homepage
- Gallery
- Categories
- E-commerce Components
- Shop
- Cart
- Checkout
- Admin Components
- Login
- Management Panel

##### Interaction Flows

- User Authentication Flow
- Shopping Process Flow
- Admin Management Flow
- Data Synchronization

##### Technical Stack Indicators

Technology badges for:
- React
- TypeScript
- Vite
- Firebase
- CSS Modules

Design Guidelines:

##### Use a top-down hierarchy
- User Interface Layer (Top)
- Business Logic Layer (Middle)
- Data Layer (Bottom)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Layer"
        UI_Public["Public Area"]
        UI_Shop["E-commerce Area"]
        UI_Admin["Admin Area"]
        UI_Auth["Authentication"]
    end

    subgraph "Public Components"
        Homepage["Homepage"]:::component
        Gallery["Gallery"]:::component
        Categories["Categories"]:::component
        Header["Header"]:::component
        Menu["Menu"]:::component
        Footer["Footer"]:::component
    end

    subgraph "E-commerce Components"
        WebShop["WebShop"]:::component
        Cart["Shopping Cart"]:::component
        Checkout["Checkout"]:::component
        ItemDetails["Product Details"]:::component
        ItemCard["Item Card"]:::component
    end

    subgraph "Admin Components"
        AdminPanel["Admin Panel"]:::component
        AdminLogin["Admin Login"]:::component
        PrivateRoute["Protected Routes"]:::component
        ItemCardAdmin["Admin Item Management"]:::component
    end

    subgraph "Backend Services"
        Firebase["Firebase Configuration"]:::backend
        DataStorage[(Data Storage)]:::storage
        AuthService{"Authentication Service"}:::service
    end

    subgraph "Asset Management"
        ProductImages["Product Images"]:::asset
        CompanyImages["Company Images"]:::asset
        PartnerImages["Partner Images"]:::asset
    end

    UI_Public --> Homepage
    UI_Public --> Gallery
    UI_Public --> Categories
    UI_Public --> Header
    UI_Public --> Menu
    UI_Public --> Footer

    UI_Shop --> WebShop
    WebShop --> Cart
    WebShop --> Checkout
    WebShop --> ItemDetails
    WebShop --> ItemCard

    UI_Admin --> AdminPanel
    UI_Admin --> AdminLogin
    UI_Admin --> PrivateRoute
    AdminPanel --> ItemCardAdmin

    UI_Auth --> AuthService
    AuthService --> Firebase
    Firebase --> DataStorage

    ItemCard --> ProductImages
    Homepage --> CompanyImages
    Homepage --> PartnerImages

    %% Click events for component mapping
    click Homepage "https://github.com/steve958/plant-centar/blob/master/src/components/Homepage/Homepage.tsx"
    click Gallery "https://github.com/steve958/plant-centar/blob/master/src/components/Gallery/Gallery.tsx"
    click Categories "https://github.com/steve958/plant-centar/tree/master/src/components/Categories"
    click WebShop "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/WebShop.tsx"
    click Cart "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/ShopComponents/Cart/Cart.tsx"
    click Checkout "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/ShopComponents/Checkout/Checkout.tsx"
    click ItemDetails "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/ShopComponents/ItemDetails/ItemDetails.tsx"
    click AdminPanel "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/Admin/AdminPanel/AdminPanel.tsx"
    click AdminLogin "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/Admin/AdminLogIn/AdminLogIn.tsx"
    click PrivateRoute "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/Admin/PrivateRoute/PrivateRoute.tsx"
    click Header "https://github.com/steve958/plant-centar/blob/master/src/components/Header/Header.tsx"
    click Menu "https://github.com/steve958/plant-centar/blob/master/src/components/Menu/Menu.tsx"
    click Footer "https://github.com/steve958/plant-centar/blob/master/src/components/Footer/Footer.tsx"
    click ItemCard "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/ShopComponents/ItemCard/ItemCard.tsx"
    click ItemCardAdmin "https://github.com/steve958/plant-centar/blob/master/src/components/WebShop/Admin/AdminPanel/components/ItemCardAdmin/ItemCardAdmin.tsx"
    click Firebase "https://github.com/steve958/plant-centar/blob/master/src/components/firebase.ts"
    click ProductImages "https://github.com/steve958/plant-centar/tree/master/src/assets/fruits"
    click CompanyImages "https://github.com/steve958/plant-centar/tree/master/src/assets/firma"
    click PartnerImages "https://github.com/steve958/plant-centar/tree/master/src/assets/partneri"

    %% Styling
    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#e74c3c,stroke:#c0392b,color:white
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:white
    classDef asset fill:#2ecc71,stroke:#27ae60,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::component
        L2["Backend Service"]:::backend
        L3["Data Storage"]:::storage
        L4["Service Integration"]:::service
        L5["Asset Storage"]:::asset
    end
```
