# v-chika-07/tuku_legacy architecture

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

- Interactive diagram: https://gitdiagram.com/v-chika-07/tuku_legacy
- Repository: https://github.com/v-chika-07/tuku_legacy

## Overview

##### Main Components

Frontend Layer:
- React Application (Vite-based)
- Major feature modules:
- Authentication (LoginModal)
- E-commerce (Cart, Merch)
- Events Management
- Marathon Features
- Music Player
- Contact System

State Management Layer:
- Context Providers
- AuthContext
- CartContext

Services Layer:
- Firebase Services
- Authentication
- Database Operations
- Storage
- Payment Services
- PayPal Integration
- Paynow Integration
- Email Services
- Upload Services

Backend Layer:
- Server Components
- Webhook Handlers (paynow_webhook.js)
- File Upload Handler (upload.php)
- Payment Notification System

External Services:
- Firebase Cloud Services
- Payment Gateways
- PayPal
- Paynow
- Email Service Provider

##### Connection and Data Flow

- User interactions flowing down from UI components
- Data flow between services
- Authentication flow with Firebase
- Payment processing flows
- Event and order management processes

##### Technical Details to Highlight

- Vite as the build tool
- React as the frontend framework
- Firebase for backend services
- Multiple payment gateway integrations
- File upload capabilities
- Email notification system

##### Component Relationships

Clear connections between:
- Authentication and protected routes
- Cart system and payment processing
- Event management and registration
- Order processing and notification system

##### Additional Elements

Include:
- Version information
- Technology stack list
- Security flow indicators
- Error handling paths

Remember to include notes about:
- Security implementations
- Scalability considerations
- Integration points
- Error handling strategies
- State management flow

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

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["Frontend Layer"]
        direction TB
        Login["Login Modal"]:::frontend
        Cart["Shopping Cart"]:::frontend
        Merch["Merchandise"]:::frontend
        Events["Events"]:::frontend
        Marathon["Marathon Features"]:::frontend
        Music["Music Player"]:::frontend
        Contact["Contact System"]:::frontend
        Upload["Image Upload"]:::frontend
    end

    subgraph State["State Management"]
        direction TB
        AuthCtx["Auth Context"]:::state
        CartCtx["Cart Context"]:::state
    end

    subgraph Services["Services Layer"]
        direction TB
        AuthSvc["Authentication Service"]:::service
        PaymentSvc["Payment Service"]:::service
        EventSvc["Event Service"]:::service
        ContactSvc["Contact Service"]:::service
        UploadSvc["Upload Service"]:::service
        EmailSvc["Email Service"]:::service
        ProductSvc["Product Service"]:::service
        OrderSvc["Order Service"]:::service
    end

    subgraph Backend["Backend Layer"]
        direction TB
        WebhookHandler["Webhook Handler"]:::backend
        UploadHandler["Upload Handler"]:::backend
        NotificationSystem["Notification System"]:::backend
    end

    subgraph External["External Services"]
        direction TB
        Firebase["Firebase"]:::external
        PayPal["PayPal"]:::external
        Paynow["Paynow"]:::external
        EmailProvider["Email Provider"]:::external
    end

    %% Connections
    Login --> AuthCtx
    Cart --> CartCtx
    AuthCtx --> AuthSvc
    CartCtx --> PaymentSvc
    AuthSvc --> Firebase
    PaymentSvc --> PayPal
    PaymentSvc --> Paynow
    EventSvc --> Firebase
    ContactSvc --> EmailProvider
    UploadSvc --> UploadHandler
    WebhookHandler --> NotificationSystem
    NotificationSystem --> EmailProvider

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:#fff
    classDef state fill:#9b59b6,stroke:#8e44ad,color:#fff
    classDef service fill:#2ecc71,stroke:#27ae60,color:#fff
    classDef backend fill:#e74c3c,stroke:#c0392b,color:#fff
    classDef external fill:#f1c40f,stroke:#f39c12,color:#fff

    %% Click Events
    click Login "https://github.com/v-chika-07/tuku_legacy/blob/main/src/components/LoginModal.jsx"
    click Cart "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Cart.jsx"
    click Merch "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Merch.jsx"
    click Events "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Events.jsx"
    click Marathon "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Marathon.jsx"
    click Music "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Music.jsx"
    click Contact "https://github.com/v-chika-07/tuku_legacy/blob/main/src/pages/Contact.jsx"
    click Upload "https://github.com/v-chika-07/tuku_legacy/blob/main/src/components/ImageUpload.jsx"
    click AuthCtx "https://github.com/v-chika-07/tuku_legacy/blob/main/src/contexts/AuthContext.jsx"
    click CartCtx "https://github.com/v-chika-07/tuku_legacy/blob/main/src/contexts/CartContext.jsx"
    click AuthSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/firebase/authService.js"
    click PaymentSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/services/paymentService.js"
    click EventSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/firebase/services/eventService.js"
    click ContactSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/firebase/services/contactService.js"
    click UploadSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/services/uploadService.js"
    click EmailSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/services/emailService.js"
    click ProductSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/firebase/services/productService.js"
    click OrderSvc "https://github.com/v-chika-07/tuku_legacy/blob/main/src/firebase/services/orderService.js"
    click WebhookHandler "https://github.com/v-chika-07/tuku_legacy/blob/main/server/paynow_webhook.js"
    click UploadHandler "https://github.com/v-chika-07/tuku_legacy/blob/main/public/upload.php"
    click NotificationSystem "https://github.com/v-chika-07/tuku_legacy/blob/main/src/services/paymentNotificationService.js"
```
