Skip to content

Commit f189d52

Browse files
heesuneeheesunee
andauthored
docs: TEAM MATEBALL 개발 관련 문서 사이트 배포 (#216)
* fix: biome에 docs 포함 안되게 수정 (#214) * docs: mateball 문서 index.md 파일 작성 (#214) * docs: 코딩 컨벤션 문서 작성 (#214) * docs: git.md 작성 (#214) * docs: naming.md 파일 작성 (#214) * docs: folder.md 파일 작성 (#214) * docs: stack.md 파일 작성 (#214) * docs: trouble.md 작성 (#214) * chore: gitignore에 vitepress 추가 (#214) * feat: workflow 파일 작성 (#214) * feat: workflow 대상 브랜치 변경 (#214) * fix: workflow pr 열릴때로 수정 (#214) * fix: workflow 수정 (#214) * chore: 파일 정리 (#214) * fix: workflow 수정 (#214) * fix: workflow 수정 (#214) * fix: workflow 수정 (#214) * fix: 글씨 나가는 거 수정 (#214) * chore: 의존성 정리 (#214) --------- Co-authored-by: heesunee <heesun729@uos.ac.kr>
1 parent 32d1f5e commit f189d52

24 files changed

Lines changed: 3495 additions & 22 deletions

‎.github/workflows/deploy.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
name: docs-deploy
3+
4+
on:
5+
push:
6+
branches: [develop]
7+
paths: [docs/**]
8+
pull_request:
9+
branches: [develop]
10+
paths: [docs/**]
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: docs-deploy
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: pnpm
36+
37+
- name: Configure GitHub Pages
38+
uses: actions/configure-pages@v4
39+
40+
- name: Install Docs Dependencies
41+
run: pnpm install --frozen-lockfile
42+
working-directory: docs
43+
44+
- name: Build Docs
45+
run: pnpm run docs:build
46+
working-directory: docs
47+
48+
- name: Upload Pages Artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: docs/.vitepress/dist
52+
53+
deploy:
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ dist-ssr
2727
.env
2828
*storybook.log
2929

30+
# vitepress
31+
docs/.vitepress/cache
32+
docs/.vitepress/dist
33+
docs/.vitepress/tmp

‎biome.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"!**/build/**",
1414
"!**/.next/**",
1515
"!**/storybook-static/**",
16-
"!**/.direnv/**"
16+
"!**/.direnv/**",
17+
"!**/docs/**"
1718
]
1819
},
1920
"formatter": {

‎docs/.vitepress/config.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { defineConfig } from 'vitepress';
2+
3+
export default defineConfig({
4+
base: '/MATEBALL-CLIENT/',
5+
title: 'MATEBALL CLIENT DOCS',
6+
description: 'mateball client convention & troubleshootig & docs',
7+
8+
head: [
9+
['link', { rel: 'icon', href: '/MATEBALL-CLIENT/favicon.svg' }],
10+
],
11+
themeConfig: {
12+
nav: [
13+
{ text: 'Home', link: '/' },
14+
],
15+
16+
17+
socialLinks: [{ icon: 'github', link: 'https://github.com/MATEBALL/MATEBALL-CLIENT' }],
18+
},
19+
});

‎docs/coding.md‎

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# 🧾 코딩 컨벤션
2+
3+
메잇볼 클라이언트 팀의 코드 품질과 협업 효율을 높이기 위한 코딩 컨벤션입니다.
4+
모든 팀원이 일관된 스타일로 코드를 작성할 수 있도록 아래 규칙을 준수해주세요.
5+
6+
---
7+
8+
## 🟡 변수
9+
10+
- `var` 사용 **금지**, `const` → `let` 순으로 선언
11+
- 문자열 조합 시 `+` 대신 **템플릿 리터럴(``` ` ```) 사용**
12+
- 변수명은 의미를 명확히 드러내도록 작성
13+
- ✅ `users`, `fruits`
14+
- ❌ `Arr`, `tmp`, `data1`
15+
- 줄임말 지양: 의미가 길더라도 명확한 이름 사용
16+
- ✅ `Button`
17+
- ❌ `Btn`
18+
- `map()` 사용 시, key는 반드시 고유한 값 사용
19+
- ❌ `key={index}` → ❌
20+
- ✅ `key={user.id}` 또는 `uuid`
21+
- **전역 변수**는 지양 (가능하면 로컬 스코프 유지)
22+
23+
---
24+
25+
## 🔵 함수
26+
27+
- **function 키워드 금지**, **화살표 함수만 사용**
28+
- 공통 함수는 `utils/` 폴더로 분리하여 재사용
29+
- 변수/함수 이름은 **20자 미만**
30+
- 네이밍에 의미를 담고, 필요한 경우 주석으로 보완
31+
- **Early Return 패턴 권장**
32+
33+
```tsx
34+
// ✅ Early Return
35+
const processUser = (user) => {
36+
if (!user || !user.isActive) return;
37+
// 이후 로직
38+
};
39+
````
40+
41+
---
42+
43+
## 🟢 컴포넌트
44+
45+
* 기본 템플릿은 `rafce` 사용 (React Arrow Function Component with Export)
46+
* 불필요한 wrapper는 ❌ → **Fragment (`<>`) 사용 권장**
47+
48+
```tsx
49+
const InfoText = () => {
50+
return (
51+
<>
52+
<h1>Welcome!</h1>
53+
<p>This is our new page!</p>
54+
</>
55+
);
56+
};
57+
```
58+
59+
* children이 없는 컴포넌트는 self-closing (`<Component />`)
60+
* children 적극 활용해 UI 유연하게 구성
61+
62+
---
63+
64+
## 🟠 타입 (TypeScript)
65+
66+
* `object` 타입은 **interface** 사용
67+
* 단일 변수 타입은 **type alias**
68+
* 컴포넌트 Props 타입은 **컴포넌트 상단에 정의**
69+
* 그 외 타입은 `types/` 폴더에 분리
70+
* API 응답 타입 네이밍: `OOOResponse` 형태
71+
72+
```ts
73+
interface UserCardProps {
74+
userId: string;
75+
userName: string;
76+
}
77+
```
78+
79+
---
80+
81+
## 🔴 메소드
82+
83+
* 배열 복사는 **스프레드 연산자(...)** 사용
84+
85+
```ts
86+
const copy = [...originals];
87+
```
88+
89+
* `for` 루프 대신 `map`, `forEach`, `filter` 사용
90+
91+
* 구조 분해 할당 적극 사용
92+
93+
```ts
94+
const checkUser = ({ userName, userBirth }: UserDataProps) => {
95+
// ...
96+
};
97+
```
98+
99+
* 불필요한 반복문 지양
100+
101+
* 조건 검색 시 `Map`, `Object`, 인덱스 접근 방식 고려
102+
103+
---
104+
105+
## ⚙ 기타
106+
107+
* `button` 태그에는 `type` 명시 (`type="button"` / `"submit"`)
108+
* 비교 연산은 `===`, `!==`만 사용
109+
* **axios는 async/await 패턴 사용**, then/catch 대신:
110+
111+
```ts
112+
const fetchData = async () => {
113+
try {
114+
const res = await axios.get('/api/data');
115+
} catch (err) {
116+
console.error(err);
117+
}
118+
};
119+
```
120+
121+
---
122+
<br/>
123+
124+
> 📌 컨벤션이 어긋난 경우 리뷰 시 코멘트 부탁드리며, **모두가 이해할 수 있는 코드 작성**을 우선합니다.
125+

‎docs/folder.md‎

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
3+
# 📂 폴더 구조 가이드
4+
5+
메잇볼 클라이언트 팀에서는 **코드 응집도**와 **유지보수 편의성**을 높이기 위해 아래와 같은 폴더 구조를 따릅니다.
6+
또한, 모든 폴더와 파일명은 **케밥 케이스(kebab-case)**를 적용해 일관성 있고 가독성이 뛰어난 구조를 유지합니다.
7+
8+
---
9+
10+
## 폴더 구조 예시
11+
12+
```
13+
14+
|-- 📁 .github
15+
|-- 📁 node_modules
16+
|-- 📁 public
17+
|-- 📁 src
18+
|-- 📁 pages
19+
|-- 📁 home
20+
|-- 📄ex) home.tsx
21+
|-- 📁 components
22+
|-- 📁 styles 등
23+
|-- 📁 shared
24+
|-- 📁 components
25+
|-- 📄ex) home-header.tsx
26+
|-- 📁 styles
27+
|-- 📁 constants
28+
|-- 📁 types 등
29+
|-- index.html 등 ETC
30+
31+
```
32+
33+
---
34+
35+
## 각 폴더별 역할 및 네이밍 이유
36+
37+
### 1️⃣ `src/pages`
38+
39+
- **목적**: 사용자에게 보여지는 개별 페이지 단위의 컴포넌트와 그에 특화된 리소스를 관리
40+
- **구성**:
41+
- 페이지별 폴더(`home`, `profile` 등)로 구분
42+
- 각 페이지 폴더 안에 그 페이지 전용 `components`와 `styles` 폴더를 별도 관리
43+
- **이유**:
44+
- 페이지 단위로 코드를 응집시켜 이해하기 쉽고, 유지보수가 편리
45+
- 각 페이지에 종속적인 코드가 명확히 분리되어, 변경 시 영향 범위 최소화
46+
47+
### 2️⃣ `src/shared`
48+
49+
- **목적**: 프로젝트 전역에서 재사용되는 **공통 모듈 및 리소스** 저장소
50+
- **구성**:
51+
- `components`: 여러 페이지에서 공통으로 사용하는 UI 컴포넌트
52+
- `styles`: 전역 스타일 및 테마 변수
53+
- `constants`: 전역 상수 (API URL, 색상 코드 등)
54+
- `types`: 타입 정의
55+
- **이유**:
56+
- 재사용성을 높이고, 중복 코드를 줄여 유지보수 비용 절감
57+
- 공통 리소스를 한 곳에 모아두어 변경 관리 및 영향도 분석이 용이
58+
59+
### 3️⃣ 기타 주요 폴더
60+
61+
- `.github`: GitHub 워크플로우, 이슈 및 PR 템플릿
62+
- `node_modules`: 프로젝트 의존성
63+
- `public`: 정적 파일 (이미지, 폰트 등)
64+
- 루트의 `index.html`: 앱 진입점
65+
66+
---
67+
68+
## 케밥 케이스(kebab-case) 사용 이유
69+
70+
- **폴더명과 파일명 모두 케밥 케이스**를 사용합니다.
71+
- **장점**:
72+
- OS 및 개발 도구 간 **대소문자 구분 문제 최소화**
73+
- 터미널에서 입력하기 쉽고, 경로 가독성이 뛰어남
74+
- URL과 유사해 직관적이고 협업 시 혼동 감소
75+
76+
---
77+
78+
## 설계 원칙
79+
80+
- **응집도**: 관련 코드와 리소스를 한곳에 모아 관리하여 코드 이해도를 높임
81+
- **단일 책임 원칙**: 각 폴더는 명확한 책임과 역할을 가짐
82+
- **확장성**: 새로운 기능 추가 시 폴더를 쉽게 추가하고 관리 가능
83+
- **협업 효율성**: 일관된 구조 덕분에 팀원 모두 빠르게 코드 위치 파악 가능
84+
85+
---
86+
87+
> 메잇볼 팀은 이 폴더 구조를 통해 빠른 개발과 원활한 협업을 실현하고 있습니다.
88+
> 작업 중 헷갈릴 때는 이 가이드를 참고해 주세요!
89+

0 commit comments

Comments
 (0)