@daawoonkim/create-arch-app 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.ko.md +72 -0
- package/CHANGELOG.md +36 -0
- package/README.ko.md +302 -0
- package/README.md +140 -179
- package/create-arch-app_mvp_faa8b53b.plan.md +454 -0
- package/package.json +1 -1
package/CHANGELOG.ko.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# 변경 로그
|
|
2
|
+
|
|
3
|
+
이 프로젝트의 주요 변경사항을 기록합니다.
|
|
4
|
+
|
|
5
|
+
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.0.0/)를 따르며,
|
|
6
|
+
버저닝은 [Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
|
|
7
|
+
|
|
8
|
+
## [미배포]
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2025-01-26
|
|
11
|
+
|
|
12
|
+
### 추가
|
|
13
|
+
- **API 라이브러리 통합**
|
|
14
|
+
- HTTP 클라이언트 옵션: Axios, Fetch API, None
|
|
15
|
+
- 데이터 페칭 라이브러리: TanStack Query (React Query), SWR, None
|
|
16
|
+
- 아키텍처별 API 파일 자동 생성 (DDD, Clean, Atomic, Default)
|
|
17
|
+
- React 및 Next.js용 QueryClient/SWR Provider 자동 설정
|
|
18
|
+
- 환경변수 파일 자동 생성 (.env.local, .env.example)
|
|
19
|
+
- TypeScript 타입이 포함된 예제 API 엔드포인트 및 query hooks
|
|
20
|
+
|
|
21
|
+
- **CI/CD 자동화**
|
|
22
|
+
- 자동 테스트 및 배포를 위한 GitHub Actions 워크플로우
|
|
23
|
+
- main 브랜치 병합 시 자동 npm 배포 (버전 기반)
|
|
24
|
+
- Node.js 18.x, 20.x, 22.x에서 PR 자동 테스트
|
|
25
|
+
- TypeScript 검증을 포함한 자동 린트 체크
|
|
26
|
+
- 배포 시 GitHub Release 자동 생성
|
|
27
|
+
- 백업용 태그 기반 배포 방식
|
|
28
|
+
|
|
29
|
+
- **문서**
|
|
30
|
+
- 버전 추적을 위한 CHANGELOG.md
|
|
31
|
+
- 개발 가이드라인이 포함된 CONTRIBUTING.md
|
|
32
|
+
- 상세한 CI/CD 가이드 .github/WORKFLOWS.md
|
|
33
|
+
- CI 배지 및 배포 정보로 README 업데이트
|
|
34
|
+
|
|
35
|
+
### 변경
|
|
36
|
+
- **Next.js 프로젝트 구조**
|
|
37
|
+
- 모든 코드를 `src/` 디렉토리로 정리
|
|
38
|
+
- tsconfig.json에 절대 경로 alias (`@/*`) 자동 설정
|
|
39
|
+
- 모든 import를 `@/` 절대 경로로 변환
|
|
40
|
+
- 모든 `src/**/*` 파일을 스캔하도록 Tailwind 설정 간소화
|
|
41
|
+
- 깔끔한 루트 디렉토리로 더 나은 프로젝트 구성
|
|
42
|
+
|
|
43
|
+
### 수정
|
|
44
|
+
- GitHub Actions에서 대화형 프롬프트 문제를 피하기 위해 CI 테스트 워크플로우 간소화
|
|
45
|
+
|
|
46
|
+
## [0.1.0] - 2024-01-XX
|
|
47
|
+
|
|
48
|
+
### 추가
|
|
49
|
+
- 초기 MVP 릴리즈
|
|
50
|
+
- 4가지 아키텍처 패턴 지원 (DDD, Clean Architecture, Atomic Design, Default)
|
|
51
|
+
- React (with Vite) 및 Next.js 프레임워크 옵션
|
|
52
|
+
- Next.js 버전 선택 (Latest, 15.x, 14.x, 13.x)
|
|
53
|
+
- Next.js 라우터 선택 (App Router, Pages Router)
|
|
54
|
+
- TypeScript 기본 포함
|
|
55
|
+
- 스타일링 옵션: Tailwind CSS, CSS Modules
|
|
56
|
+
- 상태관리 옵션: Zustand, Context API, None
|
|
57
|
+
- 폼 라이브러리: React Hook Form
|
|
58
|
+
- 테스팅: Vitest + Testing Library
|
|
59
|
+
- 현재 디렉토리 생성 지원 (`.` 옵션)
|
|
60
|
+
- inquirer.js를 사용한 대화형 CLI
|
|
61
|
+
- 자동 폴더 구조 생성
|
|
62
|
+
- 프로젝트 세부정보가 포함된 README.md 생성
|
|
63
|
+
- 환경별 설정 파일
|
|
64
|
+
|
|
65
|
+
### 문서
|
|
66
|
+
- 사용 예제가 포함된 종합 README
|
|
67
|
+
- 배포 가이드 (PUBLISHING.md)
|
|
68
|
+
- 테스트 가이드 (TESTING.md)
|
|
69
|
+
|
|
70
|
+
[미배포]: https://github.com/hec8897/create-arch-app/compare/v0.2.0...HEAD
|
|
71
|
+
[0.2.0]: https://github.com/hec8897/create-arch-app/releases/tag/v0.2.0
|
|
72
|
+
[0.1.0]: https://github.com/hec8897/create-arch-app/releases/tag/v0.1.0
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.0] - 2025-01-26
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **API Libraries Integration**
|
|
14
|
+
- HTTP Client options: Axios, Fetch API, None
|
|
15
|
+
- Data Fetching libraries: TanStack Query (React Query), SWR, None
|
|
16
|
+
- Architecture-specific API file generation (DDD, Clean, Atomic, Default)
|
|
17
|
+
- Automatic QueryClient/SWR Provider setup for React and Next.js
|
|
18
|
+
- Environment variable files (.env.local, .env.example)
|
|
19
|
+
- Example API endpoints and query hooks with TypeScript
|
|
20
|
+
|
|
21
|
+
- **CI/CD Automation**
|
|
22
|
+
- GitHub Actions workflows for automated testing and deployment
|
|
23
|
+
- Automatic npm deployment on main branch merge (version-based)
|
|
24
|
+
- PR testing on Node.js 18.x, 20.x, 22.x
|
|
25
|
+
- Automated lint checks with TypeScript validation
|
|
26
|
+
- Automatic GitHub Release creation on deployment
|
|
27
|
+
- Tag-based deployment as backup method
|
|
28
|
+
|
|
29
|
+
- **Documentation**
|
|
30
|
+
- CHANGELOG.md for version tracking
|
|
31
|
+
- CONTRIBUTING.md with development guidelines
|
|
32
|
+
- .github/WORKFLOWS.md with detailed CI/CD guide
|
|
33
|
+
- README updates with CI badges and deployment information
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- **Next.js Project Structure**
|
|
37
|
+
- All code now organized in `src/` directory
|
|
38
|
+
- Automatic absolute path alias (`@/*`) configuration in tsconfig.json
|
|
39
|
+
- All imports converted to use `@/` absolute paths
|
|
40
|
+
- Simplified Tailwind config to scan all `src/**/*` files
|
|
41
|
+
- Better project organization with cleaner root directory
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- CI test workflow simplified to avoid interactive prompt issues in GitHub Actions
|
|
45
|
+
|
|
10
46
|
## [0.1.0] - 2024-01-XX
|
|
11
47
|
|
|
12
48
|
### Added
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# create-arch-app
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@daawoonkim/create-arch-app)
|
|
4
|
+
[](https://www.npmjs.com/package/@daawoonkim/create-arch-app)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+

|
|
7
|
+
[](https://github.com/hec8897/create-arch-app/actions/workflows/test.yml)
|
|
8
|
+
[](https://github.com/hec8897/create-arch-app/actions/workflows/lint.yml)
|
|
9
|
+
|
|
10
|
+
**🌐 언어**: [English](./README.md) | **한국어**
|
|
11
|
+
|
|
12
|
+
DDD, Clean Architecture, Atomic Design을 지원하는 대화형 React/Next.js 프로젝트 생성 CLI 도구
|
|
13
|
+
|
|
14
|
+
**📦 npm**: https://www.npmjs.com/package/@daawoonkim/create-arch-app
|
|
15
|
+
|
|
16
|
+
**📝 CHANGELOG**: [English](./CHANGELOG.md) | [한국어](./CHANGELOG.ko.md)
|
|
17
|
+
|
|
18
|
+
> ⚠️ **현재 MVP(Minimum Viable Product) 버전입니다.** 핵심 기능은 모두 작동하지만, 활발히 개발 중이며 피드백을 받고 있습니다. 이슈나 제안 사항이 있으시면 [GitHub Issues](https://github.com/hec8897/create-arch-app/issues)에 남겨주세요!
|
|
19
|
+
|
|
20
|
+
## 특징
|
|
21
|
+
|
|
22
|
+
✨ **4가지 아키텍처 패턴 지원**
|
|
23
|
+
- DDD (Domain-Driven Design)
|
|
24
|
+
- Clean Architecture
|
|
25
|
+
- Atomic Design
|
|
26
|
+
- Default (기본 구조)
|
|
27
|
+
|
|
28
|
+
🚀 **프레임워크 선택**
|
|
29
|
+
- React (with Vite)
|
|
30
|
+
- Next.js (App Router / Pages Router)
|
|
31
|
+
|
|
32
|
+
💎 **TypeScript 기본 포함**
|
|
33
|
+
|
|
34
|
+
🎨 **스타일링 옵션**
|
|
35
|
+
- Tailwind CSS
|
|
36
|
+
- CSS Modules
|
|
37
|
+
|
|
38
|
+
🌐 **API 통합**
|
|
39
|
+
- HTTP 클라이언트: Axios, Fetch API
|
|
40
|
+
- 데이터 페칭: TanStack Query (React Query), SWR
|
|
41
|
+
|
|
42
|
+
📦 **선택 가능한 라이브러리**
|
|
43
|
+
- 상태관리: Zustand, Context API
|
|
44
|
+
- 폼: React Hook Form
|
|
45
|
+
- 테스팅: Vitest + Testing Library
|
|
46
|
+
|
|
47
|
+
## 설치 및 사용법
|
|
48
|
+
|
|
49
|
+
### npx로 즉시 사용 (권장)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# 새 디렉토리에 프로젝트 생성
|
|
53
|
+
npx @daawoonkim/create-arch-app my-app
|
|
54
|
+
|
|
55
|
+
# 또는 현재 디렉토리에 직접 생성
|
|
56
|
+
npx @daawoonkim/create-arch-app .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 전역 설치
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install -g @daawoonkim/create-arch-app
|
|
63
|
+
|
|
64
|
+
# 새 디렉토리에 프로젝트 생성
|
|
65
|
+
create-arch-app my-app
|
|
66
|
+
|
|
67
|
+
# 현재 디렉토리에 직접 생성
|
|
68
|
+
create-arch-app .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> **참고**: 현재 디렉토리(`.`)를 사용하려면 디렉토리가 비어있어야 합니다.
|
|
72
|
+
|
|
73
|
+
### 대화형 프롬프트
|
|
74
|
+
|
|
75
|
+
CLI를 실행하면 다음 질문들에 답하게 됩니다:
|
|
76
|
+
|
|
77
|
+
1. **프레임워크 선택**: React 또는 Next.js
|
|
78
|
+
2. **Next.js 버전 선택** (Next.js만 해당): Latest (권장), 15.x, 14.x, 13.x
|
|
79
|
+
3. **라우터 선택** (Next.js만 해당): App Router (권장) 또는 Pages Router
|
|
80
|
+
4. **아키텍처 패턴**: DDD, Clean, Atomic, Default
|
|
81
|
+
5. **스타일링 도구**: Tailwind CSS 또는 CSS Modules
|
|
82
|
+
6. **상태관리**: Zustand, Context API, None
|
|
83
|
+
7. **폼 라이브러리**: React Hook Form 또는 None
|
|
84
|
+
8. **HTTP 클라이언트**: Axios, Fetch API, None
|
|
85
|
+
9. **데이터 페칭**: TanStack Query (React Query), SWR, None
|
|
86
|
+
10. **테스팅 도구**: Vitest + Testing Library 포함 여부
|
|
87
|
+
|
|
88
|
+
## 사용 예시
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx @daawoonkim/create-arch-app my-enterprise-app
|
|
92
|
+
|
|
93
|
+
# 대화형 프롬프트
|
|
94
|
+
? 프레임워크를 선택하세요: Next.js
|
|
95
|
+
? Next.js 버전을 선택하세요: Latest (최신 버전, 권장)
|
|
96
|
+
? Next.js 라우터를 선택하세요: App Router (권장)
|
|
97
|
+
? 아키텍처 패턴을 선택하세요: DDD (Domain-Driven Design)
|
|
98
|
+
? 스타일링 도구를 선택하세요: Tailwind CSS
|
|
99
|
+
? 상태관리 라이브러리를 선택하세요: Zustand
|
|
100
|
+
? 폼 라이브러리를 선택하세요: React Hook Form
|
|
101
|
+
? HTTP 클라이언트를 선택하세요: Axios (권장)
|
|
102
|
+
? 데이터 페칭 라이브러리를 선택하세요: TanStack Query (React Query) - 권장
|
|
103
|
+
? 테스팅 도구를 포함하시겠습니까? Yes
|
|
104
|
+
|
|
105
|
+
✨ 프로젝트 생성 중...
|
|
106
|
+
📦 TypeScript 프로젝트로 설정됩니다 (기본값)
|
|
107
|
+
🚀 Next.js App Router 사용
|
|
108
|
+
✅ 프로젝트 생성 완료!
|
|
109
|
+
|
|
110
|
+
🎉 프로젝트가 성공적으로 생성되었습니다!
|
|
111
|
+
|
|
112
|
+
다음 명령어로 시작하세요:
|
|
113
|
+
cd my-enterprise-app
|
|
114
|
+
npm install
|
|
115
|
+
npm run dev
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 아키텍처 패턴 설명
|
|
119
|
+
|
|
120
|
+
### DDD (Domain-Driven Design)
|
|
121
|
+
|
|
122
|
+
엔터프라이즈급 애플리케이션에 적합한 패턴입니다.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
domain/ # 비즈니스 엔티티와 로직
|
|
126
|
+
├── entities/
|
|
127
|
+
├── repositories/
|
|
128
|
+
└── services/
|
|
129
|
+
application/ # 유스케이스
|
|
130
|
+
├── usecases/
|
|
131
|
+
└── ports/
|
|
132
|
+
infrastructure/ # 외부 서비스 통합
|
|
133
|
+
├── api/
|
|
134
|
+
└── persistence/
|
|
135
|
+
presentation/ # UI 컴포넌트
|
|
136
|
+
├── components/
|
|
137
|
+
└── pages/
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Clean Architecture
|
|
141
|
+
|
|
142
|
+
의존성 규칙과 레이어 분리에 중점을 둔 패턴입니다.
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
core/ # 비즈니스 로직
|
|
146
|
+
├── entities/
|
|
147
|
+
├── usecases/
|
|
148
|
+
└── interfaces/
|
|
149
|
+
features/ # 기능별 모듈
|
|
150
|
+
└── [feature]/
|
|
151
|
+
├── domain/
|
|
152
|
+
├── data/
|
|
153
|
+
└── presentation/
|
|
154
|
+
shared/ # 공통 컴포넌트
|
|
155
|
+
├── components/
|
|
156
|
+
└── utils/
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Atomic Design
|
|
160
|
+
|
|
161
|
+
UI 컴포넌트 중심 개발에 최적화된 패턴입니다.
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
components/
|
|
165
|
+
├── atoms/ # 가장 작은 UI 단위
|
|
166
|
+
├── molecules/ # atoms 조합
|
|
167
|
+
├── organisms/ # molecules 조합
|
|
168
|
+
├── templates/ # 페이지 레이아웃
|
|
169
|
+
└── pages/ # 실제 페이지
|
|
170
|
+
hooks/
|
|
171
|
+
utils/
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Default
|
|
175
|
+
|
|
176
|
+
빠른 시작을 원하는 개발자를 위한 기본 구조입니다.
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
components/
|
|
180
|
+
hooks/
|
|
181
|
+
pages/ (또는 app/)
|
|
182
|
+
utils/
|
|
183
|
+
styles/
|
|
184
|
+
types/
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 생성되는 파일 구조
|
|
188
|
+
|
|
189
|
+
### React 프로젝트
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
my-app/
|
|
193
|
+
├── src/
|
|
194
|
+
│ ├── [architecture folders]
|
|
195
|
+
│ ├── App.tsx
|
|
196
|
+
│ ├── main.tsx
|
|
197
|
+
│ └── index.css
|
|
198
|
+
├── index.html
|
|
199
|
+
├── vite.config.ts
|
|
200
|
+
├── tsconfig.json
|
|
201
|
+
├── package.json
|
|
202
|
+
└── README.md
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Next.js 프로젝트 (App Router)
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
my-app/
|
|
209
|
+
├── src/
|
|
210
|
+
│ ├── app/
|
|
211
|
+
│ │ ├── layout.tsx
|
|
212
|
+
│ │ ├── page.tsx
|
|
213
|
+
│ │ └── globals.css
|
|
214
|
+
│ └── [architecture folders]
|
|
215
|
+
├── next.config.js
|
|
216
|
+
├── tsconfig.json
|
|
217
|
+
├── package.json
|
|
218
|
+
└── README.md
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Next.js 프로젝트 (Pages Router)
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
my-app/
|
|
225
|
+
├── src/
|
|
226
|
+
│ ├── pages/
|
|
227
|
+
│ │ ├── _app.tsx
|
|
228
|
+
│ │ ├── _document.tsx
|
|
229
|
+
│ │ └── index.tsx
|
|
230
|
+
│ ├── styles/
|
|
231
|
+
│ │ └── globals.css
|
|
232
|
+
│ └── [architecture folders]
|
|
233
|
+
├── next.config.js
|
|
234
|
+
├── tsconfig.json
|
|
235
|
+
├── package.json
|
|
236
|
+
└── README.md
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## 요구 사항
|
|
240
|
+
|
|
241
|
+
- Node.js 18.0.0 이상
|
|
242
|
+
|
|
243
|
+
## 버전 정보
|
|
244
|
+
|
|
245
|
+
### v0.2.0 - 최신 (2025-01-26)
|
|
246
|
+
|
|
247
|
+
**주요 업데이트:**
|
|
248
|
+
- ✅ API 라이브러리 통합 (Axios, Fetch API, TanStack Query, SWR)
|
|
249
|
+
- ✅ 아키텍처별 API 파일 자동 생성
|
|
250
|
+
- ✅ Next.js 프로젝트 구조 개선 (`src/` 디렉토리 + 절대 경로)
|
|
251
|
+
- ✅ CI/CD 자동화 (GitHub Actions)
|
|
252
|
+
- ✅ 자동 npm 배포 (main 브랜치 merge 시)
|
|
253
|
+
- ✅ 문서 개선 (CHANGELOG, CONTRIBUTING, WORKFLOWS)
|
|
254
|
+
|
|
255
|
+
자세한 내용은 [CHANGELOG.ko.md](./CHANGELOG.ko.md)를 참조하세요.
|
|
256
|
+
|
|
257
|
+
### v0.1.0 - MVP 릴리즈
|
|
258
|
+
|
|
259
|
+
**포함된 기능:**
|
|
260
|
+
- ✅ 4가지 아키텍처 패턴 (DDD, Clean Architecture, Atomic Design, Default)
|
|
261
|
+
- ✅ React (Vite) & Next.js (App Router / Pages Router) 지원
|
|
262
|
+
- ✅ Next.js 버전 선택 (Latest, 15.x, 14.x, 13.x)
|
|
263
|
+
- ✅ TypeScript 기본 포함
|
|
264
|
+
- ✅ 스타일링: Tailwind CSS, CSS Modules
|
|
265
|
+
- ✅ 상태관리: Zustand, Context API
|
|
266
|
+
- ✅ 폼: React Hook Form
|
|
267
|
+
- ✅ 테스팅: Vitest + Testing Library
|
|
268
|
+
- ✅ 현재 디렉토리 생성 지원 (`.` 옵션)
|
|
269
|
+
- ✅ 기본 폴더 구조와 README 자동 생성
|
|
270
|
+
|
|
271
|
+
## 로드맵
|
|
272
|
+
|
|
273
|
+
### v0.3.0 (계획 중)
|
|
274
|
+
- [ ] 추가 UI 라이브러리 통합 (shadcn/ui, MUI)
|
|
275
|
+
- [ ] 더 많은 테스트 및 안정성 개선
|
|
276
|
+
- [ ] 컴포넌트 생성기 추가
|
|
277
|
+
|
|
278
|
+
### 향후 계획
|
|
279
|
+
- [ ] 추가 아키텍처 패턴 (Feature-Sliced Design, Hexagonal Architecture)
|
|
280
|
+
- [ ] 추가 상태관리 옵션 (Redux Toolkit, Jotai, Recoil)
|
|
281
|
+
- [ ] 인증 통합 (NextAuth, Supabase)
|
|
282
|
+
- [ ] ORM 통합 (Prisma, Drizzle)
|
|
283
|
+
- [ ] Docker 설정 포함
|
|
284
|
+
- [ ] Monorepo 지원 (Turborepo)
|
|
285
|
+
|
|
286
|
+
## 기여하기
|
|
287
|
+
|
|
288
|
+
버그 리포트, 기능 제안, PR 모두 환영합니다!
|
|
289
|
+
|
|
290
|
+
자세한 내용은 [CONTRIBUTING.md](./CONTRIBUTING.md)를 참조하세요.
|
|
291
|
+
|
|
292
|
+
## 라이선스
|
|
293
|
+
|
|
294
|
+
MIT
|
|
295
|
+
|
|
296
|
+
## 작성자
|
|
297
|
+
|
|
298
|
+
daawoonkim
|
|
299
|
+
|
|
300
|
+
## 참고
|
|
301
|
+
|
|
302
|
+
이 프로젝트는 현대적인 프론트엔드 개발 모범 사례와 다양한 아키텍처 패턴을 기반으로 합니다.
|
package/README.md
CHANGED
|
@@ -7,174 +7,186 @@
|
|
|
7
7
|
[](https://github.com/hec8897/create-arch-app/actions/workflows/test.yml)
|
|
8
8
|
[](https://github.com/hec8897/create-arch-app/actions/workflows/lint.yml)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**🌐 Language**: **English** | [한국어](./README.ko.md)
|
|
11
|
+
|
|
12
|
+
An interactive CLI tool to create React/Next.js projects with DDD, Clean Architecture, and Atomic Design patterns.
|
|
11
13
|
|
|
12
14
|
**📦 npm**: https://www.npmjs.com/package/@daawoonkim/create-arch-app
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
**📝 CHANGELOG**: [English](./CHANGELOG.md) | [한국어](./CHANGELOG.ko.md)
|
|
17
|
+
|
|
18
|
+
> ⚠️ **Currently in MVP (Minimum Viable Product) stage.** Core features are working, but actively developing and accepting feedback. Please report issues or suggestions on [GitHub Issues](https://github.com/hec8897/create-arch-app/issues)!
|
|
15
19
|
|
|
16
|
-
##
|
|
20
|
+
## Features
|
|
17
21
|
|
|
18
|
-
✨ **4
|
|
22
|
+
✨ **4 Architecture Patterns**
|
|
19
23
|
- DDD (Domain-Driven Design)
|
|
20
24
|
- Clean Architecture
|
|
21
25
|
- Atomic Design
|
|
22
|
-
- Default (
|
|
26
|
+
- Default (simple structure)
|
|
23
27
|
|
|
24
|
-
🚀
|
|
28
|
+
🚀 **Framework Options**
|
|
25
29
|
- React (with Vite)
|
|
26
30
|
- Next.js (App Router / Pages Router)
|
|
27
31
|
|
|
28
|
-
💎 **TypeScript
|
|
32
|
+
💎 **TypeScript by Default**
|
|
29
33
|
|
|
30
|
-
🎨
|
|
34
|
+
🎨 **Styling Options**
|
|
31
35
|
- Tailwind CSS
|
|
32
36
|
- CSS Modules
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
- 테스팅: Vitest + Testing Library
|
|
38
|
+
🌐 **API Integration**
|
|
39
|
+
- HTTP Clients: Axios, Fetch API
|
|
40
|
+
- Data Fetching: TanStack Query (React Query), SWR
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
📦 **Optional Libraries**
|
|
43
|
+
- State Management: Zustand, Context API
|
|
44
|
+
- Forms: React Hook Form
|
|
45
|
+
- Testing: Vitest + Testing Library
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
## Installation & Usage
|
|
48
|
+
|
|
49
|
+
### Quick Start with npx (Recommended)
|
|
42
50
|
|
|
43
51
|
```bash
|
|
44
|
-
#
|
|
52
|
+
# Create project in a new directory
|
|
45
53
|
npx @daawoonkim/create-arch-app my-app
|
|
46
54
|
|
|
47
|
-
#
|
|
55
|
+
# Or create in the current directory
|
|
48
56
|
npx @daawoonkim/create-arch-app .
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
###
|
|
59
|
+
### Global Installation
|
|
52
60
|
|
|
53
61
|
```bash
|
|
54
62
|
npm install -g @daawoonkim/create-arch-app
|
|
55
63
|
|
|
56
|
-
#
|
|
64
|
+
# Create project in a new directory
|
|
57
65
|
create-arch-app my-app
|
|
58
66
|
|
|
59
|
-
#
|
|
67
|
+
# Create in current directory
|
|
60
68
|
create-arch-app .
|
|
61
69
|
```
|
|
62
70
|
|
|
63
|
-
>
|
|
71
|
+
> **Note**: When using current directory (`.`), the directory must be empty.
|
|
64
72
|
|
|
65
|
-
###
|
|
73
|
+
### Interactive Prompts
|
|
66
74
|
|
|
67
|
-
CLI
|
|
75
|
+
When you run the CLI, you'll answer these questions:
|
|
68
76
|
|
|
69
|
-
1.
|
|
70
|
-
2. **Next.js
|
|
71
|
-
3.
|
|
72
|
-
4.
|
|
73
|
-
5.
|
|
74
|
-
6.
|
|
75
|
-
7.
|
|
76
|
-
8.
|
|
77
|
+
1. **Framework**: React or Next.js
|
|
78
|
+
2. **Next.js Version** (Next.js only): Latest (recommended), 15.x, 14.x, 13.x
|
|
79
|
+
3. **Router** (Next.js only): App Router (recommended) or Pages Router
|
|
80
|
+
4. **Architecture Pattern**: DDD, Clean, Atomic, Default
|
|
81
|
+
5. **Styling**: Tailwind CSS or CSS Modules
|
|
82
|
+
6. **State Management**: Zustand, Context API, None
|
|
83
|
+
7. **Form Library**: React Hook Form or None
|
|
84
|
+
8. **HTTP Client**: Axios, Fetch API, None
|
|
85
|
+
9. **Data Fetching**: TanStack Query (React Query), SWR, None
|
|
86
|
+
10. **Testing**: Include Vitest + Testing Library
|
|
77
87
|
|
|
78
|
-
##
|
|
88
|
+
## Example Usage
|
|
79
89
|
|
|
80
90
|
```bash
|
|
81
91
|
npx @daawoonkim/create-arch-app my-enterprise-app
|
|
82
92
|
|
|
83
|
-
#
|
|
84
|
-
?
|
|
85
|
-
? Next.js
|
|
86
|
-
? Next.js
|
|
87
|
-
?
|
|
88
|
-
?
|
|
89
|
-
?
|
|
90
|
-
?
|
|
91
|
-
?
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
# Interactive prompts
|
|
94
|
+
? Select framework: Next.js
|
|
95
|
+
? Select Next.js version: Latest (Recommended)
|
|
96
|
+
? Select Next.js router: App Router (Recommended)
|
|
97
|
+
? Select architecture pattern: DDD (Domain-Driven Design)
|
|
98
|
+
? Select styling tool: Tailwind CSS
|
|
99
|
+
? Select state management: Zustand
|
|
100
|
+
? Select form library: React Hook Form
|
|
101
|
+
? Select HTTP client: Axios (Recommended)
|
|
102
|
+
? Select data fetching library: TanStack Query (React Query) - Recommended
|
|
103
|
+
? Include testing tools? Yes
|
|
104
|
+
|
|
105
|
+
✨ Creating project...
|
|
106
|
+
📦 Setting up TypeScript project (default)
|
|
107
|
+
🚀 Using Next.js App Router
|
|
108
|
+
✅ Project created!
|
|
109
|
+
|
|
110
|
+
🎉 Project successfully created!
|
|
111
|
+
|
|
112
|
+
Get started with:
|
|
101
113
|
cd my-enterprise-app
|
|
102
114
|
npm install
|
|
103
115
|
npm run dev
|
|
104
116
|
```
|
|
105
117
|
|
|
106
|
-
##
|
|
118
|
+
## Architecture Patterns
|
|
107
119
|
|
|
108
120
|
### DDD (Domain-Driven Design)
|
|
109
121
|
|
|
110
|
-
|
|
122
|
+
Perfect for enterprise-grade applications.
|
|
111
123
|
|
|
112
124
|
```
|
|
113
|
-
domain/ #
|
|
125
|
+
domain/ # Business entities and logic
|
|
114
126
|
├── entities/
|
|
115
127
|
├── repositories/
|
|
116
128
|
└── services/
|
|
117
|
-
application/ #
|
|
129
|
+
application/ # Use cases
|
|
118
130
|
├── usecases/
|
|
119
131
|
└── ports/
|
|
120
|
-
infrastructure/ #
|
|
132
|
+
infrastructure/ # External service integration
|
|
121
133
|
├── api/
|
|
122
134
|
└── persistence/
|
|
123
|
-
presentation/ # UI
|
|
135
|
+
presentation/ # UI components
|
|
124
136
|
├── components/
|
|
125
137
|
└── pages/
|
|
126
138
|
```
|
|
127
139
|
|
|
128
140
|
### Clean Architecture
|
|
129
141
|
|
|
130
|
-
|
|
142
|
+
Focuses on dependency rules and layer separation.
|
|
131
143
|
|
|
132
144
|
```
|
|
133
|
-
core/ #
|
|
145
|
+
core/ # Business logic
|
|
134
146
|
├── entities/
|
|
135
147
|
├── usecases/
|
|
136
148
|
└── interfaces/
|
|
137
|
-
features/ #
|
|
149
|
+
features/ # Feature modules
|
|
138
150
|
└── [feature]/
|
|
139
151
|
├── domain/
|
|
140
152
|
├── data/
|
|
141
153
|
└── presentation/
|
|
142
|
-
shared/ #
|
|
154
|
+
shared/ # Shared components
|
|
143
155
|
├── components/
|
|
144
156
|
└── utils/
|
|
145
157
|
```
|
|
146
158
|
|
|
147
159
|
### Atomic Design
|
|
148
160
|
|
|
149
|
-
|
|
161
|
+
Optimized for UI component-driven development.
|
|
150
162
|
|
|
151
163
|
```
|
|
152
164
|
components/
|
|
153
|
-
├── atoms/ #
|
|
154
|
-
├── molecules/ # atoms
|
|
155
|
-
├── organisms/ # molecules
|
|
156
|
-
├── templates/ #
|
|
157
|
-
└── pages/ #
|
|
165
|
+
├── atoms/ # Smallest UI units
|
|
166
|
+
├── molecules/ # Combinations of atoms
|
|
167
|
+
├── organisms/ # Combinations of molecules
|
|
168
|
+
├── templates/ # Page layouts
|
|
169
|
+
└── pages/ # Actual pages
|
|
158
170
|
hooks/
|
|
159
171
|
utils/
|
|
160
172
|
```
|
|
161
173
|
|
|
162
174
|
### Default
|
|
163
175
|
|
|
164
|
-
|
|
176
|
+
Simple structure for quick start.
|
|
165
177
|
|
|
166
178
|
```
|
|
167
179
|
components/
|
|
168
180
|
hooks/
|
|
169
|
-
pages/ (
|
|
181
|
+
pages/ (or app/)
|
|
170
182
|
utils/
|
|
171
183
|
styles/
|
|
172
184
|
types/
|
|
173
185
|
```
|
|
174
186
|
|
|
175
|
-
##
|
|
187
|
+
## Generated File Structure
|
|
176
188
|
|
|
177
|
-
### React
|
|
189
|
+
### React Project
|
|
178
190
|
|
|
179
191
|
```
|
|
180
192
|
my-app/
|
|
@@ -190,152 +202,101 @@ my-app/
|
|
|
190
202
|
└── README.md
|
|
191
203
|
```
|
|
192
204
|
|
|
193
|
-
### Next.js
|
|
205
|
+
### Next.js Project (App Router)
|
|
194
206
|
|
|
195
207
|
```
|
|
196
208
|
my-app/
|
|
197
|
-
├──
|
|
198
|
-
│ ├──
|
|
199
|
-
│ ├──
|
|
200
|
-
│
|
|
201
|
-
|
|
209
|
+
├── src/
|
|
210
|
+
│ ├── app/
|
|
211
|
+
│ │ ├── layout.tsx
|
|
212
|
+
│ │ ├── page.tsx
|
|
213
|
+
│ │ └── globals.css
|
|
214
|
+
│ └── [architecture folders]
|
|
202
215
|
├── next.config.js
|
|
203
216
|
├── tsconfig.json
|
|
204
217
|
├── package.json
|
|
205
218
|
└── README.md
|
|
206
219
|
```
|
|
207
220
|
|
|
208
|
-
### Next.js
|
|
221
|
+
### Next.js Project (Pages Router)
|
|
209
222
|
|
|
210
223
|
```
|
|
211
224
|
my-app/
|
|
212
|
-
├──
|
|
213
|
-
│ ├──
|
|
214
|
-
│ ├──
|
|
215
|
-
│
|
|
216
|
-
|
|
217
|
-
│
|
|
218
|
-
|
|
225
|
+
├── src/
|
|
226
|
+
│ ├── pages/
|
|
227
|
+
│ │ ├── _app.tsx
|
|
228
|
+
│ │ ├── _document.tsx
|
|
229
|
+
│ │ └── index.tsx
|
|
230
|
+
│ ├── styles/
|
|
231
|
+
│ │ └── globals.css
|
|
232
|
+
│ └── [architecture folders]
|
|
219
233
|
├── next.config.js
|
|
220
234
|
├── tsconfig.json
|
|
221
235
|
├── package.json
|
|
222
236
|
└── README.md
|
|
223
237
|
```
|
|
224
238
|
|
|
225
|
-
##
|
|
239
|
+
## Requirements
|
|
226
240
|
|
|
227
|
-
- Node.js 18.0.0
|
|
241
|
+
- Node.js 18.0.0 or higher
|
|
228
242
|
|
|
229
|
-
##
|
|
243
|
+
## Version History
|
|
230
244
|
|
|
231
|
-
|
|
245
|
+
### v0.2.0 - Latest (2025-01-26)
|
|
232
246
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
# TypeScript 컴파일
|
|
242
|
-
npm run build
|
|
243
|
-
|
|
244
|
-
# 로컬 링크 생성
|
|
245
|
-
npm link
|
|
247
|
+
**Major Updates:**
|
|
248
|
+
- ✅ API library integration (Axios, Fetch API, TanStack Query, SWR)
|
|
249
|
+
- ✅ Architecture-specific API file generation
|
|
250
|
+
- ✅ Improved Next.js project structure (`src/` directory + absolute paths)
|
|
251
|
+
- ✅ CI/CD automation (GitHub Actions)
|
|
252
|
+
- ✅ Automatic npm deployment on main branch merge
|
|
253
|
+
- ✅ Enhanced documentation (CHANGELOG, CONTRIBUTING, WORKFLOWS)
|
|
246
254
|
|
|
247
|
-
|
|
248
|
-
cd ~/test-project
|
|
249
|
-
create-arch-app my-test-app
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### npm 배포
|
|
255
|
+
See [CHANGELOG.md](./CHANGELOG.md) for details.
|
|
253
256
|
|
|
254
|
-
|
|
257
|
+
### v0.1.0 - MVP Release
|
|
255
258
|
|
|
256
|
-
|
|
259
|
+
**Features:**
|
|
260
|
+
- ✅ 4 architecture patterns (DDD, Clean Architecture, Atomic Design, Default)
|
|
261
|
+
- ✅ React (Vite) & Next.js (App Router / Pages Router) support
|
|
262
|
+
- ✅ Next.js version selection (Latest, 15.x, 14.x, 13.x)
|
|
263
|
+
- ✅ TypeScript by default
|
|
264
|
+
- ✅ Styling: Tailwind CSS, CSS Modules
|
|
265
|
+
- ✅ State Management: Zustand, Context API
|
|
266
|
+
- ✅ Forms: React Hook Form
|
|
267
|
+
- ✅ Testing: Vitest + Testing Library
|
|
268
|
+
- ✅ Current directory creation support (`.` option)
|
|
269
|
+
- ✅ Automatic folder structure and README generation
|
|
257
270
|
|
|
258
|
-
|
|
259
|
-
# 1. 버전 업데이트
|
|
260
|
-
npm version patch # 0.1.0 → 0.1.1
|
|
271
|
+
## Roadmap
|
|
261
272
|
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
### v0.3.0 (Planned)
|
|
274
|
+
- [ ] Additional UI library integration (shadcn/ui, MUI)
|
|
275
|
+
- [ ] More testing and stability improvements
|
|
276
|
+
- [ ] Component generator
|
|
264
277
|
|
|
265
|
-
|
|
266
|
-
|
|
278
|
+
### Future Plans
|
|
279
|
+
- [ ] Additional architecture patterns (Feature-Sliced Design, Hexagonal Architecture)
|
|
280
|
+
- [ ] More state management options (Redux Toolkit, Jotai, Recoil)
|
|
281
|
+
- [ ] Authentication integration (NextAuth, Supabase)
|
|
282
|
+
- [ ] ORM integration (Prisma, Drizzle)
|
|
283
|
+
- [ ] Docker setup
|
|
284
|
+
- [ ] Monorepo support (Turborepo)
|
|
267
285
|
|
|
268
|
-
##
|
|
286
|
+
## Contributing
|
|
269
287
|
|
|
270
|
-
|
|
288
|
+
Bug reports, feature suggestions, and PRs are welcome!
|
|
271
289
|
|
|
272
|
-
|
|
273
|
-
- ✅ 4가지 아키텍처 패턴 (DDD, Clean Architecture, Atomic Design, Default)
|
|
274
|
-
- ✅ React (Vite) & Next.js (App Router / Pages Router) 지원
|
|
275
|
-
- ✅ Next.js 버전 선택 (Latest, 15.x, 14.x, 13.x)
|
|
276
|
-
- ✅ TypeScript 기본 포함
|
|
277
|
-
- ✅ 스타일링: Tailwind CSS, CSS Modules
|
|
278
|
-
- ✅ 상태관리: Zustand, Context API
|
|
279
|
-
- ✅ 폼: React Hook Form
|
|
280
|
-
- ✅ 테스팅: Vitest + Testing Library
|
|
281
|
-
- ✅ 현재 디렉토리 생성 지원 (`.` 옵션)
|
|
282
|
-
|
|
283
|
-
**알려진 제한사항:**
|
|
284
|
-
- 일부 조합에서 테스트가 완료되지 않았을 수 있습니다
|
|
285
|
-
- 에러 처리 개선 필요
|
|
286
|
-
- 더 많은 커스터마이징 옵션 추가 예정
|
|
287
|
-
|
|
288
|
-
## 로드맵
|
|
289
|
-
|
|
290
|
-
### v0.2.0 (계획 중)
|
|
291
|
-
- [ ] 추가 UI 라이브러리 통합 (shadcn/ui, MUI)
|
|
292
|
-
- [ ] 더 많은 테스트 및 안정성 개선
|
|
293
|
-
- [ ] 컴포넌트 생성기 추가
|
|
294
|
-
|
|
295
|
-
### v0.3.0 이후
|
|
296
|
-
- [ ] 추가 아키텍처 패턴 (Feature-Sliced Design, Hexagonal Architecture)
|
|
297
|
-
- [ ] 추가 상태관리 옵션 (Redux Toolkit, Jotai, Recoil)
|
|
298
|
-
- [ ] 인증 통합 (NextAuth, Supabase)
|
|
299
|
-
- [ ] ORM 통합 (Prisma, Drizzle)
|
|
300
|
-
- [ ] CI/CD 설정 자동화
|
|
301
|
-
- [ ] Docker 설정 포함
|
|
302
|
-
- [ ] Monorepo 지원 (Turborepo)
|
|
303
|
-
|
|
304
|
-
## 기여하기
|
|
305
|
-
|
|
306
|
-
버그 리포트, 기능 제안, PR 모두 환영합니다!
|
|
307
|
-
|
|
308
|
-
자세한 내용은 [CONTRIBUTING.md](./CONTRIBUTING.md)를 참조하세요.
|
|
309
|
-
|
|
310
|
-
### 개발 환경 설정
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
# 저장소 클론
|
|
314
|
-
git clone git@github.com:hec8897/create-arch-app.git
|
|
315
|
-
cd create-arch-app
|
|
316
|
-
|
|
317
|
-
# 의존성 설치
|
|
318
|
-
npm install
|
|
319
|
-
|
|
320
|
-
# TypeScript 컴파일
|
|
321
|
-
npm run build
|
|
322
|
-
|
|
323
|
-
# 로컬 링크 생성
|
|
324
|
-
npm link
|
|
325
|
-
|
|
326
|
-
# 테스트
|
|
327
|
-
cd ~/test-project
|
|
328
|
-
create-arch-app my-test-app
|
|
329
|
-
```
|
|
290
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
330
291
|
|
|
331
|
-
##
|
|
292
|
+
## License
|
|
332
293
|
|
|
333
294
|
MIT
|
|
334
295
|
|
|
335
|
-
##
|
|
296
|
+
## Author
|
|
336
297
|
|
|
337
298
|
daawoonkim
|
|
338
299
|
|
|
339
|
-
##
|
|
300
|
+
## Credits
|
|
340
301
|
|
|
341
|
-
|
|
302
|
+
This project is based on modern frontend development best practices and various architectural patterns.
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-arch-app MVP
|
|
3
|
+
overview: DDD, Clean Architecture, Atomic Design을 지원하는 React/Next.js 보일러플레이트 CLI 도구를 개발하고 npm에 배포합니다. MVP는 4개 아키텍처 패턴과 핵심 라이브러리 선택 기능을 포함합니다.
|
|
4
|
+
todos:
|
|
5
|
+
- id: setup-project
|
|
6
|
+
content: 프로젝트 초기화 및 TypeScript 설정, 필수 의존성 설치
|
|
7
|
+
status: completed
|
|
8
|
+
- id: cli-structure
|
|
9
|
+
content: CLI 진입점 및 Commander.js 명령어 구조 구현
|
|
10
|
+
status: completed
|
|
11
|
+
- id: prompts
|
|
12
|
+
content: inquirer.js 대화형 프롬프트 구현 (프레임워크, 아키텍처, 라이브러리 선택)
|
|
13
|
+
status: completed
|
|
14
|
+
- id: templates-ddd
|
|
15
|
+
content: DDD 아키텍처 템플릿 작성 (React, Next.js)
|
|
16
|
+
status: completed
|
|
17
|
+
- id: templates-clean
|
|
18
|
+
content: Clean Architecture 템플릿 작성 (React, Next.js)
|
|
19
|
+
status: completed
|
|
20
|
+
- id: templates-default
|
|
21
|
+
content: Default 기본 구조 템플릿 작성 (React, Next.js)
|
|
22
|
+
status: completed
|
|
23
|
+
- id: templates-atomic
|
|
24
|
+
content: Atomic Design 템플릿 작성 (React, Next.js)
|
|
25
|
+
status: completed
|
|
26
|
+
- id: file-generator
|
|
27
|
+
content: 파일 시스템 로직 구현 (템플릿 복사, 동적 파일 생성)
|
|
28
|
+
status: completed
|
|
29
|
+
- id: package-json-gen
|
|
30
|
+
content: 선택한 라이브러리에 따른 package.json 동적 생성
|
|
31
|
+
status: completed
|
|
32
|
+
- id: config-files
|
|
33
|
+
content: 설정 파일 생성 로직 (tsconfig, tailwind.config 등)
|
|
34
|
+
status: completed
|
|
35
|
+
- id: testing
|
|
36
|
+
content: 32가지 주요 조합 테스트 및 검증
|
|
37
|
+
status: pending
|
|
38
|
+
- id: documentation
|
|
39
|
+
content: README.md, LICENSE 작성 및 npm 메타데이터 설정
|
|
40
|
+
status: completed
|
|
41
|
+
- id: git-setup
|
|
42
|
+
content: GitHub 저장소 설정 및 첫 커밋 푸시
|
|
43
|
+
status: completed
|
|
44
|
+
- id: npm-publish
|
|
45
|
+
content: npm 배포 및 v0.1.0 릴리즈
|
|
46
|
+
status: completed
|
|
47
|
+
isProject: false
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
# create-arch-app CLI 도구 개발 및 배포 계획
|
|
51
|
+
|
|
52
|
+
## 프로젝트 개요
|
|
53
|
+
|
|
54
|
+
**패키지명**: `create-arch-app`
|
|
55
|
+
|
|
56
|
+
**목표**: DDD, Clean Architecture, Atomic Design을 지원하는 대화형 React/Next.js 프로젝트 생성 CLI
|
|
57
|
+
|
|
58
|
+
**MVP 범위**: 4개 아키텍처 패턴 + React/Next.js + 핵심 라이브러리 5가지
|
|
59
|
+
|
|
60
|
+
## 아키텍처 결정
|
|
61
|
+
|
|
62
|
+
### 지원할 아키텍처 패턴 (MVP)
|
|
63
|
+
|
|
64
|
+
1. **DDD (Domain-Driven Design)**
|
|
65
|
+
- 폴더 구조: `domain/`, `application/`, `infrastructure/`, `presentation/`
|
|
66
|
+
- 엔터프라이즈급 애플리케이션에 적합
|
|
67
|
+
|
|
68
|
+
2. **Clean Architecture**
|
|
69
|
+
- 폴더 구조: `core/`, `features/`, `shared/`, `app/`
|
|
70
|
+
- 의존성 규칙과 레이어 분리 중심
|
|
71
|
+
|
|
72
|
+
3. **Atomic Design**
|
|
73
|
+
- 폴더 구조: `atoms/`, `molecules/`, `organisms/`, `templates/`, `pages/`
|
|
74
|
+
- UI 컴포넌트 중심 개발에 최적화
|
|
75
|
+
|
|
76
|
+
4. **Default (기본 구조)**
|
|
77
|
+
- 폴더 구조: `components/`, `pages/`, `hooks/`, `utils/`, `styles/`
|
|
78
|
+
- 빠른 시작을 원하는 개발자용
|
|
79
|
+
|
|
80
|
+
### 지원할 라이브러리 (MVP)
|
|
81
|
+
|
|
82
|
+
- **TypeScript**: 기본 활성화 (모든 프로젝트에 기본 포함)
|
|
83
|
+
- **번들러**: Vite (React 프로젝트용, Next.js는 자체 번들러 사용)
|
|
84
|
+
- **스타일링**: Tailwind CSS / CSS Modules
|
|
85
|
+
- **상태관리**: Zustand / Context API / None
|
|
86
|
+
- **폼 관리**: React Hook Form / None
|
|
87
|
+
- **테스팅**: Vitest + Testing Library / None
|
|
88
|
+
|
|
89
|
+
## 기술 스택
|
|
90
|
+
|
|
91
|
+
### CLI 도구 개발
|
|
92
|
+
|
|
93
|
+
- **언어**: TypeScript
|
|
94
|
+
- **CLI 프레임워크**: Commander.js (명령어 파싱)
|
|
95
|
+
- **대화형 프롬프트**: inquirer.js
|
|
96
|
+
- **파일 시스템**: fs-extra
|
|
97
|
+
- **템플릿 엔진**: Handlebars (동적 파일 생성)
|
|
98
|
+
- **패키지 관리자 감지**: which-pm-runs, which-pm
|
|
99
|
+
|
|
100
|
+
### 생성되는 프로젝트 기술 스택
|
|
101
|
+
|
|
102
|
+
- **TypeScript**: 모든 프로젝트에 기본 포함
|
|
103
|
+
- **React 번들러**: Vite (빠른 개발 서버 및 빌드)
|
|
104
|
+
- **Next.js 번들러**: 내장 번들러 (Turbopack/Webpack)
|
|
105
|
+
|
|
106
|
+
### 프로젝트 구조
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
create-arch-app/
|
|
110
|
+
├── bin/
|
|
111
|
+
│ └── cli.js # CLI 진입점
|
|
112
|
+
├── src/
|
|
113
|
+
│ ├── commands/
|
|
114
|
+
│ │ └── create.ts # 프로젝트 생성 명령
|
|
115
|
+
│ ├── prompts/
|
|
116
|
+
│ │ └── projectSetup.ts # 대화형 질문
|
|
117
|
+
│ ├── generators/
|
|
118
|
+
│ │ ├── react.ts # React 프로젝트 생성
|
|
119
|
+
│ │ └── nextjs.ts # Next.js 프로젝트 생성
|
|
120
|
+
│ ├── templates/
|
|
121
|
+
│ │ ├── react/
|
|
122
|
+
│ │ │ ├── ddd/ # DDD 구조 템플릿
|
|
123
|
+
│ │ │ ├── clean/ # Clean Architecture 템플릿
|
|
124
|
+
│ │ │ ├── atomic/ # Atomic Design 템플릿
|
|
125
|
+
│ │ │ └── default/ # 기본 구조 템플릿
|
|
126
|
+
│ │ └── nextjs/
|
|
127
|
+
│ │ ├── app-router/ # App Router 기반
|
|
128
|
+
│ │ │ ├── ddd/
|
|
129
|
+
│ │ │ ├── clean/
|
|
130
|
+
│ │ │ ├── atomic/
|
|
131
|
+
│ │ │ └── default/
|
|
132
|
+
│ │ └── pages-router/ # Pages Router 기반
|
|
133
|
+
│ │ ├── ddd/
|
|
134
|
+
│ │ ├── clean/
|
|
135
|
+
│ │ ├── atomic/
|
|
136
|
+
│ │ └── default/
|
|
137
|
+
│ ├── utils/
|
|
138
|
+
│ │ ├── fileSystem.ts # 파일 복사/생성
|
|
139
|
+
│ │ ├── packageManager.ts # npm/yarn/pnpm 감지
|
|
140
|
+
│ │ └── dependencies.ts # package.json 생성
|
|
141
|
+
│ └── index.ts
|
|
142
|
+
├── package.json
|
|
143
|
+
├── tsconfig.json
|
|
144
|
+
└── README.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 구현 단계
|
|
148
|
+
|
|
149
|
+
### Phase 1: CLI 기본 구조 (1-2일)
|
|
150
|
+
|
|
151
|
+
**핵심 파일 구성**:
|
|
152
|
+
|
|
153
|
+
- `package.json`: bin 필드에 CLI 진입점 설정
|
|
154
|
+
- `bin/cli.js`: Shebang(#!/usr/bin/env node) 추가
|
|
155
|
+
- `src/index.ts`: Commander.js로 명령어 정의
|
|
156
|
+
- `src/prompts/projectSetup.ts`: inquirer.js로 대화형 질문 구현
|
|
157
|
+
|
|
158
|
+
**주요 프롬프트 항목**:
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
// 예시 코드
|
|
162
|
+
{
|
|
163
|
+
projectName: string,
|
|
164
|
+
framework: 'react' | 'nextjs',
|
|
165
|
+
router?: 'app' | 'pages', // Next.js만 해당
|
|
166
|
+
architecture: 'ddd' | 'clean' | 'atomic' | 'default',
|
|
167
|
+
// typescript: true (기본값, 프롬프트에서 제외)
|
|
168
|
+
styling: 'tailwind' | 'css-modules',
|
|
169
|
+
stateManagement: 'zustand' | 'context' | 'none',
|
|
170
|
+
formLibrary: 'react-hook-form' | 'none',
|
|
171
|
+
testing: boolean
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Phase 2: 템플릿 작성 (3-4일)
|
|
176
|
+
|
|
177
|
+
각 아키텍처별로 템플릿 폴더 구조 생성:
|
|
178
|
+
|
|
179
|
+
**템플릿 구분**:
|
|
180
|
+
|
|
181
|
+
- React (Vite): 단일 템플릿
|
|
182
|
+
- Next.js: App Router / Pages Router 각각 별도 템플릿
|
|
183
|
+
|
|
184
|
+
**Next.js 라우터별 차이점**:
|
|
185
|
+
|
|
186
|
+
- App Router: `app/` 디렉토리, Server Components 기본, `layout.tsx`, `page.tsx`
|
|
187
|
+
- Pages Router: `pages/` 디렉토리, `_app.tsx`, `_document.tsx`, `index.tsx`
|
|
188
|
+
|
|
189
|
+
**DDD 템플릿 구조**:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
domain/
|
|
193
|
+
├── entities/ # 비즈니스 엔티티
|
|
194
|
+
├── repositories/ # 리포지토리 인터페이스
|
|
195
|
+
└── services/ # 도메인 서비스
|
|
196
|
+
application/
|
|
197
|
+
├── usecases/ # 유스케이스
|
|
198
|
+
└── ports/ # 포트 인터페이스
|
|
199
|
+
infrastructure/
|
|
200
|
+
├── api/ # API 클라이언트
|
|
201
|
+
└── persistence/ # 데이터 영속성
|
|
202
|
+
presentation/
|
|
203
|
+
├── components/ # UI 컴포넌트
|
|
204
|
+
└── pages/ # 페이지
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Clean Architecture 템플릿**:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
core/
|
|
211
|
+
├── entities/
|
|
212
|
+
├── usecases/
|
|
213
|
+
└── interfaces/
|
|
214
|
+
features/
|
|
215
|
+
└── [feature-name]/
|
|
216
|
+
├── domain/
|
|
217
|
+
├── data/
|
|
218
|
+
└── presentation/
|
|
219
|
+
shared/
|
|
220
|
+
├── components/
|
|
221
|
+
└── utils/
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Atomic Design 템플릿**:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
components/
|
|
228
|
+
├── atoms/ # 가장 작은 UI 단위 (Button, Input, Label)
|
|
229
|
+
├── molecules/ # atoms 조합 (SearchBar, FormField)
|
|
230
|
+
├── organisms/ # molecules 조합 (Header, Footer, Form)
|
|
231
|
+
├── templates/ # 페이지 레이아웃
|
|
232
|
+
└── pages/ # 실제 페이지 구현
|
|
233
|
+
hooks/
|
|
234
|
+
utils/
|
|
235
|
+
styles/
|
|
236
|
+
types/
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Default 템플릿**:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
components/
|
|
243
|
+
hooks/
|
|
244
|
+
pages/ (또는 app/)
|
|
245
|
+
utils/
|
|
246
|
+
styles/
|
|
247
|
+
types/
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**React 프로젝트 추가 설정 파일**:
|
|
251
|
+
|
|
252
|
+
- `vite.config.ts`: Vite 설정
|
|
253
|
+
- `index.html`: Vite 진입점
|
|
254
|
+
- `src/main.tsx`: 애플리케이션 진입점
|
|
255
|
+
|
|
256
|
+
**Next.js 프로젝트 설정 파일**:
|
|
257
|
+
|
|
258
|
+
- `next.config.js`: Next.js 설정
|
|
259
|
+
|
|
260
|
+
**App Router (Next.js 13+)** 사용 시:
|
|
261
|
+
|
|
262
|
+
- `app/layout.tsx`: 루트 레이아웃
|
|
263
|
+
- `app/page.tsx`: 홈 페이지
|
|
264
|
+
- `app/globals.css`: 전역 스타일
|
|
265
|
+
|
|
266
|
+
**Pages Router (Next.js 12 이하)** 사용 시:
|
|
267
|
+
|
|
268
|
+
- `pages/_app.tsx`: 앱 래퍼
|
|
269
|
+
- `pages/_document.tsx`: 문서 구조
|
|
270
|
+
- `pages/index.tsx`: 홈 페이지
|
|
271
|
+
- `styles/globals.css`: 전역 스타일
|
|
272
|
+
|
|
273
|
+
**공통 TypeScript 설정**:
|
|
274
|
+
|
|
275
|
+
- `tsconfig.json`: 모든 프로젝트에 포함
|
|
276
|
+
- `tsconfig.node.json`: Vite 프로젝트용 (Node 환경)
|
|
277
|
+
|
|
278
|
+
Handlebars 템플릿 예시 (모든 파일이 TypeScript):
|
|
279
|
+
|
|
280
|
+
```handlebars
|
|
281
|
+
export interface Props { title: string; } export const Component = ({ title }:
|
|
282
|
+
Props) => { return
|
|
283
|
+
<div>{title}</div>; };
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Phase 3: 파일 생성 로직 (2-3일)
|
|
287
|
+
|
|
288
|
+
**핵심 기능**:
|
|
289
|
+
|
|
290
|
+
1. 선택한 아키텍처에 맞는 폴더 구조 생성
|
|
291
|
+
2. 선택한 라이브러리에 따라 `package.json` 동적 생성
|
|
292
|
+
3. 설정 파일 생성 (tsconfig.json, tailwind.config.js 등)
|
|
293
|
+
4. README.md 자동 생성 (선택한 옵션 기반)
|
|
294
|
+
|
|
295
|
+
**의존성 매핑**:
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
const dependencies = {
|
|
299
|
+
react: {
|
|
300
|
+
react: "^18.2.0",
|
|
301
|
+
"react-dom": "^18.2.0",
|
|
302
|
+
},
|
|
303
|
+
reactDev: {
|
|
304
|
+
vite: "^5.0.0",
|
|
305
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
306
|
+
typescript: "^5.3.0",
|
|
307
|
+
"@types/react": "^18.2.0",
|
|
308
|
+
"@types/react-dom": "^18.2.0",
|
|
309
|
+
},
|
|
310
|
+
nextjs: {
|
|
311
|
+
next: "^14.0.0",
|
|
312
|
+
react: "^18.2.0",
|
|
313
|
+
typescript: "^5.3.0",
|
|
314
|
+
"@types/react": "^18.2.0",
|
|
315
|
+
"@types/node": "^20.0.0",
|
|
316
|
+
},
|
|
317
|
+
tailwind: {
|
|
318
|
+
tailwindcss: "^3.4.0",
|
|
319
|
+
autoprefixer: "^10.4.0",
|
|
320
|
+
postcss: "^8.4.0",
|
|
321
|
+
},
|
|
322
|
+
zustand: { zustand: "^4.4.0" },
|
|
323
|
+
// ...
|
|
324
|
+
};
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Phase 4: 테스트 및 검증 (1-2일)
|
|
328
|
+
|
|
329
|
+
1. 각 조합별 프로젝트 생성 테스트 (모두 TypeScript 기본)
|
|
330
|
+
- React + Vite + DDD + Tailwind
|
|
331
|
+
- Next.js + App Router + Clean + Zustand
|
|
332
|
+
- Next.js + Pages Router + DDD + CSS Modules
|
|
333
|
+
- React + Vite + Atomic + CSS Modules
|
|
334
|
+
- 총 32가지 주요 조합 검증 (Next.js 라우터 2가지 × 4 아키텍처 = 8가지 추가)
|
|
335
|
+
|
|
336
|
+
2. 생성된 프로젝트가 정상 실행되는지 확인
|
|
337
|
+
- `npm install` 성공
|
|
338
|
+
- `npm run dev` 실행 (React: Vite 개발 서버, Next.js: Next.js 개발 서버)
|
|
339
|
+
- TypeScript 컴파일 오류 없음
|
|
340
|
+
- 빌드 오류 없음 (`npm run build`)
|
|
341
|
+
|
|
342
|
+
### Phase 5: npm 배포 (1일)
|
|
343
|
+
|
|
344
|
+
**배포 전 체크리스트**:
|
|
345
|
+
|
|
346
|
+
- [ ] package.json 메타데이터 작성
|
|
347
|
+
- name, version, description
|
|
348
|
+
- keywords, author, license
|
|
349
|
+
- repository, bugs, homepage
|
|
350
|
+
- [ ] README.md 작성
|
|
351
|
+
- 설치 방법
|
|
352
|
+
- 사용 예시
|
|
353
|
+
- 지원하는 옵션
|
|
354
|
+
- 예시 스크린샷
|
|
355
|
+
- [ ] LICENSE 파일 (MIT 권장)
|
|
356
|
+
- [ ] .npmignore 설정 (불필요한 파일 제외)
|
|
357
|
+
|
|
358
|
+
**npm 계정 및 배포**:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
npm login
|
|
362
|
+
npm publish --access public
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**버전 관리**:
|
|
366
|
+
|
|
367
|
+
- 초기 릴리즈: v0.1.0 (MVP)
|
|
368
|
+
- Semantic Versioning 적용
|
|
369
|
+
|
|
370
|
+
## 실행 플로우
|
|
371
|
+
|
|
372
|
+
```mermaid
|
|
373
|
+
flowchart TD
|
|
374
|
+
Start[npx create-arch-app my-app] --> CheckName{프로젝트명 유효?}
|
|
375
|
+
CheckName -->|No| AskName[프로젝트명 입력]
|
|
376
|
+
CheckName -->|Yes| Framework[프레임워크 선택]
|
|
377
|
+
AskName --> Framework
|
|
378
|
+
|
|
379
|
+
Framework --> Router{Next.js?}
|
|
380
|
+
Router -->|Yes| RouterType[라우터 선택: App/Pages]
|
|
381
|
+
Router -->|No React| Arch[아키텍처 패턴 선택]
|
|
382
|
+
RouterType --> Arch
|
|
383
|
+
Arch --> Style[스타일링 도구 선택]
|
|
384
|
+
Style --> State[상태관리 선택]
|
|
385
|
+
State --> Form[폼 라이브러리 선택]
|
|
386
|
+
Form --> Test[테스팅 도구 선택]
|
|
387
|
+
|
|
388
|
+
Test --> Generate[파일 생성]
|
|
389
|
+
Generate --> Install[의존성 설치]
|
|
390
|
+
Install --> Success[완료 메시지 출력]
|
|
391
|
+
|
|
392
|
+
Success --> End[프로젝트 준비 완료]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## 예상 사용 시나리오
|
|
396
|
+
|
|
397
|
+
### 사용자 실행 예시
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
npx create-arch-app my-enterprise-app
|
|
401
|
+
|
|
402
|
+
# 대화형 프롬프트
|
|
403
|
+
? 프레임워크를 선택하세요: Next.js
|
|
404
|
+
? Next.js 라우터를 선택하세요: App Router (권장)
|
|
405
|
+
? 아키텍처 패턴을 선택하세요: DDD (Domain-Driven Design)
|
|
406
|
+
? 스타일링 도구를 선택하세요: Tailwind CSS
|
|
407
|
+
? 상태관리 라이브러리를 선택하세요: Zustand
|
|
408
|
+
? 폼 라이브러리를 선택하세요: React Hook Form
|
|
409
|
+
? 테스팅 도구를 포함하시겠습니까? Yes
|
|
410
|
+
|
|
411
|
+
✨ 프로젝트 생성 중...
|
|
412
|
+
📦 TypeScript 프로젝트로 설정됩니다 (기본값)
|
|
413
|
+
🚀 Next.js App Router 사용
|
|
414
|
+
✅ 폴더 구조 생성 완료
|
|
415
|
+
✅ 의존성 설치 완료
|
|
416
|
+
|
|
417
|
+
🎉 프로젝트가 성공적으로 생성되었습니다!
|
|
418
|
+
|
|
419
|
+
다음 명령어로 시작하세요:
|
|
420
|
+
cd my-enterprise-app
|
|
421
|
+
npm run dev
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## MVP 이후 확장 가능성
|
|
425
|
+
|
|
426
|
+
1. **추가 아키텍처 패턴**
|
|
427
|
+
- Feature-Sliced Design
|
|
428
|
+
- Modular Architecture
|
|
429
|
+
- Hexagonal Architecture
|
|
430
|
+
|
|
431
|
+
2. **더 많은 라이브러리 옵션**
|
|
432
|
+
- UI: shadcn/ui, MUI, Ant Design
|
|
433
|
+
- 상태관리: Redux Toolkit, Jotai, Recoil
|
|
434
|
+
- 인증: NextAuth, Supabase
|
|
435
|
+
- ORM: Prisma, Drizzle
|
|
436
|
+
|
|
437
|
+
3. **고급 기능**
|
|
438
|
+
- 컴포넌트 생성기 (rorg 처럼)
|
|
439
|
+
- CI/CD 설정 자동화
|
|
440
|
+
- Docker 설정 포함
|
|
441
|
+
- Monorepo 지원 (Turborepo)
|
|
442
|
+
|
|
443
|
+
## 성공 지표
|
|
444
|
+
|
|
445
|
+
- npm 다운로드 수
|
|
446
|
+
- GitHub 스타 수
|
|
447
|
+
- 커뮤니티 피드백 및 이슈
|
|
448
|
+
- 실제 프로덕션 사용 사례
|
|
449
|
+
|
|
450
|
+
## 참고 리소스
|
|
451
|
+
|
|
452
|
+
- **유사 프로젝트 분석**: rorg, CleanNextBoilerplateCLI
|
|
453
|
+
- **템플릿 참고**: nextjs-clean-architecture-starter
|
|
454
|
+
- **CLI 개발 가이드**: Commander.js, inquirer.js 공식 문서
|