# srblx/manga-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/srblx/manga-v2
- Repository: https://github.com/srblx/manga-v2

## Overview

##### Main System Components

A. Frontend Architecture (Primary Focus)
- Divide into these major sections:

1. Core Application Layer
- Context Providers (Shopping Cart, User, PageNumber)
- Routing System (screens/routes)
- Main Components
- Shared Components

2. Feature Modules
- Manga Management
- News System
- Authentication
- Shopping Cart
- User Profile

3. Support Systems
- API Integration
- Utils & Helpers
- Testing (Cypress)

##### Component Organization

**[Application Core]**
- Context Layer
- UserContext
- ShoppingCartContext
- PageNumberProvider

- Component Layer
- Shared Components
- Buttons
- Inputs
- Alerts

- Feature Components
- Manga Related
- News Related
- Shopping Related

- Screen Layer
- Authentication
- Manga Listings
- News Management
- User Profile

##### Data Flow Representation

- API calls to backend services (via axios.api.ts)
- Context updates and state management
- User interactions and event handling

##### Technical Stack Indicators

Technology badges for:
- React + TypeScript
- Vite
- Material-UI (indicated by StyledBaliseMui)
- Cypress
- ESLint

##### Key Integration Points

Highlight:
- API integration layer
- Authentication flow
- Shopping cart operations
- News management system
- Manga detail viewing system

Styling Guidelines:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Application Core"]
        direction TB
        Context["Context Layer"]
        Components["Component Layer"]
        Screens["Screen Layer"]
    end

    subgraph Context
        direction TB
        UC["User Context"]:::context
        SCC["Shopping Cart Context"]:::context
        PNP["Page Number Provider"]:::context
    end

    subgraph Components
        direction TB
        subgraph Shared["Shared Components"]
            direction TB
            BTN["Button Component"]:::component
            INP["Input Component"]:::component
            TXT["Text Field Component"]:::component
        end

        subgraph Feature["Feature Components"]
            direction TB
            MC["Manga Components"]:::component
            NC["News Components"]:::component
            SC["Shopping Components"]:::component
        end
    end

    subgraph Screens
        direction TB
        Router["Routing System"]:::router
        Auth["Authentication Screens"]:::screen
        ML["Manga Listings"]:::screen
        NM["News Management"]:::screen
        UP["User Profile"]:::screen
    end

    subgraph Integration["Integration Layer"]
        direction TB
        API["API Client"]:::integration
        Routes["API Routes"]:::integration
    end

    subgraph Utils["Utility Layer"]
        direction TB
        Valid["Form Validation"]:::util
        Format["Currency Formatting"]:::util
        Const["Constants"]:::util
    end

    subgraph Testing["Testing Framework"]
        Cypress["Cypress Tests"]:::testing
    end

    %% Relationships
    Context --> Components
    Context --> Screens
    Components --> Screens
    Screens --> Integration
    Integration --> Utils
    Components --> Utils
    Testing -.-> Screens

    %% Component Details
    MC --> CardM["Manga Card"]:::component
    MC --> DetailM["Manga Detail"]:::component
    NC --> CardN["News Card"]:::component
    SC --> Cart["Shopping Cart Drawer"]:::component

    %% Click Events
    click UC "https://github.com/Srblx/Manga-v2/blob/main/src/context/UserContext.tsx"
    click SCC "https://github.com/Srblx/Manga-v2/blob/main/src/context/ShoppingCartContext.tsx"
    click PNP "https://github.com/Srblx/Manga-v2/blob/main/src/context/PageNumberProvider.tsx"
    click Router "https://github.com/Srblx/Manga-v2/blob/main/src/screens/routes/Screens.tsx"
    click BTN "https://github.com/Srblx/Manga-v2/blob/main/src/components/Shared/BtnCustom.component.tsx"
    click INP "https://github.com/Srblx/Manga-v2/blob/main/src/components/Shared/InputCustom.component.tsx"
    click TXT "https://github.com/Srblx/Manga-v2/blob/main/src/components/Shared/TextFieldCustom.component.tsx"
    click ML "https://github.com/Srblx/Manga-v2/blob/main/src/screens/ListManga.screen.tsx"
    click DetailM "https://github.com/Srblx/Manga-v2/blob/main/src/components/DetailManga.component.tsx"
    click CardM "https://github.com/Srblx/Manga-v2/blob/main/src/components/CardManga.component.tsx"
    click NM "https://github.com/Srblx/Manga-v2/blob/main/src/screens/News.screen.tsx"
    click CardN "https://github.com/Srblx/Manga-v2/blob/main/src/components/CardNews.component.tsx"
    click Auth "https://github.com/Srblx/Manga-v2/blob/main/src/screens/LoginForm.screen.tsx"
    click Cart "https://github.com/Srblx/Manga-v2/blob/main/src/components/DrawerCart.component.tsx"
    click UP "https://github.com/Srblx/Manga-v2/blob/main/src/screens/Profile.screen.tsx"
    click API "https://github.com/Srblx/Manga-v2/blob/main/src/utils/axios.api.ts"
    click Routes "https://github.com/Srblx/Manga-v2/blob/main/src/utils/routeApi.utils.ts"
    click Cypress "https://github.com/Srblx/Manga-v2/tree/main/cypress"
    click Valid "https://github.com/Srblx/Manga-v2/blob/main/src/utils/ValidForm.utils.tsx"
    click Format "https://github.com/Srblx/Manga-v2/blob/main/src/utils/FormatCurrency.utils.tsx"
    click Const "https://github.com/Srblx/Manga-v2/blob/main/src/utils/constant.utils.ts"

    %% Styling
    classDef context fill:#e6e6fa,stroke:#333
    classDef component fill:#add8e6,stroke:#333
    classDef screen fill:#98fb98,stroke:#333
    classDef router fill:#ffa500,stroke:#333
    classDef integration fill:#ff8c00,stroke:#333
    classDef util fill:#dcdcdc,stroke:#333
    classDef testing fill:#ff69b4,stroke:#333

    %% Legend
    subgraph Legend
        L1["Context Provider"]:::context
        L2["Component"]:::component
        L3["Screen"]:::screen
        L4["Integration"]:::integration
        L5["Utility"]:::util
        L6["Testing"]:::testing
    end
```
