Skip to content

2025-OSDC/colbrush-test

Repository files navigation

๐ŸŒ Colbrush Test Site

Colbrush ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ ๋ฐ ๋ฐ๋ชจ๋ฅผ ์œ„ํ•œ ๊ณต์‹ ๋ฌธ์„œ ์‚ฌ์ดํŠธ์ž…๋‹ˆ๋‹ค. ์ƒ‰๊ฐ ์ด์ƒ์ž๋ฅผ ์œ„ํ•œ ์ ‘๊ทผ์„ฑ ์ค‘์‹ฌ์˜ ๋””์ž์ธ ์‹œ์Šคํ…œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ธ Colbrush์˜ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ๊ฒ€์ฆํ•˜๊ณ  ์‹œ์—ฐํ•ฉ๋‹ˆ๋‹ค.


๐Ÿ“– ์†Œ๊ฐœ

์ด ์‚ฌ์ดํŠธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ชฉ์ ์œผ๋กœ ํ™œ์šฉ๋ฉ๋‹ˆ๋‹ค:

  • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ: Colbrush์˜ ํ•ต์‹ฌ ๊ธฐ๋Šฅ๋“ค์„ ์‹ค์ œ ํ™˜๊ฒฝ์—์„œ ํ…Œ์ŠคํŠธ
  • ๋ฌธ์„œํ™”: Colbrush ์„ค์น˜, ์„ค์ •, ํ†ตํ•ฉ ๋ฐฉ๋ฒ• ์•ˆ๋‚ด
  • ์ธํ„ฐ๋ž™ํ‹ฐ๋ธŒ ๋ฐ๋ชจ: ์ƒ‰๊ฐ ์ด์ƒ ์œ ํ˜•๋ณ„ ์ƒ‰์ƒ ๋ณ€์ˆ˜ ์ ์‘ ๋ฐฉ์‹ ์‹œ์—ฐ
  • ์ ‘๊ทผ์„ฑ UI ํŒจํ„ด ์‡ผ์ผ€์ด์Šค: Colbrush๋กœ ๊ตฌํ˜„ ๊ฐ€๋Šฅํ•œ ์ ‘๊ทผ์„ฑ UI ์ปดํฌ๋„ŒํŠธ ์˜ˆ์‹œ

๐ŸŽฏ ์ฃผ์š” ๊ธฐ๋Šฅ

Colbrush ํ•ต์‹ฌ ๊ธฐ๋Šฅ

ํ˜„์žฌ ํ…Œ์ŠคํŠธ ์ค‘์ธ Colbrush์˜ ์ฃผ์š” ๊ธฐ๋Šฅ๋“ค:

  • ThemeProvider (colbrush/client): ์ƒ‰๊ฐ ์ด์ƒ ์œ ํ˜•๋ณ„ ํ…Œ๋งˆ ์ œ๊ณต
  • ThemeSwitcher (colbrush/client): ์‚ฌ์šฉ์ž๊ฐ€ ์ง์ ‘ ํ…Œ๋งˆ๋ฅผ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ๋Š” UI
  • SimulationFilter (colbrush/devtools): ์ƒ‰๊ฐ ์ด์ƒ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ ํ•„ํ„ฐ (๊ฐœ๋ฐœ ๋ฐ ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ ์ง€์›)

ํŽ˜์ด์ง€ ๊ตฌ์„ฑ

  • Install (/): Colbrush ์„ค์น˜ ๋ฐ ์ดˆ๊ธฐ ์„ค์ • ๊ฐ€์ด๋“œ
  • API (/api): Colbrush API ๋ฌธ์„œ ๋ฐ ์‚ฌ์šฉ๋ฒ•
  • Usage (/usage): ์‹ค์ œ UI ์ปดํฌ๋„ŒํŠธ ์˜ˆ์ œ (๊ทธ๋ž˜ํ”„, ์ฐจํŠธ, ํˆฌ๋‘๋ฆฌ์ŠคํŠธ ๋“ฑ)

๐Ÿ›  ๊ธฐ์ˆ  ์Šคํƒ

  • Framework: React 19 + Vite
  • Routing: React Router DOM v7
  • Styling: Tailwind CSS v4 + Colbrush ํ…Œ๋งˆ ์‹œ์Šคํ…œ
  • Charts: amCharts 5 (์ ‘๊ทผ์„ฑ ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™”)
  • Build Tool: Vite + SWC
  • Package Manager: npm/yarn/pnpm

๐Ÿš€ ์‹œ์ž‘ํ•˜๊ธฐ

์„ค์น˜

git clone https://github.com/2025-OSDC/colbrush-test.git
cd colbrush-test
npm install

Colbrush ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜

npm install colbrush

๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹คํ–‰

npm run dev

๐Ÿ“‚ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

