Community 브릭#
커뮤니티/게시판 기능을 제공하는 vertical slice 브릭입니다.
기본 정보#
| 항목 | 값 |
|---|---|
| 브릭명 | feature-community |
| 기본 feature_name | community |
| Primary Entity | Post |
| Secondary Entity | Comment |
주요 기능#
- 게시글 목록 조회 (페이지네이션)
- 게시글 작성/수정/삭제
- 댓글 작성/수정/삭제
- 좋아요/북마크
- 카테고리별 필터링
생성 구조#
Frontend#
feature/application/community/
├── lib/src/
│ ├── data/ # Repository 구현, Cache, OpenAPI Mixin
│ ├── domain/ # Post, Comment Entity, UseCase
│ ├── presentation/ # BLoC, 게시글 목록/상세 Page, Widget
│ ├── route/ # GoRouter TypedRoute
│ └── di/ # Dependency Injection
└── test/ # BDD, Unit, Widget 테스트
Backend#
backend/{project}_server/lib/src/feature/community/
├── endpoint/ # 게시글/댓글 CRUD 엔드포인트
├── service/ # 비즈니스 로직
├── model/
│ ├── entities/ # Post, Comment (.spy.yaml)
│ ├── dto/ # Create/Update Request/Response
│ └── enum/ # PostStatus 등
├── exception/ # 도메인 예외
├── validation/ # 입력 검증
└── test/ # 통합/단위 테스트
사용 예시#
bricksmith apply --feature community
# Entity 커스터마이징
bricksmith apply --feature community \
--primary-entity Article \
--secondary-entity Reply
변수#
| Variable | Default | Description |
|---|---|---|
feature_name | community | Feature 모듈명 |
primary_entity | Post | 주요 Entity (게시글) |
secondary_entity | Comment | 보조 Entity (댓글) |
Entity 이름을 변경하면 모든 파일명, 클래스명, 변수명이 자동으로 변환됩니다. 예: `Post` → `Article`로 변경하면 `ArticleService`, `ArticleEndpoint` 등이 생성됩니다.