# trandangkhoi/froggy-blog-web architecture

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

- Interactive diagram: https://gitdiagram.com/trandangkhoi/froggy-blog-web
- Repository: https://github.com/trandangkhoi/froggy-blog-web

## Overview

##### Main Architecture Components

a. Frontend Layer (Client-Side):
- React/TypeScript application structure
- Features:
- Authentication System
- Blog Writing/Editing
- Dashboard
- User Profiles
- Search & Explore
- Statistics/Analytics

b. API Integration Layer:
- APIs by functionality (visible in src/apis/):
- Authentication APIs
- Story/Content APIs
- Admin APIs
- Comments APIs
- Topic APIs
- Like/Interaction APIs
- Image handling APIs
- Charts/Analytics APIs

##### Component Organization

Create distinct sections showing:

a. Core Features:
- Content Management
- User Management
- Authentication Flow
- Dashboard & Analytics
- Search & Discovery

b. Supporting Systems:
- File/Image Handling
- Text-to-Speech
- Social Sharing
- Real-time Updates

##### Data Flow Representation

- User authentication flow
- Content creation/editing flow
- Comment and interaction flow
- Analytics data flow
- Search and discovery flow

##### Technical Implementation Details

- State Management (Context API usage)
- Route Protection (Admin/Protected/Rejected routes)
- Form Validation (Schema validation)
- API Integration Layer
- Component Library

##### Specific Implementation Notes

- The layout system (MainLayout, DashboardLayout, etc.)
- Component reusability (shared components)
- Authentication flows (protected routes)
- Admin dashboard functionality
- Content management workflow

##### Key Features to Highlight

Create special sections for:
- Rich text editing capabilities
- Multi-language support
- Analytics and statistics
- User interaction features
- Content discovery mechanisms

##### Integration Points

Connections with:
- Image storage services
- Authentication providers
- Analytics services
- Social media platforms

**[User Interface Layer]**
- ↕
**[Component Library]**
- ↕
**[State Management & Contexts]**
- ↕
**[API Integration Layer]**
- ↕
**[External Services]**

Remember to:
- Use consistent styling
- Brief descriptions for complex flows
- Security boundaries
- Scalable components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Layer"
        UI[User Interface]
        CL[Component Library]
        SM[State Management & Contexts]:::state
        click SM "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/contexts/auth.contexts.tsx"
    end

    subgraph "Core Features"
        Auth[Authentication System]:::auth
        click Auth "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/auth.apis.ts"
        
        BW[Blog Writing/Editing]:::feature
        click BW "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/BlogWritingPage/NewStoryPage.tsx"
        
        DA[Dashboard & Analytics]:::feature
        click DA "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/DashboardPage/DashboardPage.tsx"
        
        UP[User Profiles]:::feature
        click UP "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/UserProfilePage/UserProfilePage.tsx"
        
        SE[Search & Explore]:::feature
        click SE "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/ExplorePage/ExplorePage.tsx"
    end

    subgraph "API Integration Layer"
        AuthAPI[Authentication APIs]:::api
        click AuthAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/auth.apis.ts"
        
        StoryAPI[Story/Content APIs]:::api
        click StoryAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/story.apis.ts"
        
        CommentAPI[Comments APIs]:::api
        click CommentAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/comments.api.ts"
        
        TopicAPI[Topic APIs]:::api
        click TopicAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/topic.apis.ts"
        
        ImageAPI[Image APIs]:::api
        click ImageAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/image.apis.ts"
        
        ChartAPI[Analytics APIs]:::api
        click ChartAPI "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/apis/chart.api.ts"
    end

    subgraph "Supporting Systems"
        LS[Layout System]:::system
        click LS "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/layouts/MainLayout/MainLayout.tsx"
        
        TTS[Text-to-Speech]:::system
        click TTS "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/components/TextToSpeech/TextToSpeech.tsx"
        
        IH[Image Handling]:::system
        click IH "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/components/HandledImage/HandledImage.tsx"
        
        VS[Validation Schemas]:::system
        click VS "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/schemas/authentication.schemas.ts"
    end

    subgraph "Content Management"
        CM[Content Manager]:::content
        click CM "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/DashboardStoriesPage/DashboardStoriesPage.tsx"
        
        TE[Text Editor]:::content
        click TE "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/components/TextEditor/TextEditor.tsx"
        
        CS[Comment System]:::content
        click CS "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/StoryDetailPage/components/CommentSection/CommentSection.tsx"
        
        TM[Topic Management]:::content
        click TM "https://github.com/TranDangKhoi/froggy-blog-web/blob/main/src/pages/DashboardTopicsPage/DashboardTopicsPage.tsx"
    end

    UI --> CL
    CL --> SM
    SM --> Auth
    SM --> BW
    SM --> DA
    SM --> UP
    SM --> SE

    Auth --> AuthAPI
    BW --> StoryAPI
    DA --> ChartAPI
    UP --> AuthAPI
    SE --> TopicAPI

    CM --> StoryAPI
    TE --> StoryAPI
    CS --> CommentAPI
    TM --> TopicAPI

    IH --> ImageAPI
    
    classDef api fill:#90EE90
    classDef auth fill:#FFD700
    classDef feature fill:#ADD8E6
    classDef system fill:#FFA500
    classDef content fill:#DDA0DD
    classDef state fill:#20B2AA
```
