| κ΄λ¦¬ λ¬Έμ | κ΄λ ¨ λ§ν¬ |
|---|---|
μ΄ νλ‘μ νΈλ global pnpm μ€μΉ λμ Node.js λ΄μ₯ Corepackμ μ¬μ©ν©λλ€.
# Windows: κ΄λ¦¬μ κΆνμΌλ‘ PowerShell/CMD μ€ν ν
corepack enable
# macOS/Linux: sudo κΆνμΌλ‘ μ€ν
sudo corepack enablegit clone https://github.com/WeGo-Together/WeGo_FrontEnd.git
cd wegopnpm installκΈ°λ³Έ λμ μ€νμ μν νκ²½λ³μ μ€μ
// .env.local
# API μμ² μ£Όμ
NEXT_PUBLIC_API_BASE_URL=https://api.wego.monster/api/v1
# MSW μ€μ
NEXT_PUBLIC_MSW_ENABLED=true // Or falseplaywright ν μ€νΈλ₯Ό μν νκ²½λ³μ μ€μ
// .env.test
NEXT_PUBLIC_MSW_ENABLED=true# κ°λ° μλ² μ€ν
pnpm dev
# νλ‘λμ
λΉλ
pnpm build
# νλ‘λμ
μλ² μ€ν
pnpm start
# λ¦°νΈ κ²μ¬
pnpm lint
# ν
μ€νΈ μ€ν
pnpm test
# ν
μ€νΈ 컀λ²λ¦¬μ§
pnpm test:coverage
# Playwright Test
pnpm test:playwright
# Storybook μ€ν
pnpm storybook
# Storybook λΉλ
pnpm build-storybookWindows:
(1) https://github.com/FiloSottile/mkcert/releases μ μ
(2) mkcert-v1.4.4-windows-amd64.exe λ€μ΄λ‘λ
(3) νλ‘μ νΈ λ£¨νΈμ mkcert.exeλ‘ μ μ₯
π WEGO_FRONTEND
ββ πΏ mkcert.exe
macOS:
# homeBrewλ‘ μ€μΉ
brew install mkcert
# Firefox μ¬μ© μ
brew install nssWindows:
.\mkcert.exe -installmacOS:
mkcert -installμΆλ ₯:
The local CA is now installed in the system trust store! β‘οΈ# .cert ν΄λ μμ±
mkdir .certWindows:
# μΈμ¦μ λ°κΈ
.\mkcert.exe -key-file .cert\localhost-key.pem -cert-file .cert\localhost.pem localhost local.wego.monster 127.0.0.1 ::1macOS:
mkcert -key-file .cert/localhost-key.pem -cert-file .cert/localhost.pem localhost local.wego.monster 127.0.0.1 ::1μΆλ ₯:
Created a new certificate valid for the following names π
- "localhost"
- "local.wego.monster"
- "127.0.0.1"
- "::1"
The certificate is at ".cert\localhost.pem" and the key at ".cert\localhost-key.pem" β
It will expire on 12 March 2028 ππ WEGO_FRONTEND
ββ πΏ mkcert.exe
ββ π .cert
ββ π localhost-key.pem
ββ π localhost.pem
Windows: C:\Windows\System32\drivers\etc\hosts
(1) λ©λͺ¨μ₯μ κ΄λ¦¬μ κΆνμΌλ‘ μ€ν
(2) hosts νμΌ μ΄κΈ°
(3) λ€μ μ€ μΆκ°:
127.0.0.1 local.wego.monster
# https νκ²½μΌλ‘ μ€ν
pnpm dev
# μΆλ ₯ λ©μμ§
> [email protected] dev C:\git\wego\WeGo_FrontEnd
> node scripts/local/dev-server.js
> Ready on https://local.wego.monster:3000
β Compiling / ...
GET / 200 in 5.7s (compile: 5.3s, render: 321ms)κΈ°ν
# http νκ²½μΌλ‘ μ€ν
pnpm dev:http
# κΈ°μ‘΄ localhost:3000 μΌλ‘ μ€ν
pnpm dev:cimy-app
ββ π public # μ μ νμΌ
β ββ π images # μ΄λ―Έμ§ νμΌ λͺ¨μ
β
ββ π src
β ββ π api # API κ΄λ ¨
β β ββ π· httpClient.ts # HTTP ν΄λΌμ΄μΈνΈ (fetch λνΌ)
β β ββ π service
β β ββ π product # Product μλν¬μΈνΈ
β β ββ π product-get-item
β β β ββ π· index.ts # getProductItem API
β β ββ π product-get-list
β β ββ π· index.ts # getProductList API
β β
β ββ π app # Next.js App Router
β β ββ π§© layout.tsx # λ£¨νΈ λ μ΄μμ
β β ββ π§© page.tsx # ν νμ΄μ§
β β ββ π login
β β β ββ π§© page.tsx
β β ββ π details
β β ββ π [id]
β β ββ π§© page.tsx
β β
β ββ π assets # μ μ 리μμ€
β β ββ π fonts # λ‘컬 ν°νΈ
β β β ββ PretendardVariable.woff2
β β ββ π icons # SVG μμ΄μ½
β β ββ πΌοΈ icon-check-blue.svg
β β
β ββ π components # μ»΄ν¬λνΈ
β β ββ π ui # μν° μ»΄ν¬λνΈ
β β β ββ π button # λ²νΌ μ»΄ν¬λνΈ
β β β ββ π§© index.tsx
β β β ββ π§ͺ index.test.tsx
β β β ββ π index.stories.tsx
β β β
β β ββ π shared # 곡μ μ»΄ν¬λνΈ
β β β ββ π card # μΉ΄λ μ»΄ν¬λνΈ
β β β ββ π§© index.tsx
β β β ββ π§ͺ index.test.tsx
β β β ββ π index.stories.tsx
β β β
β β ββ π pages # νμ΄μ§λ³ μ»΄ν¬λνΈ
β β ββ π login # λ‘κ·ΈμΈ νμ΄μ§μ© μ»΄ν¬λνΈ
β β ββ π§© index.tsx # μ¬κΈ°μ νλ²μ export
β β ββ π login-form # μμ ν΄λμ μ΄λ¦μ ν¬ν¨νλλ‘ μ΄λ¦ μ§κΈ°
β β β ββ π§© index.tsx
β β ββ π login-social-button
β β ββ π§© index.tsx
β β
β ββ π hooks # Custom Hooks
β β ββ π use-product
β β ββ π use-product-get-item
β β β ββ π· index.ts # useGetProductItemQuery
β β ββ π use-product-get-list
β β ββ π· index.ts # useGetProductListQuery
β β
β ββ π stores # μ μ μν (Zustand)
β β ββ π use-auth-store
β β β ββ π· index.ts # useAuthStore
β β ββ π use-modal-store
β β β ββ π· index.ts # useModalStore
β β ββ π use-user-store
β β ββ π· index.ts # useUserStore
β β
β ββ π lib # μ νΈλ¦¬ν° & μ€μ
β β ββ π· utils.ts # κ³΅ν΅ μ νΈλ¦¬ν°
β β ββ π· query-client.ts # React Query μ€μ
β β ββ π query-key # Query Key μ€μ
β β ββ π query-key-product # product μλν¬μΈνΈ μ© Query Key
β β β ββ π· index.ts
β β ββ π query-key-user # user μλν¬μΈνΈ μ© Query Key
β β ββ π· index.ts
β β
β ββ π mocks # MSW λͺ¨νΉ
β β ββ π· index.ts # MSW μ΄κΈ°ν
β β ββ π handlers.ts # λͺ¨λ νΈλ€λ¬ ν΅ν© export
β β ββ π browser.ts # λΈλΌμ°μ μ© worker
β β ββ π server.ts # μλ²μ© server
β β ββ π endpoints
β β ββ π product
β β ββ π· product-handler.ts # product μλν¬μΈνΈ μ μ© λͺ¨νΉ ν¨μ
β β ββ π· product-mock.ts # product μλν¬μΈνΈ μ μ© λͺ© λ°μ΄ν°
β β
β ββ π types # TypeScript νμ
β β ββ π΅ global.d.ts # μ μ μ μΈ νμ
β β ββ π service
β β ββ π· product.ts
β β ββ π· user.ts
β β
β ββ π providers # Provider μ»΄ν¬λνΈ
β β ββ π· index.ts # provider νλ²μ export
β β ββ π provider-query.tsx # React Query Provider
β β β ββ π§© index.tsx
β β ββ π provider-msw.tsx # MSW Provider
β β β ββ π§© index.tsx
β β ββ π provider-lazy-motion.tsx # Framer Motion Provider
β β ββ π§© index.tsx
β β
β ββ π styles # μ€νμΌ
β β ββ π¨ base.css # κΈ°λ³Έ μ€νμΌ
β β ββ π¨ colors.css # μμ λ³μ
β β ββ π¨ typography.css # νμ΄ν¬κ·ΈλνΌ
β β ββ π¨ layout.css # λ μ΄μμ
β β ββ π¨ animations.css # μ λλ©μ΄μ
β β