# hyojinlee-git/banzzac-front architecture

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

- Interactive diagram: https://gitdiagram.com/hyojinlee-git/banzzac-front
- Repository: https://github.com/hyojinlee-git/banzzac-front

## Overview

##### Main Components

a. Core Application Layer:
- React + TypeScript Application (Vite-based)
- State Management (Recoil)
- Router (implied by pages structure)

b. Feature Modules:
- Authentication (Login/Signup)
- Profile Management
- Friends System
- Chat System (indicated by ChatMessageList component)

c. Technical Infrastructure:
- API Layer
- MSW (Mock Service Worker) for development
- Storybook for component documentation

**UI Layer (Components)**
**↑↓**
**Feature Layer (Containers/Pages)**
**↑↓**
**State Management Layer (Recoil)**
**↑↓**
**Service Layer (API/Hooks)**
**↑↓**
**External Services**

##### Specific Elements

a. Components Layer (Blue):
- Major component categories:
- Common Components (Button, Input, Modal, etc.)
- Feature-specific Components (ProfileImage, MatchingTicket, etc.)
- Layout Components

b. Feature Modules (Green):
- Friends Management
- Profile System
- Authentication
- Signup Flow

c. State Management (Purple):
- Recoil Stores:
- Common State
- Friends State
- Profile State

d. Service Layer (Orange):
- API Interceptor
- Custom Hooks
- MSW Integration

##### Important Relationships to Highlight

- Bidirectional data flow between Recoil stores and Features
- API communication patterns
- Component composition relationships
- Hook usage patterns

**┌─ UI Layer ─────────────────────┐**
- Components → Containers → Pages │
- Feature Layer ────────────────┤
- Friends │ Profile │ Auth       │
- State Layer ─────────────────┤
- Recoil Stores                 │
- Service Layer ───────────────┤
- API │ Hooks │ MSW             │
- ┘

##### Special Notes

- Modular structure reflected in the src/components organization
- Relationship between stories and components for documentation
- How the layouts system integrates with pages
- Demonstrate the hook system's role in managing side effects

Remember to highlight the TypeScript integration and how it provides type safety across the application layers. Also, note the development tools (MSW, Storybook) and how they fit into the development workflow.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "UI Layer"
        UI_Common["Common Components"]:::ui
        UI_Feature["Feature Components"]:::ui
        UI_Layout["Layout System"]:::ui
        UI_Modal["Modal System"]:::ui
        UI_Form["Form Components"]:::ui
        UI_Chat["Chat Components"]:::ui
    end

    subgraph "Feature Layer"
        F_Friends["Friends Module"]:::feature
        F_Profile["Profile Module"]:::feature
        F_Auth["Authentication"]:::feature
        F_Signup["Signup Flow"]:::feature
        F_Chat["Chat System"]:::feature
    end

    subgraph "State Layer"
        S_Common["Common State"]:::state
        S_Friends["Friends State"]:::state
        S_Profile["Profile State"]:::state
    end

    subgraph "Service Layer"
        API["API Layer"]:::service
        API_Int["API Interceptor"]:::service
        Hooks["Custom Hooks"]:::service
        MSW["Mock Service Worker"]:::service
    end

    subgraph "Infrastructure"
        Story["Storybook"]:::infra
        Types["Type System"]:::infra
        Router["Router"]:::infra
        App["Main App"]:::infra
    end

    %% Relationships
    UI_Common --> F_Friends
    UI_Common --> F_Profile
    UI_Common --> F_Auth
    UI_Feature --> F_Friends
    UI_Feature --> F_Profile
    UI_Layout --> App
    UI_Modal --> F_Friends
    UI_Modal --> F_Profile
    UI_Chat --> F_Chat

    F_Friends <--> S_Friends
    F_Profile <--> S_Profile
    F_Auth <--> S_Common
    F_Signup <--> S_Common
    F_Chat <--> S_Common

    S_Common <--> API
    S_Friends <--> API
    S_Profile <--> API

    API <--> API_Int
    API_Int <--> MSW
    Hooks --> API
    
    Router --> App
    Types --> App
    Story --> UI_Common

    %% Click Events
    click App "https://github.com/hyojinLee-git/banzzac-front/blob/main/src/App.tsx"
    click UI_Layout "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/layouts"
    click UI_Modal "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/components/Modal"
    click UI_Form "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/components/Input"
    click UI_Chat "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/components/ChatMessageList"
    click F_Friends "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/containers/Friends"
    click F_Profile "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/containers/Profile"
    click F_Auth "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/pages/Login"
    click F_Signup "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/containers/Signup"
    click S_Common "https://github.com/hyojinLee-git/banzzac-front/blob/main/src/recoil/common.ts"
    click S_Friends "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/recoil/friends"
    click S_Profile "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/recoil/profile"
    click API "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/api"
    click API_Int "https://github.com/hyojinLee-git/banzzac-front/blob/main/src/api/interceptor.ts"
    click MSW "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/utils/msw"
    click Story "https://github.com/hyojinLee-git/banzzac-front/blob/main/.storybook"
    click Types "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/types"
    click Hooks "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/hooks"
    click Router "https://github.com/hyojinLee-git/banzzac-front/tree/main/src/pages"

    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef feature fill:#2ecc71,stroke:#27ae60,color:white
    classDef state fill:#9b59b6,stroke:#8e44ad,color:white
    classDef service fill:#e67e22,stroke:#d35400,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L_UI["UI Components"]:::ui
        L_Feature["Features"]:::feature
        L_State["State"]:::state
        L_Service["Services"]:::service
        L_Infra["Infrastructure"]:::infra
    end
```
