# javier1234559/weebuns-client architecture

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

- Interactive diagram: https://gitdiagram.com/javier1234559/weebuns-client
- Repository: https://github.com/javier1234559/weebuns-client

## Overview

##### Main Components Identification

The system should be divided into these major components:

a) Frontend Architecture:
- Public Module (Landing pages, authentication)
- Private Module (Course learning, user dashboard)
- Admin Module (Course management, user management)
- Core Features (Essays, Vocabulary, Community, Learning Spaces)

b) State Management Layer:
- Redux Store (auth, modal, theme slices)
- Context API (Ad, Modal contexts)

c) Service Layer:
- API Services
- Storage Services
- Token Management
- GraphQL Client

**┌─ Frontend Application ─────────────────────────────────────┐**

- ┌─ Layouts ──────┐  ┌─ Core Features ─────────────────┐ │
- Public Layout  │  │ - Courses                       │ │
- Private Layout │  │ - Essays                        │ │
- Admin Layout   │  │ - Vocabulary                    │ │
- ┘  │ - Community                     │ │
- Learning Spaces                │ │
- ┌─ State ───────┐  └────────────────────────────────┘ │
- Redux Store   │                                      │
- Context API   │  ┌─ Common Components ─────────────┐ │
- ┘  │ - UI Components                 │ │
- Forms                         │ │
- ┌─ Services ────┐  │ - Modals                       │ │
- API Client    │  └────────────────────────────────┘ │
- GraphQL       │                                      │
- Storage       │  ┌─ Utils & Helpers ──────────────┐ │
- ┘  │ - Format Utils                 │ │
- Error Handlers               │ │
- ┘ │
- ┘

##### Component Relationships

- Data flow between components
- Component dependencies
- Service interactions
- State management connections

##### Important Details

a) Authentication Flow:
- Login/Register process
- Token management
- Protected routes

b) Feature Module Structure:
- Course management
- Essay system
- Vocabulary learning
- Community features

c) Admin Dashboard:
- Course management
- User management
- Revenue tracking

##### Technical Stack Indicators

Technology badges for:
- React + TypeScript
- Vite
- Redux
- GraphQL
- Cypress (Testing)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        subgraph Layouts
            PubLayout["Public Layout"]:::layout
            PrvLayout["Private Layout"]:::layout
            AdmLayout["Admin Layout"]:::layout
        end

        subgraph CoreFeatures
            Courses["Courses"]:::feature
            Essays["Essays"]:::feature
            Vocab["Vocabulary"]:::feature
            Community["Community"]:::feature
            Spaces["Learning Spaces"]:::feature
        end

        subgraph StateManagement
            Redux["Redux Store"]:::state
            Context["Context API"]:::state
        end

        subgraph Services
            API["API Services"]:::service
            Storage["Storage Services"]:::service
            Token["Token Management"]:::service
            GraphQL["GraphQL Client"]:::service
        end

        subgraph CommonComponents
            UI["UI Components"]:::common
            Forms["Forms"]:::common
            Modals["Modals"]:::common
        end

        subgraph Auth
            AuthFeatures["Auth Features"]:::auth
            ProtectedRoutes["Protected Routes"]:::auth
        end

        subgraph AdminFeatures
            Dashboard["Dashboard"]:::admin
            CourseManagement["Course Management"]:::admin
            UserManagement["User Management"]:::admin
            Revenue["Revenue Tracking"]:::admin
        end
    end

    %% Relationships
    AuthFeatures --> ProtectedRoutes
    ProtectedRoutes --> PrvLayout
    ProtectedRoutes --> AdmLayout
    
    Redux --> CoreFeatures
    Context --> CoreFeatures
    
    API --> Services
    Storage --> Services
    Token --> Services
    GraphQL --> Services

    Services --> CoreFeatures
    Services --> AdminFeatures
    
    CommonComponents --> CoreFeatures
    CommonComponents --> AdminFeatures
    CommonComponents --> Layouts

    %% Click Events
    click PubLayout "https://github.com/javier1234559/weebuns-client/blob/main//src/components/layout/PublicLayout/PublicLayout.tsx"
    click PrvLayout "https://github.com/javier1234559/weebuns-client/blob/main//src/components/layout/PrivateLayout/PrivateLayout.tsx"
    click AdmLayout "https://github.com/javier1234559/weebuns-client/blob/main//src/components/layout/AdminLayout/AdminLayout.tsx"
    click Courses "https://github.com/javier1234559/weebuns-client/tree/main//src/features/course"
    click Essays "https://github.com/javier1234559/weebuns-client/tree/main//src/features/essay"
    click Vocab "https://github.com/javier1234559/weebuns-client/tree/main//src/features/vocabulary"
    click Community "https://github.com/javier1234559/weebuns-client/tree/main//src/features/community"
    click Spaces "https://github.com/javier1234559/weebuns-client/tree/main//src/features/space"
    click Redux "https://github.com/javier1234559/weebuns-client/blob/main//src/store/store.ts"
    click Context "https://github.com/javier1234559/weebuns-client/tree/main//src/contexts"
    click API "https://github.com/javier1234559/weebuns-client/blob/main//src/services/api/api-axios.ts"
    click Storage "https://github.com/javier1234559/weebuns-client/tree/main//src/services/storage"
    click Token "https://github.com/javier1234559/weebuns-client/blob/main//src/services/tokenManagement.ts"
    click GraphQL "https://github.com/javier1234559/weebuns-client/blob/main//src/services/graphql/apoloClient.ts"
    click UI "https://github.com/javier1234559/weebuns-client/tree/main//src/components/common"
    click Forms "https://github.com/javier1234559/weebuns-client/tree/main//src/components/common/AppInput"
    click Modals "https://github.com/javier1234559/weebuns-client/tree/main//src/components/common/AppModal"
    click AuthFeatures "https://github.com/javier1234559/weebuns-client/tree/main//src/features/auth"
    click ProtectedRoutes "https://github.com/javier1234559/weebuns-client/blob/main//src/router/components/PrivateRoute.tsx"
    click Dashboard "https://github.com/javier1234559/weebuns-client/tree/main//src/features/admin/dashboard"
    click CourseManagement "https://github.com/javier1234559/weebuns-client/tree/main//src/features/admin/course"
    click UserManagement "https://github.com/javier1234559/weebuns-client/tree/main//src/features/admin/user"
    click Revenue "https://github.com/javier1234559/weebuns-client/tree/main//src/features/admin/revenue"

    %% Styles
    classDef layout fill:#2196F3,stroke:#1976D2,color:white
    classDef feature fill:#4CAF50,stroke:#388E3C,color:white
    classDef state fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef service fill:#FF9800,stroke:#F57C00,color:white
    classDef common fill:#607D8B,stroke:#455A64,color:white
    classDef auth fill:#E91E63,stroke:#C2185B,color:white
    classDef admin fill:#795548,stroke:#5D4037,color:white
```
