使用 React + TypeScript + Vite + SCSS 開發
src/
├── assets/ # 圖片與靜態資源
├── components/ # 元件模組(含 mainpage / ManagementPage / shared)
├── pages/ # mainpage與DataCenterPage
├── lib/ # 公用function(ex: cn())
├── router.tsx # React Router 設定
└── main.tsx # 應用主進入點
npm installnpm run dev瀏覽器打開:http://localhost:5173
/router- 使用元件:
Card
/DataCenterPagerouter- 功能包含:
- 搜尋欄與清除按鈕
- 篩選按鈕(FilterButton)
- 表格展示(RackSummaryTable)
- 可點選的機櫃表格(FavoriteRackMap)
- 使用 SCSS Modules 管理元件樣式
- 全域變數在
styleguide.css定義 - 統一使用 Radix UI 作為基礎元件庫(如 Separator)(from CHAT)
-
every component composed of:
Component.tsx主檔案Component.module.scss樣式模組index.ts作為導出(若屬複用元件)
-
範例:
components/
└── ManagementPage/
└── FilterButton/
├── FilterButton.tsx
├── FilterButton.module.scss
└── index.ts
-
Button,Input,NvBar,Table,Separatorare Reusable Component, 放於components/shared中 -
Card在MainPage 和Management Page 中不同,因此分開存放