# myeolinmalchi/piececake-fe architecture

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

- Interactive diagram: https://gitdiagram.com/myeolinmalchi/piececake-fe
- Repository: https://github.com/myeolinmalchi/piececake-fe

## Overview

##### Project type and purpose
- This is a single-page application (SPA) front-end built with React and TypeScript, bundled by Vite.
- The project name “PIECECAKE” and the directory names (accounts, stores, mypage, carts, orders) indicate an e-commerce or user-account management interface for an online store.

##### File structure
- Top-level:
- public/index.html + public/images – static entrypoint and assets
- src/main.tsx – React app bootstrap
- src/pages – route‐level page components (accounts, signup, login, mypage, stores)
- src/components – reusable UI components organized by purpose (common, layouts, pages)
- src/assets, src/styles – fonts, images, CSS (Tailwind reset/index)
- config and toolchain: vite.config.ts, tsconfig*.json, tailwind.config.js, eslint.config.js, package.json, Yarn PnP files.
- Patterns: component-based UI, page routing under “src/pages”, separation of common UI controls vs. page‐specific components.
- No backend code here, so it consumes external REST or GraphQL APIs and OAuth providers (Kakao, Naver).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and Browser
    User["User"]:::frontend
    Browser["Browser"]:::frontend
    User --> Browser

    %% CDN / Static Host
    CDN["CDN / Static Host"]:::infra
    Browser -->|"HTTP GET index.html, JS/CSS"| CDN

    %% Dev & Build Layer
    subgraph "Dev & Build"
        Vite["Vite (Dev Server, HMR, Bundler)"]:::build
        TS["TypeScript Compiler"]:::build
        Tailwind["Tailwind CSS Processor"]:::build
        Vite --> TS
        TS --> Tailwind
        Tailwind --> Bundles["JS/CSS Bundles"]:::frontend
    end
    click Vite "https://github.com/myeolinmalchi/piececake-fe/blob/main/vite.config.ts"
    click TS "https://github.com/myeolinmalchi/piececake-fe/blob/main/tsconfig.json"
    click Tailwind "https://github.com/myeolinmalchi/piececake-fe/blob/main/tailwind.config.js"

    %% Bundles to CDN and Browser
    Bundles --> CDN
    Bundles --> Browser

    %% React App Runtime
    Browser --> ReactApp["React SPA"]:::frontend

    %% App Bootstrap
    ReactApp --> Main["App Bootstrap"]:::frontend
    click Main "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/main.tsx"

    %% React App Internals
    subgraph "React App Internals"
        Router["Router"]:::frontend

        subgraph "Pages (src/pages)"
            MainPage["Main Page"]:::frontend
            Accounts["Accounts Pages"]:::frontend
            MyPage["MyPage Pages"]:::frontend
            Stores["Stores Pages"]:::frontend
        end

        subgraph "components"
            Common["Common Controls"]:::frontend
            Layouts["Layouts"]:::frontend
            PageComps["Page-Specific Components"]:::frontend
            subgraph "accounts login buttons"
                KakaoBtn["KakaoButton"]:::frontend
                NaverBtn["NaverButton"]:::frontend
            end
        end
    end

    ReactApp --> Router
    ReactApp -->|"renders"| Pages["Pages"]:::frontend
    ReactApp --> Components["UI Components"]:::frontend

    %% Pages details
    click MainPage "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/main.tsx"
    click Accounts "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/pages/accounts"
    click MyPage "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/pages/mypage"
    click Stores "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/pages/stores"

    %% Accounts subpages
    subgraph "accounts"
        Login["login.tsx"]:::frontend
        Signup["signup/"]:::frontend
        Success["success.tsx"]:::frontend
    end
    Accounts --> Login
    Accounts --> Signup
    Accounts --> Success
    click Login "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/accounts/login.tsx"
    click Signup "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/pages/accounts/signup"
    click Success "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/accounts/success.tsx"

    %% MyPage subpages
    subgraph "mypage"
        Carts["carts.tsx"]:::frontend
        Info["info.tsx"]:::frontend
        Orders["orders.tsx"]:::frontend
    end
    MyPage --> Carts
    MyPage --> Info
    MyPage --> Orders
    click Carts "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/mypage/carts.tsx"
    click Info "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/mypage/info.tsx"
    click Orders "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/mypage/orders.tsx"

    %% Stores subpages
    subgraph "stores"
        StoresIndex["stores.tsx"]:::frontend
        Detail["detail.tsx"]:::frontend
    end
    Stores --> StoresIndex
    Stores --> Detail
    click StoresIndex "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/stores/stores.tsx"
    click Detail "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/pages/stores/detail.tsx"

    %% Components mapping
    click Common "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/components/common"
    click Layouts "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/components/layouts"
    click PageComps "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/components/pages"
    click KakaoBtn "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/components/pages/accounts/login/KakaoButton.tsx"
    click NaverBtn "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/components/pages/accounts/login/NaverButton.tsx"

    %% External Services
    ReactApp -->|REST/GraphQL| APIServer["Backend API Server"]:::external
    ReactApp -->|OAuth Flow| Kakao["Kakao OAuth Provider"]:::external
    ReactApp -->|OAuth Flow| Naver["Naver OAuth Provider"]:::external

    %% Styles & Assets
    click Bundles "https://github.com/myeolinmalchi/piececake-fe/blob/main/public/index.html"
    click Common "https://github.com/myeolinmalchi/piececake-fe/tree/main/src/assets"
    click Bundles "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/styles/index.css"
    click Bundles "https://github.com/myeolinmalchi/piececake-fe/blob/main/src/styles/reset.css"
    click Bundles "https://github.com/myeolinmalchi/piececake-fe/tree/main/public/images"

    classDef frontend fill:#E0F7FA,stroke:#006064,stroke-width:1px
    classDef build fill:#E8F5E9,stroke:#1B5E20,stroke-width:1px
    classDef external fill:#FFF3E0,stroke:#E65100,stroke-width:1px
    classDef infra fill:#F3E5F5,stroke:#4A148C,stroke-width:1px
```
