# kheee512/2024-hongik-id-exhibition architecture

> Architecture diagram of the GitHub repository kheee512/2024-hongik-id-exhibition, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kheee512/2024-hongik-id-exhibition
- Repository: https://github.com/kheee512/2024-hongik-id-exhibition

## Overview

Based on our review of the file tree and the README, this project is a front-end interactive application designed for the Hongik Univ. Industrial Design 2024 Exhibition. Its purpose is to offer an engaging user experience—likely with AI chat components and interactive visual elements—to showcase or facilitate exhibition interactions.

##### Primary components
- Frontend/UI: The project is structured as a Single Page Application (SPA) built in React. This includes key components like ChatModal, CircleButton, Question, and StartButton that form the interactive UI.
- Pages/Routing: The src/pages folder contains individual pages (e.g., Home.jsx and AiChat.jsx). These serve as high-level views and entry points into the application’s functionality.
- Assets and Data: Static assets (like images in src/images and public files) are used for visual components, while the src/data folder (e.g., circleData.js) provides application data (possibly for dynamic interactions or styling).
- Services/Integration: A dedicated service module (src/services/openai.js) is present to interact with external APIs such as OpenAI. This clearly shows an integration point where the application uses external intelligence or data.
- Configuration and Build Files: Standard configuration files (package.json, package-lock.json, and public/index.html) support dependencies, building, and deployment.

##### Relationships and interactions
- UI Components Flow: Within each page, components (like the StartButton, ChatModal, and Question) are rendered, interact with each other, and likely update the UI based on user events.
- Data & Asset Usage: Illustrate how the data files (e.g., circleData.js) support visual components and behaviors of certain UI elements, and indicate that static assets inform the overall design and aesthetics.

##### Architectural patterns and design principles
- Component-Based Architecture: Emphasize the separation of UI components (each with its own style and behavior) and how reusability is achieved.
- Layered Approach: The design follows a clear separation between the presentation layer (React components), routing/pages layer, and service/integration layer.
- API Integration: There is an abstraction for handling external services (OpenAI), ensuring that UI logic and external dependencies are decoupled.

##### Relevant technologies and frameworks
- React is the main framework for building the SPA.
- The external service module indicates integration with OpenAI services.
- CSS modules or styled components might be used in conjunction with the separate style files for each UI component.
- The routing between Home and AiChat pages (which may use a routing library like React Router) should be indicated if applicable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Application Container"
        A["App (Main Container)"]:::react
    end

    subgraph "Pages Layer"
        H["Home Page"]:::react
        AIC["AiChat Page"]:::react
    end

    subgraph "UI Components Layer"
        CM["ChatModal"]:::react
        CB["CircleButton"]:::react
        Q["Question"]:::react
        SB["StartButton"]:::react
    end

    subgraph "Services & Data Layer"
        OS["OpenAI Service"]:::service
        CD["Circle Data"]:::data
    end

    subgraph "Static Assets Layer"
        PF["Public Files"]:::assets
        IM["Images"]:::assets
    end

    %% App routes to pages
    A -->|"routesTo"| H
    A -->|"routesTo"| AIC

    %% Pages render UI Components
    H -->|"renders"| CM
    H -->|"renders"| CB
    H -->|"renders"| Q
    H -->|"renders"| SB

    AIC -->|"renders"| CM
    AIC -->|"renders"| CB
    AIC -->|"renders"| Q
    AIC -->|"renders"| SB

    %% UI Components interactions
    SB -->|"triggers"| CM
    CM -->|"calls"| OS
    CB -->|"uses"| CD

    %% App loads static assets
    A -->|"loads"| PF
    A -->|"loads"| IM

    %% Styles
    classDef react fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef service fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef data fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef assets fill:#f8d7da,stroke:#721c24,stroke-width:2px;

    %% Click Events
    click A "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/App.jsx"
    click H "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/pages/Home.jsx"
    click AIC "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/pages/AiChat.jsx"
    click CM "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/components/ChatModal/ChatModal.jsx"
    click CB "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/components/CircleButton/CircleButton.jsx"
    click Q "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/components/Question/Question.jsx"
    click SB "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/components/StartButton/StartButton.jsx"
    click OS "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/services/openai.js"
    click CD "https://github.com/kheee512/2024-hongik-id-exhibition/blob/main/src/data/circleData.js"
    click PF "https://github.com/kheee512/2024-hongik-id-exhibition/tree/main/public"
    click IM "https://github.com/kheee512/2024-hongik-id-exhibition/tree/main/src/images"
```
