chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환 - Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용 - pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관) - worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md) - D:\Rhino-MCP 경로 참조를 새 위치로 치환 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
964a841de1
3978 files changed
+58013356
No files matched your search
@@ -0,0 +1,65 @@
|
||||
# Schema Definition
|
||||
|
||||
> Phase 1 Deliverable: Project data structure definition
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. Terminology Definition
|
||||
|
||||
| Term | Definition | Original Term | Notes |
|
||||
|------|------------|---------------|-------|
|
||||
| | | | |
|
||||
|
||||
---
|
||||
|
||||
## 2. Entity List
|
||||
|
||||
| Entity | Description | Key Attributes |
|
||||
|--------|-------------|----------------|
|
||||
| | | |
|
||||
|
||||
---
|
||||
|
||||
## 3. Entity Details
|
||||
|
||||
### 3.1 {{Entity1}}
|
||||
|
||||
**Description**:
|
||||
|
||||
**Attributes**:
|
||||
| Attribute | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| id | string | Y | Unique identifier |
|
||||
| | | | |
|
||||
|
||||
**Relationships**:
|
||||
- 1:N → {{RelatedEntity}}
|
||||
|
||||
---
|
||||
|
||||
## 4. Entity Relationship Diagram
|
||||
|
||||
```
|
||||
[Entity1] 1 ─── N [Entity2]
|
||||
│
|
||||
└── 1 ─── N [Entity3]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Validation Checklist
|
||||
|
||||
- [ ] All core entities defined
|
||||
- [ ] Terms are clear and consistent
|
||||
- [ ] Entity relationships are clear
|
||||
- [ ] No missing attributes
|
||||
|
||||
---
|
||||
|
||||
## 6. Next Steps
|
||||
|
||||
Proceed to Phase 2: Coding Convention Definition
|
||||
@@ -0,0 +1,207 @@
|
||||
# Coding Conventions
|
||||
|
||||
> Phase 2 Deliverable: Code writing rules definition
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. Naming Conventions
|
||||
|
||||
### 1.1 Files/Folders
|
||||
| Target | Rule | Example |
|
||||
|--------|------|---------|
|
||||
| Component files | PascalCase | `UserProfile.tsx` |
|
||||
| Utility files | camelCase | `formatDate.ts` |
|
||||
| Folders | kebab-case | `user-profile/` |
|
||||
| Constant files | UPPER_SNAKE_CASE | `API_ENDPOINTS.ts` |
|
||||
|
||||
### 1.2 Code
|
||||
| Target | Rule | Example |
|
||||
|--------|------|---------|
|
||||
| Components | PascalCase | `UserProfile` |
|
||||
| Functions | camelCase | `getUserById` |
|
||||
| Variables | camelCase | `userName` |
|
||||
| Constants | UPPER_SNAKE_CASE | `MAX_RETRY_COUNT` |
|
||||
| Types/Interfaces | PascalCase | `UserProfile` |
|
||||
| Enum | PascalCase | `UserRole` |
|
||||
|
||||
---
|
||||
|
||||
## 2. Folder Structure
|
||||
|
||||
```
|
||||
src/
|
||||
├── components/ # Reusable components
|
||||
│ ├── ui/ # Basic UI components
|
||||
│ └── common/ # Common components
|
||||
├── features/ # Feature-based modules
|
||||
│ └── {{feature}}/
|
||||
│ ├── components/
|
||||
│ ├── hooks/
|
||||
│ └── types.ts
|
||||
├── hooks/ # Common custom hooks
|
||||
├── utils/ # Utility functions
|
||||
├── types/ # Global type definitions
|
||||
├── constants/ # Constants
|
||||
└── styles/ # Global styles
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Code Style
|
||||
|
||||
### 3.1 General
|
||||
- Indentation: 2 spaces
|
||||
- Quotes: Single quotes (')
|
||||
- Semicolons: None
|
||||
|
||||
### 3.2 Functions
|
||||
```typescript
|
||||
// Preferred: Arrow functions
|
||||
const handleClick = () => {
|
||||
// ...
|
||||
}
|
||||
|
||||
// Components: function declaration
|
||||
function UserProfile({ user }: Props) {
|
||||
return <div>{user.name}</div>
|
||||
}
|
||||
```
|
||||
|
||||
### 3.3 Import Order
|
||||
```typescript
|
||||
// 1. External libraries
|
||||
import { useState } from 'react'
|
||||
|
||||
// 2. Internal modules (absolute paths)
|
||||
import { Button } from '@/components/ui'
|
||||
|
||||
// 3. Relative paths
|
||||
import { useUser } from './hooks'
|
||||
|
||||
// 4. Types
|
||||
import type { User } from '@/types'
|
||||
|
||||
// 5. Styles
|
||||
import './styles.css'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Component Rules
|
||||
|
||||
### 4.1 Structure
|
||||
```typescript
|
||||
// 1. Import
|
||||
// 2. Type definition
|
||||
// 3. Constants
|
||||
// 4. Component
|
||||
// 5. Export
|
||||
```
|
||||
|
||||
### 4.2 Props
|
||||
```typescript
|
||||
interface Props {
|
||||
user: User
|
||||
onSelect?: (user: User) => void
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Environment Variable Conventions
|
||||
|
||||
### 5.1 Naming Rules
|
||||
| Prefix | Purpose | Exposure |
|
||||
|--------|---------|----------|
|
||||
| `NEXT_PUBLIC_` | Client-side accessible | Browser |
|
||||
| `DB_` | Database | Server only |
|
||||
| `API_` | External API keys | Server only |
|
||||
| `AUTH_` | Authentication | Server only |
|
||||
|
||||
### 5.2 .env File Structure
|
||||
```
|
||||
project-root/
|
||||
├── .env.example # Template (included in Git)
|
||||
├── .env.local # Local development (Git ignored)
|
||||
├── .env.development # Development environment
|
||||
├── .env.staging # Staging environment
|
||||
└── .env.production # Production (no sensitive info)
|
||||
```
|
||||
|
||||
### 5.3 Environment Variable List
|
||||
| Variable | Purpose | Exposed | Secrets |
|
||||
|----------|---------|:-------:|:-------:|
|
||||
| `NEXT_PUBLIC_APP_URL` | App URL | ✅ | |
|
||||
| `DATABASE_URL` | DB connection | | ✅ |
|
||||
| `AUTH_SECRET` | Auth secret | | ✅ |
|
||||
| | | | |
|
||||
|
||||
---
|
||||
|
||||
## 6. Clean Architecture
|
||||
|
||||
### 6.1 Layer Structure (Level: {{level}})
|
||||
|
||||
**Starter**:
|
||||
```
|
||||
src/
|
||||
├── components/ # UI
|
||||
├── lib/ # Utilities
|
||||
└── types/ # Types
|
||||
```
|
||||
|
||||
**Dynamic**:
|
||||
```
|
||||
src/
|
||||
├── components/ # Presentation
|
||||
├── features/ # Application + Presentation
|
||||
├── services/ # Application
|
||||
├── types/ # Domain
|
||||
└── lib/api/ # Infrastructure
|
||||
```
|
||||
|
||||
**Enterprise**:
|
||||
```
|
||||
src/
|
||||
├── presentation/ # UI, hooks
|
||||
├── application/ # services, use-cases
|
||||
├── domain/ # entities, types
|
||||
└── infrastructure/ # api, db
|
||||
```
|
||||
|
||||
### 6.2 Dependency Rules
|
||||
| Layer | Can Depend On | Cannot Depend On |
|
||||
|-------|---------------|------------------|
|
||||
| Presentation | Application, Domain | Infrastructure directly |
|
||||
| Application | Domain, Infrastructure | Presentation |
|
||||
| Domain | None (independent) | All external layers |
|
||||
| Infrastructure | Domain | Presentation |
|
||||
|
||||
---
|
||||
|
||||
## 7. Validation Checklist
|
||||
|
||||
### Naming/Structure
|
||||
- [ ] Naming rules are clear
|
||||
- [ ] Folder structure is defined
|
||||
- [ ] Code style is consistent
|
||||
- [ ] Matches ESLint/Prettier config
|
||||
|
||||
### Environment Variables
|
||||
- [ ] .env.example completed
|
||||
- [ ] Environment variable naming rules followed
|
||||
- [ ] Secrets list organized (for Phase 9 deployment)
|
||||
|
||||
### Architecture
|
||||
- [ ] Layer structure decided (matching level)
|
||||
- [ ] Dependency direction rules defined
|
||||
|
||||
---
|
||||
|
||||
## 8. Next Steps
|
||||
|
||||
Proceed to Phase 3: Mockup Development
|
||||
@@ -0,0 +1,103 @@
|
||||
# Mockup Specification
|
||||
|
||||
> Phase 3 Deliverable: HTML/CSS/JS mockup definition
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. Mockup Scope
|
||||
|
||||
### 1.1 Screens to Implement
|
||||
| Screen | File | Description | Priority |
|
||||
|--------|------|-------------|----------|
|
||||
| Home | `index.html` | Main page | High |
|
||||
| | | | |
|
||||
|
||||
### 1.2 Mock Data
|
||||
| Data | File | Description |
|
||||
|------|------|-------------|
|
||||
| Users | `data/users.json` | User list |
|
||||
| | | |
|
||||
|
||||
---
|
||||
|
||||
## 2. Screen Details
|
||||
|
||||
### 2.1 {{PageName}}
|
||||
|
||||
**Path**: `mockup/pages/{{page}}.html`
|
||||
|
||||
**Layout**:
|
||||
```
|
||||
┌─────────────────────────────────┐
|
||||
│ Header │
|
||||
├─────────────────────────────────┤
|
||||
│ │
|
||||
│ Content │
|
||||
│ │
|
||||
├─────────────────────────────────┤
|
||||
│ Footer │
|
||||
└─────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Key Features**:
|
||||
- [ ] Feature 1
|
||||
- [ ] Feature 2
|
||||
|
||||
**Interactions**:
|
||||
- Button click → Show modal
|
||||
- Form submit → Display result
|
||||
|
||||
---
|
||||
|
||||
## 3. Mock Data Structure
|
||||
|
||||
### 3.1 {{DataName}}
|
||||
|
||||
```json
|
||||
// data/{{data}}.json
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Sample",
|
||||
...
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Folder Structure
|
||||
|
||||
```
|
||||
mockup/
|
||||
├── pages/
|
||||
│ ├── index.html
|
||||
│ └── ...
|
||||
├── styles/
|
||||
│ └── main.css
|
||||
├── scripts/
|
||||
│ └── app.js
|
||||
└── data/
|
||||
└── *.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Validation Checklist
|
||||
|
||||
- [ ] All main screens implemented
|
||||
- [ ] Interactions are working
|
||||
- [ ] Feature verification possible with mock data
|
||||
- [ ] Responsive design considered
|
||||
|
||||
---
|
||||
|
||||
## 6. Next Steps
|
||||
|
||||
Proceed to Phase 4: API Design/Implementation (Starter skips to Phase 5)
|
||||
@@ -0,0 +1,151 @@
|
||||
# API Design Specification
|
||||
|
||||
> Phase 4 Deliverable: API endpoint definition
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. API Overview
|
||||
|
||||
**Base URL**: `{{base_url}}`
|
||||
**Authentication**: Bearer Token / Session
|
||||
|
||||
---
|
||||
|
||||
## 2. Common Standards
|
||||
|
||||
### 2.1 RESTful Principles
|
||||
- URL: Resource-based (nouns, plural) - `/users`, `/products`
|
||||
- HTTP Methods: GET(read), POST(create), PUT(full update), PATCH(partial update), DELETE(delete)
|
||||
- Status Codes: 2xx(success), 4xx(client error), 5xx(server error)
|
||||
|
||||
### 2.2 Response Format (Standard)
|
||||
```json
|
||||
// Success Response
|
||||
{
|
||||
"data": { ... },
|
||||
"meta": {
|
||||
"timestamp": "2026-01-08T10:00:00Z"
|
||||
}
|
||||
}
|
||||
|
||||
// Error Response
|
||||
{
|
||||
"error": {
|
||||
"code": "ERROR_CODE",
|
||||
"message": "User-friendly message",
|
||||
"details": [
|
||||
{ "field": "email", "message": "Please enter a valid email" }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// Pagination Response
|
||||
{
|
||||
"data": [...],
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"limit": 20,
|
||||
"total": 100,
|
||||
"totalPages": 5
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2.3 Error Codes
|
||||
| Code | HTTP Status | Description |
|
||||
|------|-------------|-------------|
|
||||
| VALIDATION_ERROR | 400 | Validation failed |
|
||||
| UNAUTHORIZED | 401 | Authentication required |
|
||||
| FORBIDDEN | 403 | Permission denied |
|
||||
| NOT_FOUND | 404 | Resource not found |
|
||||
| CONFLICT | 409 | Conflict (duplicate, etc.) |
|
||||
| INTERNAL_ERROR | 500 | Internal server error |
|
||||
|
||||
---
|
||||
|
||||
## 3. Endpoints
|
||||
|
||||
### 3.1 Authentication API
|
||||
|
||||
#### POST /api/auth/login
|
||||
Login
|
||||
|
||||
**Request**:
|
||||
```json
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"password": "password123"
|
||||
}
|
||||
```
|
||||
|
||||
**Response** (200 OK):
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"user": {
|
||||
"id": "1",
|
||||
"email": "user@example.com",
|
||||
"name": "User"
|
||||
},
|
||||
"token": "jwt_token",
|
||||
"expiresAt": "2026-01-09T10:00:00Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3.2 {{Resource}} API
|
||||
|
||||
#### GET /api/{{resources}}
|
||||
List all
|
||||
|
||||
**Query Parameters**:
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| page | number | N | Page number (default: 1) |
|
||||
| limit | number | N | Items per page (default: 20) |
|
||||
|
||||
**Response** (200 OK):
|
||||
```json
|
||||
{
|
||||
"data": [...],
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"limit": 20,
|
||||
"total": 100,
|
||||
"totalPages": 5
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### GET /api/{{resources}}/:id
|
||||
Get detail
|
||||
|
||||
#### POST /api/{{resources}}
|
||||
Create
|
||||
|
||||
#### PUT /api/{{resources}}/:id
|
||||
Update
|
||||
|
||||
#### DELETE /api/{{resources}}/:id
|
||||
Delete
|
||||
|
||||
---
|
||||
|
||||
## 4. Validation Checklist
|
||||
|
||||
- [ ] All required endpoints defined
|
||||
- [ ] Request/Response formats are clear
|
||||
- [ ] Error handling is defined
|
||||
- [ ] Authentication/Authorization policies are clear
|
||||
|
||||
---
|
||||
|
||||
## 5. Next Steps
|
||||
|
||||
Proceed to Phase 5: Design System
|
||||
@@ -0,0 +1,126 @@
|
||||
# Design System Specification
|
||||
|
||||
> Phase 5 Deliverable: Component system definition
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. Design Tokens
|
||||
|
||||
### 1.1 Colors
|
||||
```css
|
||||
:root {
|
||||
/* Primary */
|
||||
--primary: #0066FF;
|
||||
--primary-hover: #0052CC;
|
||||
|
||||
/* Neutral */
|
||||
--background: #FFFFFF;
|
||||
--foreground: #171717;
|
||||
--muted: #F5F5F5;
|
||||
|
||||
/* Semantic */
|
||||
--success: #22C55E;
|
||||
--warning: #F59E0B;
|
||||
--error: #EF4444;
|
||||
}
|
||||
```
|
||||
|
||||
### 1.2 Typography
|
||||
| Name | Size | Weight | Usage |
|
||||
|------|------|--------|-------|
|
||||
| h1 | 36px | 700 | Page title |
|
||||
| h2 | 24px | 600 | Section title |
|
||||
| body | 16px | 400 | Body text |
|
||||
| small | 14px | 400 | Helper text |
|
||||
|
||||
### 1.3 Spacing
|
||||
```
|
||||
4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Component List
|
||||
|
||||
### 2.1 Basic Components
|
||||
| Component | Status | Description |
|
||||
|-----------|--------|-------------|
|
||||
| Button | ✅ | Button |
|
||||
| Input | ✅ | Input field |
|
||||
| Card | ✅ | Card container |
|
||||
| Badge | ✅ | Badge/Tag |
|
||||
| Avatar | ✅ | Avatar |
|
||||
|
||||
### 2.2 Form Components
|
||||
| Component | Status | Description |
|
||||
|-----------|--------|-------------|
|
||||
| Form | ✅ | Form wrapper |
|
||||
| Label | ✅ | Label |
|
||||
| Select | ✅ | Select dropdown |
|
||||
| Checkbox | ✅ | Checkbox |
|
||||
|
||||
### 2.3 Feedback Components
|
||||
| Component | Status | Description |
|
||||
|-----------|--------|-------------|
|
||||
| Dialog | ✅ | Dialog/Modal |
|
||||
| Toast | ✅ | Toast notification |
|
||||
| Alert | ✅ | Alert banner |
|
||||
|
||||
---
|
||||
|
||||
## 3. Component Details
|
||||
|
||||
### 3.1 Button
|
||||
|
||||
**Variants**:
|
||||
- `default`: Default style
|
||||
- `outline`: Border only
|
||||
- `ghost`: No background
|
||||
- `destructive`: Delete/Danger action
|
||||
|
||||
**Sizes**:
|
||||
- `sm`: Small button
|
||||
- `default`: Default size
|
||||
- `lg`: Large button
|
||||
|
||||
**Usage Example**:
|
||||
```tsx
|
||||
<Button variant="default" size="default">
|
||||
Button
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" size="sm">
|
||||
Small Button
|
||||
</Button>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Installed Components
|
||||
|
||||
```bash
|
||||
# shadcn/ui component installation log
|
||||
npx shadcn@latest add button
|
||||
npx shadcn@latest add input
|
||||
npx shadcn@latest add card
|
||||
# ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Validation Checklist
|
||||
|
||||
- [ ] All required basic components exist
|
||||
- [ ] Design tokens applied consistently
|
||||
- [ ] Accessibility (a11y) considered
|
||||
- [ ] Responsive design supported
|
||||
|
||||
---
|
||||
|
||||
## 6. Next Steps
|
||||
|
||||
Proceed to Phase 6: UI Implementation + API Integration
|
||||
@@ -0,0 +1,235 @@
|
||||
# UI Implementation Specification
|
||||
|
||||
> Phase 6 Deliverable: Screen implementation and API integration
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. Page List
|
||||
|
||||
| Page | Route | File | Status |
|
||||
|------|-------|------|--------|
|
||||
| Home | `/` | `app/page.tsx` | ⬜ |
|
||||
| Login | `/login` | `app/login/page.tsx` | ⬜ |
|
||||
| | | | |
|
||||
|
||||
---
|
||||
|
||||
## 2. Page Details
|
||||
|
||||
### 2.1 {{PageName}}
|
||||
|
||||
**Route**: `{{path}}`
|
||||
**File**: `{{file}}`
|
||||
|
||||
**Layout**:
|
||||
```
|
||||
┌─────────────────────────────────┐
|
||||
│ Header │
|
||||
├─────────────────────────────────┤
|
||||
│ │
|
||||
│ Content │
|
||||
│ │
|
||||
└─────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Components Used**:
|
||||
- `Header`
|
||||
- `Card`
|
||||
- `Button`
|
||||
|
||||
**API Integration**:
|
||||
| API | Purpose | Hook |
|
||||
|-----|---------|------|
|
||||
| GET /api/users | User list | `useUsers()` |
|
||||
|
||||
**State Management**:
|
||||
- `isLoading`: Loading state
|
||||
- `error`: Error state
|
||||
- `data`: Data
|
||||
|
||||
---
|
||||
|
||||
## 3. Custom Hooks
|
||||
|
||||
### 3.1 useAuth
|
||||
```typescript
|
||||
function useAuth() {
|
||||
// Authentication state management
|
||||
return { user, login, logout, isLoading }
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2 use{{Resource}}
|
||||
```typescript
|
||||
function use{{Resource}}() {
|
||||
// {{Resource}} CRUD
|
||||
return { data, isLoading, error, create, update, remove }
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. State Management Architecture
|
||||
|
||||
```
|
||||
Server State: React Query / SWR
|
||||
├── useQuery: Read operations
|
||||
├── useMutation: Create/Update/Delete
|
||||
└── Cache invalidation
|
||||
|
||||
Client State: useState / Zustand
|
||||
├── UI state (modals, toggles, etc.)
|
||||
└── Form state
|
||||
|
||||
Global State: Context / Zustand
|
||||
├── Authentication info
|
||||
└── Theme settings
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. API Client Architecture
|
||||
|
||||
### 5.1 3-Layer Structure
|
||||
```
|
||||
UI Components
|
||||
↓
|
||||
Service Layer (business logic)
|
||||
↓
|
||||
API Client Layer (HTTP communication)
|
||||
```
|
||||
|
||||
### 5.2 API Client Configuration
|
||||
```typescript
|
||||
// lib/api/client.ts
|
||||
class ApiClient {
|
||||
private baseUrl: string
|
||||
|
||||
async request<T>(endpoint: string, config = {}): Promise<ApiResponse<T>> {
|
||||
const headers = new Headers(config.headers)
|
||||
headers.set('Content-Type', 'application/json')
|
||||
|
||||
// Auto-inject token
|
||||
const token = this.getToken()
|
||||
if (token) headers.set('Authorization', `Bearer ${token}`)
|
||||
|
||||
// Execute request and handle errors
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
export const apiClient = new ApiClient()
|
||||
```
|
||||
|
||||
### 5.3 Service Layer Pattern
|
||||
```typescript
|
||||
// services/{{resource}}Service.ts
|
||||
export const {{resource}}Service = {
|
||||
getList(filter?: Filter) {
|
||||
return apiClient.get<PaginatedResponse<Item>>('/{{resources}}', params)
|
||||
},
|
||||
getById(id: string) {
|
||||
return apiClient.get<Item>(`/{{resources}}/${id}`)
|
||||
},
|
||||
create(data: CreateInput) {
|
||||
return apiClient.post<Item>('/{{resources}}', data)
|
||||
},
|
||||
update(id: string, data: UpdateInput) {
|
||||
return apiClient.put<Item>(`/{{resources}}/${id}`, data)
|
||||
},
|
||||
delete(id: string) {
|
||||
return apiClient.delete<void>(`/{{resources}}/${id}`)
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Error Handling
|
||||
|
||||
### 6.1 Error Type Definition
|
||||
```typescript
|
||||
// types/api.ts
|
||||
interface ApiError {
|
||||
code: string
|
||||
message: string
|
||||
details?: Array<{ field: string; message: string }>
|
||||
}
|
||||
|
||||
// Error code constants
|
||||
const ERROR_CODES = {
|
||||
VALIDATION_ERROR: 'Please check your input',
|
||||
UNAUTHORIZED: 'Login required',
|
||||
FORBIDDEN: 'Permission denied',
|
||||
NOT_FOUND: 'Resource not found',
|
||||
INTERNAL_ERROR: 'Server error occurred',
|
||||
} as const
|
||||
```
|
||||
|
||||
### 6.2 Error Boundary
|
||||
```typescript
|
||||
<ErrorBoundary fallback={<ErrorPage />}>
|
||||
<App />
|
||||
</ErrorBoundary>
|
||||
```
|
||||
|
||||
### 6.3 API Error Handling
|
||||
```typescript
|
||||
// In custom hook
|
||||
if (error) {
|
||||
const message = ERROR_CODES[error.code] || error.message
|
||||
return <Alert variant="destructive">{message}</Alert>
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Client-Side Security
|
||||
|
||||
### 7.1 Security Checklist
|
||||
- [ ] XSS prevention (escape user input)
|
||||
- [ ] CSRF token included (in API requests)
|
||||
- [ ] No sensitive info stored on client
|
||||
- [ ] httpOnly cookies used (auth tokens)
|
||||
|
||||
### 7.2 Token Management
|
||||
```typescript
|
||||
// Recommended: httpOnly cookies (server-side setting)
|
||||
// Fallback: localStorage (aware of XSS risk)
|
||||
localStorage.setItem('auth_token', token)
|
||||
|
||||
// Prohibited: Storing passwords, card numbers, etc.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. Validation Checklist
|
||||
|
||||
### 8.1 UI Implementation
|
||||
- [ ] All pages implemented
|
||||
- [ ] Responsive design applied
|
||||
- [ ] Design system (Phase 5) followed
|
||||
|
||||
### 8.2 API Integration
|
||||
- [ ] API client 3-layer structure applied
|
||||
- [ ] Service layer separated
|
||||
- [ ] API response format (Phase 4) followed
|
||||
|
||||
### 8.3 State Management
|
||||
- [ ] Loading state handled
|
||||
- [ ] Error state handled
|
||||
- [ ] User-friendly error messages per error code
|
||||
|
||||
### 8.4 Security (Phase 7 prep)
|
||||
- [ ] XSS prevention applied
|
||||
- [ ] No sensitive data exposed
|
||||
|
||||
---
|
||||
|
||||
## 9. Next Steps
|
||||
|
||||
Proceed to Phase 7: SEO/Security
|
||||
@@ -0,0 +1,151 @@
|
||||
# SEO/Security Specification
|
||||
|
||||
> Phase 7 Deliverable: Search optimization and security configuration
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Date**: {{date}}
|
||||
**Version**: 1.0
|
||||
|
||||
---
|
||||
|
||||
## 1. SEO Configuration
|
||||
|
||||
### 1.1 Metadata
|
||||
|
||||
**Global Settings** (`app/layout.tsx`):
|
||||
```typescript
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
default: '{{siteName}}',
|
||||
template: '%s | {{siteName}}',
|
||||
},
|
||||
description: '{{siteDescription}}',
|
||||
keywords: ['keyword1', 'keyword2'],
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
locale: 'en_US',
|
||||
url: '{{siteUrl}}',
|
||||
siteName: '{{siteName}}',
|
||||
images: [{ url: '/og-image.png' }],
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
### 1.2 Page-specific Metadata
|
||||
| Page | Title | Description |
|
||||
|------|-------|-------------|
|
||||
| Home | {{siteName}} | {{siteDescription}} |
|
||||
| | | |
|
||||
|
||||
### 1.3 Structured Data
|
||||
```json
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": "{{siteName}}",
|
||||
"url": "{{siteUrl}}"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Sitemap & Robots
|
||||
|
||||
### 2.1 sitemap.xml
|
||||
```typescript
|
||||
// app/sitemap.ts
|
||||
export default function sitemap() {
|
||||
return [
|
||||
{ url: '{{siteUrl}}', lastModified: new Date() },
|
||||
// Add dynamic pages
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 2.2 robots.txt
|
||||
```typescript
|
||||
// app/robots.ts
|
||||
export default function robots() {
|
||||
return {
|
||||
rules: { userAgent: '*', allow: '/' },
|
||||
sitemap: '{{siteUrl}}/sitemap.xml',
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Security Settings
|
||||
|
||||
### 3.1 Authentication/Authorization
|
||||
| Item | Setting | Status |
|
||||
|------|---------|--------|
|
||||
| Session management | JWT / Session | ⬜ |
|
||||
| CSRF protection | Token | ⬜ |
|
||||
| Permission check | Middleware | ⬜ |
|
||||
|
||||
### 3.2 Security Headers
|
||||
```typescript
|
||||
// next.config.js
|
||||
headers: [
|
||||
{
|
||||
key: 'X-Frame-Options',
|
||||
value: 'DENY',
|
||||
},
|
||||
{
|
||||
key: 'X-Content-Type-Options',
|
||||
value: 'nosniff',
|
||||
},
|
||||
{
|
||||
key: 'Referrer-Policy',
|
||||
value: 'origin-when-cross-origin',
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
### 3.3 Input Validation
|
||||
- [ ] Server-side validation
|
||||
- [ ] XSS prevention (escape handling)
|
||||
- [ ] SQL injection prevention (parameterized queries)
|
||||
|
||||
---
|
||||
|
||||
## 4. Performance Optimization
|
||||
|
||||
### 4.1 Images
|
||||
- [ ] Use next/image
|
||||
- [ ] WebP format
|
||||
- [ ] Appropriate sizes setting
|
||||
|
||||
### 4.2 Fonts
|
||||
- [ ] Use next/font
|
||||
- [ ] Apply subset
|
||||
|
||||
### 4.3 Code Splitting
|
||||
- [ ] Dynamic imports
|
||||
- [ ] Lazy loading
|
||||
|
||||
---
|
||||
|
||||
## 5. Validation Checklist
|
||||
|
||||
### SEO
|
||||
- [ ] All pages have metadata
|
||||
- [ ] Open Graph is configured
|
||||
- [ ] sitemap.xml is generated
|
||||
- [ ] robots.txt is correct
|
||||
|
||||
### Security
|
||||
- [ ] Authentication works properly
|
||||
- [ ] Security headers are set
|
||||
- [ ] Input validation is implemented
|
||||
- [ ] HTTPS is enforced
|
||||
|
||||
---
|
||||
|
||||
## 6. Next Steps
|
||||
|
||||
Proceed to Phase 8: Architecture/Convention Review
|
||||
@@ -0,0 +1,191 @@
|
||||
# Code Review Report
|
||||
|
||||
> Phase 8 Deliverable: Architecture/Convention review results
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Review Date**: {{date}}
|
||||
**Reviewer**: {{reviewer}}
|
||||
|
||||
---
|
||||
|
||||
## 1. Review Scope
|
||||
|
||||
- [x] Architecture consistency
|
||||
- [x] Convention compliance (Phase 2)
|
||||
- [x] API consistency (Phase 4)
|
||||
- [x] UI-API integration (Phase 6)
|
||||
- [x] Security vulnerabilities (Phase 7)
|
||||
- [x] Environment variable settings (Phase 2/9)
|
||||
|
||||
---
|
||||
|
||||
## 2. Phase Verification Matrix
|
||||
|
||||
### 2.1 Design Phase Verification
|
||||
| Phase | Verification Item | Status | Notes |
|
||||
|-------|------------------|--------|-------|
|
||||
| 1 | Terminology consistency | ✅/⚠️/❌ | |
|
||||
| 2 | Convention definition | ✅/⚠️/❌ | |
|
||||
| 3 | Mockup approval | ✅/⚠️/❌ | |
|
||||
| 4 | API specification | ✅/⚠️/❌ | |
|
||||
| 5 | Design system | ✅/⚠️/❌ | |
|
||||
|
||||
### 2.2 Implementation Phase Verification
|
||||
| Phase | Verification Item | Status | Notes |
|
||||
|-------|------------------|--------|-------|
|
||||
| 6 | UI-API integration | ✅/⚠️/❌ | |
|
||||
| 7 | SEO/Security | ✅/⚠️/❌ | |
|
||||
|
||||
### 2.3 Environment Variable Verification
|
||||
| Item | Phase 2 Definition | Phase 9 Setting | Status |
|
||||
|------|-------------------|-----------------|--------|
|
||||
| NEXT_PUBLIC_* | ✅/❌ | ✅/❌ | |
|
||||
| DATABASE_URL | ✅/❌ | ✅/❌ | |
|
||||
| AUTH_SECRET | ✅/❌ | ✅/❌ | |
|
||||
|
||||
---
|
||||
|
||||
## 3. Architecture Review
|
||||
|
||||
### 3.1 Folder Structure (Based on Phase 2)
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Matches convention | ✅/⚠️/❌ | |
|
||||
| Separation of concerns | ✅/⚠️/❌ | |
|
||||
| Dependency direction | ✅/⚠️/❌ | |
|
||||
|
||||
### 3.2 Clean Architecture Verification
|
||||
| Layer | Dependency Rule | Status |
|
||||
|-------|-----------------|--------|
|
||||
| Presentation | → Application, Domain only | ✅/❌ |
|
||||
| Application | → Domain, Infrastructure only | ✅/❌ |
|
||||
| Domain | Independent (no dependencies) | ✅/❌ |
|
||||
| Infrastructure | → Domain only | ✅/❌ |
|
||||
|
||||
### 3.3 Discovered Issues
|
||||
| ID | Severity | Location | Description | Recommended Action |
|
||||
|----|----------|----------|-------------|-------------------|
|
||||
| A-1 | High/Medium/Low | | | |
|
||||
|
||||
---
|
||||
|
||||
## 4. Convention Review (Phase 2)
|
||||
|
||||
### 4.1 Naming
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Files/Folders | ✅/⚠️/❌ | |
|
||||
| Variables/Functions | ✅/⚠️/❌ | |
|
||||
| Components | ✅/⚠️/❌ | |
|
||||
|
||||
### 4.2 Code Style
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Import order | ✅/⚠️/❌ | |
|
||||
| Type definitions | ✅/⚠️/❌ | |
|
||||
|
||||
### 4.3 Discovered Issues
|
||||
| ID | Severity | Location | Description | Recommended Action |
|
||||
|----|----------|----------|-------------|-------------------|
|
||||
| C-1 | | | | |
|
||||
|
||||
---
|
||||
|
||||
## 5. API Consistency Review (Phase 4)
|
||||
|
||||
### 5.1 RESTful Principles
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Resource-based URLs | ✅/⚠️/❌ | |
|
||||
| Appropriate HTTP methods | ✅/⚠️/❌ | |
|
||||
| Status code consistency | ✅/⚠️/❌ | |
|
||||
|
||||
### 5.2 Response Format
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Standard format compliance | ✅/⚠️/❌ | `{ data, meta?, error? }` |
|
||||
| Error code consistency | ✅/⚠️/❌ | |
|
||||
| Pagination format | ✅/⚠️/❌ | |
|
||||
|
||||
---
|
||||
|
||||
## 6. Code Quality
|
||||
|
||||
### 6.1 Evaluation
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Duplicate code | ✅/⚠️/❌ | |
|
||||
| Function complexity | ✅/⚠️/❌ | |
|
||||
| Error handling | ✅/⚠️/❌ | |
|
||||
| Type safety | ✅/⚠️/❌ | |
|
||||
|
||||
### 6.2 Discovered Issues
|
||||
| ID | Severity | Location | Description | Recommended Action |
|
||||
|----|----------|----------|-------------|-------------------|
|
||||
| Q-1 | | | | |
|
||||
|
||||
---
|
||||
|
||||
## 7. Security Review (Phase 7)
|
||||
|
||||
### 7.1 Client Security
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| XSS protection | ✅/⚠️/❌ | |
|
||||
| CSRF protection | ✅/⚠️/❌ | |
|
||||
| Sensitive info exposure | ✅/⚠️/❌ | |
|
||||
|
||||
### 7.2 Server Security
|
||||
| Item | Status | Notes |
|
||||
|------|--------|-------|
|
||||
| Input validation | ✅/⚠️/❌ | |
|
||||
| Authentication/Authorization | ✅/⚠️/❌ | |
|
||||
| Error messages | ✅/⚠️/❌ | No sensitive info exposed |
|
||||
|
||||
---
|
||||
|
||||
## 8. Refactoring Plan
|
||||
|
||||
### 8.1 High Priority (Required before deployment)
|
||||
| Issue ID | Task | Estimated Effort |
|
||||
|----------|------|------------------|
|
||||
| | | |
|
||||
|
||||
### 8.2 Medium Priority (Post-deployment improvement)
|
||||
| Issue ID | Task | Estimated Effort |
|
||||
|----------|------|------------------|
|
||||
| | | |
|
||||
|
||||
### 8.3 Low Priority (Future improvement)
|
||||
| Issue ID | Task | Estimated Effort |
|
||||
|----------|------|------------------|
|
||||
| | | |
|
||||
|
||||
---
|
||||
|
||||
## 9. Summary
|
||||
|
||||
### 9.1 Overall Score
|
||||
| Area | Score | Related Phase |
|
||||
|------|-------|---------------|
|
||||
| Architecture | ⭐⭐⭐⭐⭐ / 5 | Phase 2 |
|
||||
| API consistency | ⭐⭐⭐⭐⭐ / 5 | Phase 4 |
|
||||
| UI/UX | ⭐⭐⭐⭐⭐ / 5 | Phase 5, 6 |
|
||||
| Security | ⭐⭐⭐⭐⭐ / 5 | Phase 7 |
|
||||
| Overall quality | ⭐⭐⭐⭐⭐ / 5 | |
|
||||
|
||||
### 9.2 Conclusion
|
||||
- [ ] Ready for deployment (All Phase verifications passed)
|
||||
- [ ] Deployable after fixes (Some issues exist)
|
||||
- [ ] Major refactoring required
|
||||
|
||||
---
|
||||
|
||||
## 10. Next Steps
|
||||
|
||||
Proceed to Phase 9: Deployment after refactoring completion
|
||||
|
||||
### 10.1 Phase 9 Preparation Checklist
|
||||
- [ ] Finalize environment variable list (Based on Phase 2)
|
||||
- [ ] Confirm secrets list
|
||||
- [ ] Prepare CI/CD environment-specific settings
|
||||
@@ -0,0 +1,182 @@
|
||||
# Deployment Report
|
||||
|
||||
> Phase 9 Deliverable: Deployment completion report
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Deployment Date**: {{date}}
|
||||
**Deployer**: {{deployer}}
|
||||
**Environment**: Production
|
||||
|
||||
---
|
||||
|
||||
## 1. Deployment Information
|
||||
|
||||
| Item | Value |
|
||||
|------|-------|
|
||||
| Deployment Version | v{{version}} |
|
||||
| Environment | Production |
|
||||
| Deployment Method | {{deployMethod}} |
|
||||
| Deployment URL | {{deployUrl}} |
|
||||
|
||||
---
|
||||
|
||||
## 2. Environment Variable Management (Phase 2 Link)
|
||||
|
||||
### 2.1 Environment Variable List
|
||||
| Variable Name | Purpose | Development | Staging | Production |
|
||||
|---------------|---------|:-----------:|:-------:|:----------:|
|
||||
| NEXT_PUBLIC_APP_URL | App URL | localhost | staging.* | prod.* |
|
||||
| DATABASE_URL | DB connection | ✅ | ✅ | ✅ |
|
||||
| AUTH_SECRET | Auth secret | ✅ | ✅ | ✅ |
|
||||
| | | | | |
|
||||
|
||||
### 2.2 Environment-specific .env Files
|
||||
```
|
||||
├── .env.example # Template (included in Git)
|
||||
├── .env.local # Local development (Git ignored)
|
||||
├── .env.development # Development environment
|
||||
├── .env.staging # Staging environment
|
||||
└── .env.production # Production environment
|
||||
```
|
||||
|
||||
### 2.3 CI/CD Secrets Configuration
|
||||
| Secret Name | Environment | Configuration Location |
|
||||
|-------------|-------------|----------------------|
|
||||
| DATABASE_URL | Production | GitHub Secrets / Vercel |
|
||||
| AUTH_SECRET | Production | GitHub Secrets / Vercel |
|
||||
| | | |
|
||||
|
||||
### 2.4 Environment Variable Validation
|
||||
```bash
|
||||
# Run validation script
|
||||
node scripts/check-env.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Pre-deployment Checklist
|
||||
|
||||
### 3.1 Environment Variable Check
|
||||
- [ ] .env.example is up to date
|
||||
- [ ] Matches Phase 2 definition
|
||||
- [ ] All secrets are configured
|
||||
- [ ] NEXT_PUBLIC_* distinction verified
|
||||
|
||||
### 3.2 Prerequisites
|
||||
- [ ] Domain connection complete
|
||||
- [ ] SSL certificate configured
|
||||
- [ ] Database migration complete
|
||||
|
||||
### 3.3 Build
|
||||
- [ ] Production build successful
|
||||
- [ ] No build errors
|
||||
- [ ] Build warnings reviewed/resolved
|
||||
|
||||
### 3.4 Testing
|
||||
- [ ] Local environment tests passed
|
||||
- [ ] Staging environment tests passed
|
||||
|
||||
---
|
||||
|
||||
## 4. Deployment Execution
|
||||
|
||||
### 4.1 Deployment Log
|
||||
```
|
||||
{{deployLog}}
|
||||
```
|
||||
|
||||
### 4.2 Deployment Result
|
||||
| Item | Status |
|
||||
|------|--------|
|
||||
| Deployment successful | ✅/❌ |
|
||||
| Health check | ✅/❌ |
|
||||
| Service operational | ✅/❌ |
|
||||
|
||||
---
|
||||
|
||||
## 5. Post-deployment Verification
|
||||
|
||||
### 5.1 Feature Verification
|
||||
| Feature | Status | Notes |
|
||||
|---------|--------|-------|
|
||||
| Login | ✅/❌ | |
|
||||
| Sign up | ✅/❌ | |
|
||||
| Core feature 1 | ✅/❌ | |
|
||||
| Core feature 2 | ✅/❌ | |
|
||||
|
||||
### 5.2 Performance Verification (Phase 7 Link)
|
||||
| Metric | Measured Value | Target | Status |
|
||||
|--------|----------------|--------|--------|
|
||||
| LCP | | < 2.5s | ✅/❌ |
|
||||
| FID | | < 100ms | ✅/❌ |
|
||||
| CLS | | < 0.1 | ✅/❌ |
|
||||
|
||||
### 5.3 Security Verification (Phase 7 Link)
|
||||
- [ ] HTTPS enforced
|
||||
- [ ] Security headers configured
|
||||
- [ ] No environment variable exposure
|
||||
|
||||
### 5.4 Error Monitoring
|
||||
- [ ] Error logs checked (last 1 hour)
|
||||
- [ ] No 5xx errors
|
||||
- [ ] 4xx errors within normal range
|
||||
|
||||
---
|
||||
|
||||
## 6. Rollback Plan
|
||||
|
||||
### 6.1 Rollback Conditions
|
||||
- Critical functionality errors
|
||||
- 5xx error spike
|
||||
- Data integrity issues
|
||||
|
||||
### 6.2 Rollback Procedure
|
||||
```bash
|
||||
# Vercel
|
||||
vercel rollback
|
||||
|
||||
# Kubernetes
|
||||
kubectl rollout undo deployment/{{appName}}
|
||||
|
||||
# Manual
|
||||
git revert HEAD && git push
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Deployment Completion Notification
|
||||
|
||||
- [ ] Team Slack channel announcement
|
||||
- [ ] Stakeholder notification
|
||||
- [ ] Release notes written
|
||||
|
||||
---
|
||||
|
||||
## 8. Follow-up Tasks
|
||||
|
||||
| Task | Owner | Deadline | Status |
|
||||
|------|-------|----------|--------|
|
||||
| Check monitoring dashboard | | D+1 | ⬜ |
|
||||
| Collect user feedback | | D+7 | ⬜ |
|
||||
| Performance optimization | | D+14 | ⬜ |
|
||||
|
||||
---
|
||||
|
||||
## 9. Project Completion
|
||||
|
||||
Development Pipeline 9 phases complete!
|
||||
|
||||
### 9.1 Phase Completion Check
|
||||
| Phase | Deliverable | Complete |
|
||||
|-------|-------------|:--------:|
|
||||
| 1 | Glossary | ✅ |
|
||||
| 2 | Conventions | ✅ |
|
||||
| 3 | Mockup | ✅ |
|
||||
| 4 | API Spec | ✅ |
|
||||
| 5 | Design System | ✅ |
|
||||
| 6 | UI Implementation | ✅ |
|
||||
| 7 | SEO/Security | ✅ |
|
||||
| 8 | Review | ✅ |
|
||||
| 9 | Deployment | ✅ |
|
||||
|
||||
Start new cycle from Phase 1 for next feature development
|
||||
@@ -0,0 +1,246 @@
|
||||
# Zero Script QA Report
|
||||
|
||||
> Verification through structured JSON logs and real-time monitoring without test scripts
|
||||
|
||||
**Project**: {{project_name}}
|
||||
**Verification Date**: {{date}}
|
||||
**Scope**: {{scope}}
|
||||
**Environment**: Docker Compose (Local/Staging)
|
||||
|
||||
---
|
||||
|
||||
## 1. Zero Script QA Overview
|
||||
|
||||
### 1.1 Methodology
|
||||
```
|
||||
Traditional: Write test code → Execute → Check results → Maintain
|
||||
Zero Script: Log infrastructure → Manual UX testing → AI log analysis → Auto issue detection
|
||||
```
|
||||
|
||||
### 1.2 Workflow
|
||||
```
|
||||
1. docker compose up -d
|
||||
2. docker compose logs -f ← Antigravity Platform monitoring
|
||||
3. User: Manual UX testing in browser
|
||||
4. Antigravity Platform: Log analysis → Issue detection → Documentation → Fix
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Logging Infrastructure Check
|
||||
|
||||
### 2.1 Environment Settings
|
||||
| Item | Setting | Status |
|
||||
|------|---------|:------:|
|
||||
| LOG_LEVEL | DEBUG | ✅/❌ |
|
||||
| LOG_FORMAT | json | ✅/❌ |
|
||||
| Request ID propagation | X-Request-ID | ✅/❌ |
|
||||
|
||||
### 2.2 Service Logging Status
|
||||
| Service | JSON Logs | Request ID | Status |
|
||||
|---------|:---------:|:----------:|:------:|
|
||||
| API (Backend) | ✅/❌ | ✅/❌ | ✅/⚠️/❌ |
|
||||
| Web (Frontend) | ✅/❌ | ✅/❌ | ✅/⚠️/❌ |
|
||||
| Nginx | ✅/❌ | ✅/❌ | ✅/⚠️/❌ |
|
||||
|
||||
---
|
||||
|
||||
## 3. Verification Targets
|
||||
|
||||
| Feature | API/Screen | Request ID | Status |
|
||||
|---------|------------|------------|:------:|
|
||||
| {{feature1}} | {{endpoint1}} | req_xxx | ⬜ |
|
||||
| {{feature2}} | {{endpoint2}} | req_xxx | ⬜ |
|
||||
|
||||
---
|
||||
|
||||
## 4. Verification Results
|
||||
|
||||
### 4.1 {{Feature1}}
|
||||
|
||||
**Scenario**: {{scenarioDescription}}
|
||||
|
||||
**Request ID**: `req_{{requestId}}`
|
||||
|
||||
**Log Stream**:
|
||||
```json
|
||||
{"timestamp":"{{timestamp}}","level":"INFO","service":"web","request_id":"req_{{requestId}}","message":"API Request started","data":{"method":"POST","endpoint":"/api/{{endpoint}}"}}
|
||||
{"timestamp":"{{timestamp}}","level":"INFO","service":"nginx","request_id":"req_{{requestId}}","message":"HTTP Request","data":{"method":"POST","uri":"/api/{{endpoint}}","status":200}}
|
||||
{"timestamp":"{{timestamp}}","level":"INFO","service":"api","request_id":"req_{{requestId}}","message":"Request started","data":{"method":"POST","path":"/api/{{endpoint}}"}}
|
||||
{"timestamp":"{{timestamp}}","level":"DEBUG","service":"api","request_id":"req_{{requestId}}","message":"Processing business logic","data":{}}
|
||||
{"timestamp":"{{timestamp}}","level":"INFO","service":"api","request_id":"req_{{requestId}}","message":"Request completed","data":{"status":200,"duration_ms":45}}
|
||||
{"timestamp":"{{timestamp}}","level":"INFO","service":"web","request_id":"req_{{requestId}}","message":"API Request completed","data":{"status":200,"duration_ms":48}}
|
||||
```
|
||||
|
||||
**Result**: ✅ Pass / ❌ Fail
|
||||
|
||||
**Performance**: {{duration_ms}}ms (Target: < 1000ms)
|
||||
|
||||
**Issue** (if failed):
|
||||
```
|
||||
- Request ID: req_{{requestId}}
|
||||
- Error log:
|
||||
- Cause:
|
||||
- Solution:
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 4.2 {{Feature2}}
|
||||
|
||||
**Scenario**: {{scenarioDescription}}
|
||||
|
||||
**Request ID**: `req_{{requestId}}`
|
||||
|
||||
**Log Stream**:
|
||||
```json
|
||||
// Paste logs here
|
||||
```
|
||||
|
||||
**Result**: ✅/❌
|
||||
|
||||
---
|
||||
|
||||
## 5. Detected Issues
|
||||
|
||||
### 5.1 Error Logs (level: ERROR)
|
||||
| Request ID | Service | Message | Severity |
|
||||
|------------|---------|---------|----------|
|
||||
| req_xxx | api | {{errorMessage}} | 🔴/🟡/🟢 |
|
||||
|
||||
### 5.2 Slow Responses (> 1000ms)
|
||||
| Request ID | Endpoint | Duration | Recommended Action |
|
||||
|------------|----------|----------|-------------------|
|
||||
| req_xxx | /api/xxx | {{duration}}ms | Caching/Optimization |
|
||||
|
||||
### 5.3 Consecutive Failures
|
||||
| Endpoint | Failure Count | Pattern | Recommended Action |
|
||||
|----------|---------------|---------|-------------------|
|
||||
| /api/xxx | {{count}} | {{pattern}} | {{action}} |
|
||||
|
||||
---
|
||||
|
||||
## 6. Issue Details
|
||||
|
||||
### ISSUE-{{number}}: {{title}}
|
||||
|
||||
**Request ID**: `req_{{requestId}}`
|
||||
|
||||
**Severity**: 🔴 Critical / 🟡 Warning / 🟢 Info
|
||||
|
||||
**Reproduction Steps**:
|
||||
1. {{step1}}
|
||||
2. {{step2}}
|
||||
3. {{step3}}
|
||||
|
||||
**Related Logs**:
|
||||
```json
|
||||
{"timestamp":"...","level":"ERROR","request_id":"req_xxx","message":"...","data":{}}
|
||||
```
|
||||
|
||||
**Root Cause**:
|
||||
{{rootCause}}
|
||||
|
||||
**Recommended Fix**:
|
||||
{{recommendation}}
|
||||
|
||||
**Status**: ⬜ Unresolved / 🔄 In Progress / ✅ Resolved
|
||||
|
||||
---
|
||||
|
||||
## 7. Verification Summary
|
||||
|
||||
### 7.1 Statistics
|
||||
| Item | Value |
|
||||
|------|-------|
|
||||
| Total tests | {{total}} |
|
||||
| Passed | {{passed}} |
|
||||
| Failed | {{failed}} |
|
||||
| Pass rate | {{passRate}}% |
|
||||
| Average response time | {{avgDuration}}ms |
|
||||
|
||||
### 7.2 Issue Status
|
||||
| Severity | Count | Resolved |
|
||||
|----------|-------|----------|
|
||||
| 🔴 Critical | {{critical}} | {{criticalResolved}} |
|
||||
| 🟡 Warning | {{warning}} | {{warningResolved}} |
|
||||
| 🟢 Info | {{info}} | {{infoResolved}} |
|
||||
|
||||
---
|
||||
|
||||
## 8. Conclusion
|
||||
|
||||
- [ ] All tests passed, no critical issues → Proceed to next Phase
|
||||
- [ ] Warning issues exist → Proceed after recommended fixes
|
||||
- [ ] Critical issues exist → Fix required, re-verification needed
|
||||
|
||||
---
|
||||
|
||||
## 8.1 Validation Checklist
|
||||
|
||||
### Logging Infrastructure
|
||||
- [ ] JSON log format applied
|
||||
- [ ] Request ID generation and propagation
|
||||
- [ ] Log level settings per environment
|
||||
- [ ] Docker logging configuration
|
||||
|
||||
### Backend Logging
|
||||
- [ ] Logging middleware implemented
|
||||
- [ ] All API calls logged (including 200 OK)
|
||||
- [ ] Business logic logging
|
||||
- [ ] Detailed error logging
|
||||
|
||||
### Frontend Logging
|
||||
- [ ] Logger module implemented
|
||||
- [ ] API client integration
|
||||
- [ ] Error boundary logging
|
||||
|
||||
### QA Workflow
|
||||
- [ ] Docker Compose configured
|
||||
- [ ] Real-time monitoring ready
|
||||
- [ ] Issue documentation template ready
|
||||
|
||||
---
|
||||
|
||||
## 9. Monitoring Commands
|
||||
|
||||
```bash
|
||||
# Stream all logs
|
||||
docker compose logs -f
|
||||
|
||||
# Filter errors only
|
||||
docker compose logs -f | grep '"level":"ERROR"'
|
||||
|
||||
# Trace specific Request ID
|
||||
docker compose logs -f | grep 'req_{{requestId}}'
|
||||
|
||||
# Find slow responses (1000ms+)
|
||||
docker compose logs -f | grep -E '"duration_ms":[0-9]{4,}'
|
||||
|
||||
# Specific service only
|
||||
docker compose logs -f api
|
||||
docker compose logs -f web
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Log Format Guide
|
||||
|
||||
### JSON Log Standard
|
||||
```json
|
||||
{
|
||||
"timestamp": "ISO 8601 format",
|
||||
"level": "DEBUG|INFO|WARNING|ERROR",
|
||||
"service": "api|web|nginx|worker",
|
||||
"request_id": "req_xxxxxxxx",
|
||||
"message": "Log message",
|
||||
"data": { "additional": "data" }
|
||||
}
|
||||
```
|
||||
|
||||
### Request ID Propagation Rules
|
||||
```
|
||||
Client → API Gateway → Backend → Database
|
||||
↓ ↓ ↓ ↓
|
||||
req_abc req_abc req_abc req_abc
|
||||
```
|
||||
Reference in new issue
Block a user