# vkwhm/trabzondmt-site architecture

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

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

## Overview

##### Main Components

A. Frontend Layer (React/TypeScript):
- Admin Panel (assets/admin/*)
- Public App Interface (assets/app/*)

B. Backend Layer (Symfony):
- API Platform (config/packages/api_platform.yaml)
- Controllers
- Entity Layer
- Repository Layer
- Security Layer

C. Database Layer:
- Tables for main entities (CalendarDate, CalendarEvent, User, ImageInformation)

**[Client Layer]**
- ↓↑
**[API/Security Layer]**
- ↓↑
**[Application Layer]**
- ↓↑
**[Persistence Layer]**

##### Specific Component Details

Frontend Section:
1. Admin Panel
- CRUD operations (Creates, Edits, Lists, Shows)
- Authentication provider
2. Public Application
- Calendar interface
- Image carousel
- Search functionality
- Weekly timeline

Backend Section:
- API Platform endpoints
- Security layer (AccessTokenHandler)
- Controllers (AdminController, MainController)
- Entity managers
- Repository layer

Database Section:
- Entity relationships
- Main tables with key fields
- Migration handling

##### Key Interactions to Highlight

- Authentication flow
- Image upload process
- Calendar data retrieval
- Search operations
- Admin CRUD operations

##### Technical Stack Indicators

Technology badges/labels for:
- Symfony
- React
- TypeScript
- API Platform
- Doctrine ORM
- Vite
- Tailwind CSS

##### Additional Elements

- Service worker flow for offline capabilities
- Static asset handling (public directory)
- CORS configuration
- Caching mechanisms

##### Implementation Notes

- Historical data management flow
- How the calendar data is organized and served
- Image handling pipeline

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Admin["Admin Panel Interface"]
        Public["Public Application Interface"]
        
        subgraph AdminComponents
            Creates["Creates"]
            Edits["Edits"]
            Lists["Lists"]
            Shows["Shows"]
            AuthProvider["Authentication Provider"]
        end
        
        subgraph PublicComponents
            ImageCarousel["Image Carousel"]
            SearchBox["Search Box"]
            WeeklyTimeline["Weekly Timeline"]
        end
    end
    
    subgraph API
        CORS["CORS Configuration"]
        APIPlat["API Platform"]
        Security["Security Layer"]
        ServiceWorker["Service Worker"]
    end
    
    subgraph Backend
        Controllers["Controllers"]
        
        subgraph Entities
            CalendarDate["CalendarDate"]
            CalendarEvent["CalendarEvent"]
            User["User"]
            ImageInfo["ImageInformation"]
        end
        
        subgraph Repositories
            CalendarDateRepo["CalendarDate Repository"]
            CalendarEventRepo["CalendarEvent Repository"]
            UserRepo["User Repository"]
            ImageInfoRepo["ImageInformation Repository"]
        end
    end
    
    subgraph Database
        DB[(Database)]
    end
    
    %% Relationships
    Admin --> APIPlat
    Public --> APIPlat
    APIPlat --> Security
    APIPlat --> Controllers
    Controllers --> Entities
    Entities --> Repositories
    Repositories --> DB
    
    AdminComponents --> Admin
    PublicComponents --> Public
    
    %% Click events
    click Admin "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/App.tsx"
    click Public "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/app/App.tsx"
    click APIPlat "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/config/packages/api_platform.yaml"
    click Security "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Security/AccessTokenHandler.php"
    click Controllers "https://github.com/vkwhm/TrabzonDMT-Site/tree/master/src/Controller"
    click CalendarDate "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Entity/CalendarDate.php"
    click CalendarEvent "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Entity/CalendarEvent.php"
    click User "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Entity/User.php"
    click ImageInfo "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Entity/ImageInformation.php"
    click CalendarDateRepo "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Repository/CalendarDateRepository.php"
    click CalendarEventRepo "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Repository/CalendarEventRepository.php"
    click UserRepo "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Repository/UserRepository.php"
    click ImageInfoRepo "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/src/Repository/ImageInformationRepository.php"
    click Creates "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/components/Creates.tsx"
    click Edits "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/components/Edits.tsx"
    click Lists "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/components/Lists.tsx"
    click Shows "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/components/Shows.tsx"
    click ImageCarousel "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/app/body/ImageCarousel.tsx"
    click SearchBox "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/app/body/ReadSection/SearchBox.tsx"
    click WeeklyTimeline "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/app/body/WeeklyTimeline.tsx"
    click AuthProvider "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/assets/admin/components/utils/authProvider.ts"
    click CORS "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/config/packages/nelmio_cors.yaml"
    click ServiceWorker "https://github.com/vkwhm/TrabzonDMT-Site/blob/master/public/serviceWorker.js"
    
    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef api fill:#2ecc71,stroke:#27ae60,color:white
    classDef backend fill:#f1c40f,stroke:#f39c12,color:black
    classDef database fill:#e74c3c,stroke:#c0392b,color:white
    
    class Admin,Public,AdminComponents,PublicComponents,Creates,Edits,Lists,Shows,AuthProvider,ImageCarousel,SearchBox,WeeklyTimeline frontend
    class APIPlat,Security,CORS,ServiceWorker api
    class Controllers,Entities,Repositories,CalendarDate,CalendarEvent,User,ImageInfo,CalendarDateRepo,CalendarEventRepo,UserRepo,ImageInfoRepo backend
    class DB database
```