src/
โ”œโ”€โ”€ App.tsx                 # ๋ฉ”์ธ ์•ฑ ์ปดํฌ๋„ŒํŠธ (ThemeProvider ํ†ตํ•ฉ)
โ”œโ”€โ”€ layouts/
โ”‚   โ””โ”€โ”€ Layout.tsx         # ๋ ˆ์ด์•„์›ƒ (SimulationFilter, ThemeSwitcher ํ†ตํ•ฉ)
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ install/           # ์„ค์น˜ ๊ฐ€์ด๋“œ ํŽ˜์ด์ง€
โ”‚   โ”œโ”€โ”€ api/               # API ๋ฌธ์„œ ํŽ˜์ด์ง€
โ”‚   โ””โ”€โ”€ usage/             # ์‚ฌ์šฉ ์˜ˆ์ œ ํŽ˜์ด์ง€
โ”‚       โ””โ”€โ”€ component/     # ๋ฐ๋ชจ ์ปดํฌ๋„ŒํŠธ๋“ค
โ”‚           โ”œโ”€โ”€ graph/     # ์ฐจํŠธ ์ปดํฌ๋„ŒํŠธ
โ”‚           โ”œโ”€โ”€ simulator/ # ์ƒ‰๊ฐ ์ด์ƒ ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ
โ”‚           โ”œโ”€โ”€ todo/      # ํˆฌ๋‘ ๋ฆฌ์ŠคํŠธ ์˜ˆ์ œ
โ”‚           โ””โ”€โ”€ ...
โ””โ”€โ”€ components/            # ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ

๐Ÿงช ํ…Œ์ŠคํŠธ ์ƒํƒœ

colbrush ์ฝ”๋“œ ์ฃผ์„ ์ฒ˜๋ฆฌ - ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด ๋‹ค์Œ ์ปดํฌ๋„ŒํŠธ๋“ค์„ ์ž„์‹œ๋กœ ๋น„ํ™œ์„ฑํ™”:

์ฃผ์„ ์ฒ˜๋ฆฌ๋œ ํŒŒ์ผ

  1. src/App.tsx

    • ThemeProvider import ๋ฐ ๋ž˜ํ•‘ ์ฃผ์„ ์ฒ˜๋ฆฌ
  2. src/layouts/Layout.tsx

    • SimulationFilter ์ปดํฌ๋„ŒํŠธ ์ฃผ์„ ์ฒ˜๋ฆฌ
    • ThemeSwitcher ์ปดํฌ๋„ŒํŠธ ์ฃผ์„ ์ฒ˜๋ฆฌ
  3. src/index.css

    • Colbrush ์Šคํƒ€์ผ์‹œํŠธ import ์ฃผ์„ ์ฒ˜๋ฆฌ
    • ์ƒ‰๊ฐ ์ด์ƒ ์œ ํ˜•๋ณ„ ํ…Œ๋งˆ CSS ๋ณ€์ˆ˜ ์ฃผ์„ ์ฒ˜๋ฆฌ (deuteranopia, protanopia, tritanopia, monochromacy)
  4. src/pages/usage/component/graph/MapChart.tsx, src/pages/usage/component/graph/DonutChart.tsx, src/pages/usage/component/graph/LineChart.tsx

    • useTheme hook import ์ฃผ์„ ์ฒ˜๋ฆฌ
    • theme ๋ณ€์ˆ˜ ์ฃผ์„ ์ฒ˜๋ฆฌ
    • useEffect dependency array์—์„œ theme ์˜์กด์„ฑ ๋น„ํ™œ์„ฑํ™”

ํ…Œ์ŠคํŠธ ์ง„ํ–‰ ๋ฐฉ๋ฒ•

  1. ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ํด๋ก  ๋ฐ ์„ค์น˜

    git clone https://github.com/2025-OSDC/colbrush-test.git
    cd colbrush-test
    npm install
    npm install colbrush
  2. ๊ธฐ๋ณธ UI ํ…Œ์ŠคํŠธ: ์ฃผ์„ ์ฒ˜๋ฆฌ ์ƒํƒœ์—์„œ ๊ธฐ๋ณธ ์Šคํƒ€์ผ๋ง ํ™•์ธ

    npm run dev
  3. Colbrush ํ™œ์„ฑํ™”: ์ฃผ์„ ํ•ด์ œ ํ›„ ์ƒ‰๊ฐ ์ด์ƒ ๋Œ€์‘ ํ…Œ๋งˆ ๋™์ž‘ ํ™•์ธ

  4. ๋น„๊ต ๋ถ„์„: ํ™œ์„ฑํ™” ์ „ํ›„ ์ ‘๊ทผ์„ฑ ๊ฐœ์„  ํšจ๊ณผ ๊ฒ€์ฆ


๐ŸŽจ Colbrush ํ™œ์„ฑํ™”ํ•˜๊ธฐ

