# {{project_name}} Coding Conventions > PDCA Convention Document - 코드 작성 규칙 정의 **Version**: 1.0 **Created**: {{date}} **Level**: {{level}} --- ## 1. Naming Conventions ### Files & Folders | Target | Rule | Example | |--------|------|---------| | Component files | PascalCase | `UserProfile.tsx` | | Utility files | camelCase | `formatDate.ts` | | Folders | kebab-case | `user-profile/` | | Constants | UPPER_SNAKE_CASE | `API_ENDPOINTS.ts` | ### Code | Target | Rule | Example | |--------|------|---------| | Components | PascalCase | `UserProfile` | | Functions | camelCase | `getUserById()` | | Variables | camelCase | `userName` | | Constants | UPPER_SNAKE_CASE | `MAX_RETRY` | | Types/Interfaces | PascalCase | `UserProfile` | --- ## 2. Folder Structure ``` src/ ├── components/ # UI 컴포넌트 ├── features/ # 기능별 모듈 ├── hooks/ # Custom hooks ├── lib/ # 유틸리티 ├── types/ # 타입 정의 └── styles/ # 스타일 ``` --- ## 3. Import Order ```typescript // 1. External libraries import React from 'react' // 2. Internal absolute (@/) import { Button } from '@/components/ui' // 3. Relative imports import { useUser } from './hooks' // 4. Type imports import type { User } from '@/types' // 5. Styles import './styles.css' ``` --- ## 4. Environment Variables ### Naming Convention | Prefix | Scope | Example | |--------|-------|---------| | `NEXT_PUBLIC_` | Client-side | `NEXT_PUBLIC_API_URL` | | `DB_` | Database | `DB_HOST`, `DB_PASSWORD` | | `API_` | API keys | `API_SECRET_KEY` | | `AUTH_` | Authentication | `AUTH_JWT_SECRET` | ### Required Files - `.env.local` - 로컬 개발용 - `.env.example` - 템플릿 (커밋) - `lib/env.ts` - 환경변수 검증 --- ## 5. Code Style - Indentation: 2 spaces - Quotes: Single quotes (') - Semicolons: None (Prettier) - Max line length: 100 --- ## 6. Commit Message ``` type(scope): description Types: feat, fix, docs, style, refactor, test, chore ``` --- ## Validation Checklist - [ ] Naming convention 정의됨 - [ ] Folder structure 정의됨 - [ ] Import order 정의됨 - [ ] Environment variables 정의됨 - [ ] Code style 설정됨 --- *Generated by hmcmkit PDCA System*