ํ…Œ์ŠคํŠธ๋ฅผ ์™„๋ฃŒํ•˜๊ณ  Colbrush ๊ธฐ๋Šฅ์„ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด ๋‹ค์Œ ํŒŒ์ผ๋“ค์˜ ์ฃผ์„์„ ํ•ด์ œํ•˜์„ธ์š”:

1. ์Šคํƒ€์ผ์‹œํŠธ ํ™œ์„ฑํ™”

src/index.css

/* ์ฃผ์„ ํ•ด์ œ */
@import 'colbrush/styles.css';

/* npx colbrush --generate๋กœ ์ƒ‰๋งน ์œ ํ˜•๋ณ„ ํ…Œ๋งˆ ๋ณ€์ˆ˜ ์ƒ์„ฑ */
[data-theme='deuteranopia'] { /* ... */ }
[data-theme='protanopia'] { /* ... */ }
[data-theme='tritanopia'] { /* ... */ }

2. ThemeProvider ํ™œ์„ฑํ™”

src/App.tsx

// ์ฃผ์„ ํ•ด์ œ
import { ThemeProvider } from "colbrush/client";

function App() {
  return (
    <ThemeProvider>
      {/* ... */}
    </ThemeProvider>
  );
}

3. ๊ฐœ๋ฐœ ๋„๊ตฌ ๋ฐ ํ…Œ๋งˆ ์Šค์œ„์ฒ˜ ํ™œ์„ฑํ™”

src/layouts/Layout.tsx

// ์ฃผ์„ ํ•ด์ œ
import { SimulationFilter } from "colbrush/devtools";
import { ThemeSwitcher } from "colbrush/client";

// JSX์—์„œ ์ฃผ์„ ํ•ด์ œ
<SimulationFilter allowInProd={true} />
<ThemeSwitcher />

4. ์ฐจํŠธ ์ปดํฌ๋„ŒํŠธ ํ™œ์„ฑํ™”

MapChart

src/pages/usage/component/graph/MapChart.tsx

// ์ฃผ์„ ํ•ด์ œ
import { useTheme } from "colbrush/client";

const MapChart = () => {
  // ์ฃผ์„ ํ•ด์ œ
  const theme = useTheme().theme;

  useEffect(() => {
    // ...
    // 79-80๋ฒˆ ์ค„: ์•„๋ž˜ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌํ•˜๊ณ 
  }, []); // Colbrush ํ…Œ์ŠคํŠธ์šฉ: theme ์˜์กด์„ฑ ๋น„ํ™œ์„ฑํ™”
  // ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œ
  // }, [theme]); // Colbrush ํ™œ์„ฑํ™”: ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œํ•˜๊ณ  ์œ„ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌ
};

DonutChart

src/pages/usage/component/graph/DonutChart.tsx

// ์ฃผ์„ ํ•ด์ œ
import { useTheme } from "colbrush/client";

const DonutChart = () => {
  // ์ฃผ์„ ํ•ด์ œ
  const theme = useTheme().theme;

  useEffect(() => {
    // ...
    // 113-114๋ฒˆ ์ค„: ์•„๋ž˜ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌํ•˜๊ณ 
  }, []); // Colbrush ํ…Œ์ŠคํŠธ์šฉ: theme ์˜์กด์„ฑ ๋น„ํ™œ์„ฑํ™”
  // ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œ
  // }, [theme]); // Colbrush ํ™œ์„ฑํ™”: ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œํ•˜๊ณ  ์œ„ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌ
};

LineChart

src/pages/usage/component/graph/LineChart.tsx

// ์ฃผ์„ ํ•ด์ œ
import { useTheme } from "colbrush/client";

function LineChart() {
  // ์ฃผ์„ ํ•ด์ œ
  const theme = useTheme().theme;

  useEffect(() => {
    // ...
    // 118-119๋ฒˆ ์ค„: ์•„๋ž˜ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌํ•˜๊ณ 
  }, []); // Colbrush ํ…Œ์ŠคํŠธ์šฉ: theme ์˜์กด์„ฑ ๋น„ํ™œ์„ฑํ™”
  // ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œ
  // }, [theme]); // Colbrush ํ™œ์„ฑํ™”: ์ด ์ค„์˜ ์ฃผ์„์„ ํ•ด์ œํ•˜๊ณ  ์œ„ ์ค„์„ ์ฃผ์„ ์ฒ˜๋ฆฌ
}

๐Ÿ“ฆ ํŒจํ‚ค์ง€ ์˜์กด์„ฑ

์ฃผ์š” ์˜์กด์„ฑ

  • colbrush (^1.11.0) - ํ•ต์‹ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
  • react (^19.1.1)
  • react-router-dom (^7.8.0)
  • tailwindcss (^4.1.12)
  • @amcharts/amcharts5 (^5.13.5) - ์ ‘๊ทผ์„ฑ ์ฐจํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

์ž์„ธํ•œ ์˜์กด์„ฑ ์ •๋ณด: package.json


๐Ÿ“ซ ๋งํฌ

About

demo & testing site for Colbrush

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages