feature-book_content_viewer#
ํ๋ง๋๋ก (๋น๊ฐ๋ฐ์์ฉ)#
์ ์์ฑ ๋ทฐ์ด ํ๋ฉด์ ์ฒ์๋ถํฐ ์์ผ๋ก ๋ง๋๋ ๋์ , ๋ฏธ๋ฆฌ ์ง๋ ์ค๊ณ๋๋ก ํ ๋ฒ์ ์ฐ์ด๋ด๋ ๋๊ตฌ์ ๋๋ค. ๋ง์น ๋ชจ๋ธ ํ์ฐ์ค ๊ณจ์กฐ๋ฅผ ์๋์ผ๋ก ์ธ์ ์ฃผ๋ ๊ฒ์ฒ๋ผ, ์ฑ ์ ๋๊ธฐ๊ณ ์ฝ๋ ํ๋ฉด์ ํ์ํ ๊ธฐ๋ณธ ๋ผ๋์ ๋ถํ(์๋ฒ ์ฐ๊ฒฐ, ํ๋ฉด, ๋ฐ์ดํฐ ์ ์ฅ ๋ฑ)์ ์๋์ผ๋ก ๋ง๋ค์ด ์ค๋๋ค. ๊ฐ๋ฐ์๋ ์ด ์์ ์ธ๋ถ ๊ธฐ๋ฅ๋ง ๋ค๋ฌ์ผ๋ฉด ๋ฉ๋๋ค.
๋ฌด์์ยท์ธ์ (๋น๊ฐ๋ฐ์์ฉ)#
- ๋ฌด์์ ํด ์ฃผ๋์: ์ ์์ฑ (PDF) ๋ทฐ์ด์ ํ์ํ ํต์ฌ ๊ธฐ๋ฅ๋ค์ ํ ๋ฒ์ ์์ฑํฉ๋๋ค. ์๋ฅผ ๋ค์ด ํ์ด์ง ๋๊ธฐ๊ธฐ(PDF ๋ ๋๋ง), ์ฑ ๊ฐํผ(๋ถ๋งํฌ), ์๊ธ์จ ๋ฉ๋ชจ(ํ๊ธฐ), ํ๊ดํ(๋ง์ปค), ์ด๋๊น์ง ์ฝ์๋์ง ๊ธฐ๋ก(์ฝ๊ธฐ ์งํ๋ฅ ), ์์ฑ์ผ๋ก ์ฝ์ด ์ฃผ๊ธฐ(TTS), ์ฑ ์์์ ์ฑ ์ ๊ตฌ๋งคํ๋ ๊ฒฐ์ ๊ธฐ๋ฅ๊น์ง ํฌํจ๋ฉ๋๋ค.
- ํจ๊ป ๋ง๋ค์ด ์ฃผ๋ ๊ฒ: ํ๋ฉด(์ฑ)๋ฟ ์๋๋ผ ๋ค์์ ๋ฐ์ดํฐ๋ฅผ ์ฃผ๊ณ ๋ฐ๋ ์๋ฒ ์ชฝ ๋ชจ๋๋ ๊ฐ์ด ์์ฑ๋ฉ๋๋ค.
- ์ธ์ ์ฐ๋์: ์ ์ ์์ฑ ๋ทฐ์ด ๊ธฐ๋ฅ์ ์ฒ์ ๋ง๋ค๊ธฐ ์์ํ ๋, ๋๋ ๊ธฐ์กด ๋ทฐ์ด ๋ชจ๋์ ํ์ฅํ๊ฑฐ๋ ๋น์ทํ ํ๋ฉด์ ๋น ๋ฅด๊ฒ ๋ ํ๋ ๋ง๋ค ๋ ์ฌ์ฉํฉ๋๋ค.
- ์ด๋ป๊ฒ ์์ํ๋์: ์ ํด์ง ๋ช
๋ น์ด(
mason make ...) ํ ์ค์ ์คํํ๋ฉด, ์ฑ ์ด๋ฆ์ด๋ ๋ชจ๋ ์ด๋ฆ ๊ฐ์ ๊ฐ์ ๋ง์ถฐ ํ์ผ๊ณผ ํด๋๊ฐ ์๋์ผ๋ก ์ฑ์์ง๋๋ค.
ํต์ฌ ์ฉ์ด (๋น๊ฐ๋ฐ์์ฉ)#
| ์ฉ์ด | ์ฌ์ด ์ค๋ช |
|---|---|
| feature (ํผ์ฒ) | ํ๋์ ๊ธฐ๋ฅ ๋ฌถ์. ์ฌ๊ธฐ์๋ "์ ์์ฑ ๋ทฐ์ด" ๊ธฐ๋ฅ ํ ์ธํธ๋ฅผ ๋งํฉ๋๋ค. |
| brick / mason make | ๋ฏธ๋ฆฌ ๋ง๋ค์ด ๋ ํ(brick)๋ก ์ฝ๋๋ฅผ ์๋ ์์ฑํ๋ ๋๊ตฌ. ๋นตํ๋ก ๋นต์ ์ฐ์ด๋ด๋ ๊ฒ๊ณผ ๋น์ทํฉ๋๋ค. |
| PDF rendering (๋ ๋๋ง) | PDF ํ์ผ์ ํ๋ฉด์ ๋ณด๊ธฐ ์ข๊ฒ ๊ทธ๋ ค์ ๋์ ์ฃผ๋ ์์ . |
| Bookmark (๋ถ๋งํฌ) | ์ฑ ๊ฐํผ. ๋์ค์ ๋ค์ ์ฐพ์์ฌ ์ ์๊ฒ ํ์ด์ง๋ฅผ ํ์ํด ๋๋ ๊ธฐ๋ฅ. |
| Scribble (์คํฌ๋ฆฌ๋ธ) | ํ๋ฉด์ ์ง์ ์์ผ๋ก ์ฐ๋ ๋ฉ๋ชจ๋ ๊ทธ๋ฆผ(ํ๊ธฐ). |
| Marker (๋ง์ปค) | ํ๊ดํ์ฒ๋ผ ๋ณธ๋ฌธ์ ์์น ํด ๊ฐ์กฐ ํ์๋ฅผ ๋จ๊ธฐ๋ ๊ธฐ๋ฅ. |
| Reading progress (์ฝ๊ธฐ ์งํ๋ฅ ) | ์ฑ ์ ์ด๋๊น์ง ์ฝ์๋์ง ์์น๋ฅผ ๊ธฐ์ตํด ๋๋ ๊ธฐ๋ฅ. |
| TTS | Text To Speech, ๊ธ์๋ฅผ ์๋ฆฌ ๋ด์ด ์ฝ์ด ์ฃผ๋ ์์ฑ ์ฝ๊ธฐ ๊ธฐ๋ฅ. |
| In-app purchase (์ธ์ฑ ๊ฒฐ์ ) | ์ฑ ์์์ ์ฑ ์ด๋ ์ด์ฉ๊ถ์ ๋ฐ๋ก ๊ตฌ๋งคํ๋ ๊ฒฐ์ ๊ธฐ๋ฅ. |
| Backend / Serverpod | ํ๋ฉด ๋ค์์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ณ ์ฃผ๊ณ ๋ฐ๋ ์๋ฒ. Serverpod๋ ๊ทธ ์๋ฒ๋ฅผ ๋ง๋๋ ๋๊ตฌ์ ๋๋ค. |
| Entity (์ํฐํฐ) | ๋ค๋ฃจ๋ ํต์ฌ ๋ฐ์ดํฐ ํ ๋ฉ์ด๋ฆฌ(์: ์ฑ ํ ๊ถ, ์งํ ์ํฉ)๋ฅผ ๊ฐ๋ฆฌํค๋ ์ด๋ฆ. |
| Clean Architecture | ์ฝ๋๋ฅผ ์ญํ ๋ณ๋ก ์นธ์ ๋๋ ๊น๋ํ๊ฒ ์ ๋ฆฌํ๋ ์ค๊ณ ๋ฐฉ์. ์ ๋ฆฌ์ ๋๋ ์๋์ฅ๊ณผ ๋น์ทํฉ๋๋ค. |
| snake_case / PascalCase | ์ด๋ฆ์ ์ ๋ ํ๊ธฐ ๊ท์น. ๋จ์ด๋ฅผ ๋ฐ์ค๋ก ์๊ฑฐ๋(์: book_content), ๋จ์ด๋ง๋ค ์ฒซ ๊ธ์๋ฅผ ๋๋ฌธ์๋ก(์: BookContent) ์๋๋ค. |
Generates a Clean Architecture-based feature module for book content viewer functionality. A large-scale feature module that includes all core e-book viewer features such as PDF page rendering, bookmarks, scribbles, markers, reading progress management, TTS, and in-app purchases.
Quick Start#
mason make feature-book_content_viewer \
--project_name my_app \
--org_name myorg \
--feature_name book_content_viewer
# Generate with custom entity name
mason make feature-book_content_viewer \
--feature_name ebook_viewer \
--primary_entity EbookContent \
--secondary_entity ViewerProgress
Variables#
| Variable | Type | Default | Description |
|---|---|---|---|
project_name | string | - | Project name (snake_case) |
org_name | string | - | Organization name |
org_tld | string | com | Top-level domain |
feature_name |
string | book_content_viewer | Feature module name (snake_case) |
primary_entity |
string | BookContent | Primary domain entity name (PascalCase) |
secondary_entity |
string | ReadingProgress | Secondary domain entity name (PascalCase) |
Generated Structure#
feature/application/{feature_name}/
โโโ lib/
โ โโโ {feature_name}.dart
โ โโโ src/
โ โโโ data/ # Repository implementation
โ โโโ domain/ # Entity, UseCase, Repository Interface
โ โโโ presentation/ # BLoC, Page, Widget
โ โโโ route/ # GoRouter TypedRoute
โ โโโ di/ # Dependency Injection
โโโ test/ # Unit, BDD tests
Backend Module#
A Serverpod backend module is generated alongside:
backend/ { { project_name } } _server/lib/src/feature/ { { feature_name } } /
โโโ endpoint/ # CRUD endpoints
โโโ service/ # Business logic
โโโ model/ # Entity, DTO (.spy.yaml)
โโโ exception/ # Exception handling
โโโ validation/ # Input validation
โโโ test/ # Tests
Modern path. Generate this feature full-stack with
cob compose -m feature.yamlโ the backend comes from thebackend_featurebrick (13backend:file toggles) plus oneb-entitypermodels.entities, and cob auto-registers routes + the melos workspace. See the plugin README โ Generation Workflows.Backend genericization (Epic #83). This feature has no dedicated
has_Xflag in the embeddedserverpod_backendbrick yet โ Epic #83 wired backend has_X forstore,chat,ai_chat, andbook_content_readeronly (broader frontendโbackend gating is a planned S2 follow-up, coco-de/bricks#85). A composed backend module is still produced viabackend_featurewhen declared infeature.yaml.
primary_entity/secondary_entityare not raw Mason brick vars โ pass them viacob apply --primary-entity/--secondary-entityor declare them undermodels.entitiesinfeature.yaml.
Key Components#
Domain#
- Entities: PageViewModel, PdfImageCacheManager
- UseCases: Book(Get, CheckPurchase), Bookmark(Toggle, Get, Update, Delete), Scribble(Save/Load/Delete Local, Upload/Download Server, Merge/Split), Marker(Create, Update, Delete, GetPage, GetTotal), PDF(Download, Merge, ClearCache), Payment(ChargeWallet, GetPackages, GetBalance, GetCoupons, ValidateCoupon, Purchase), Progress(Get, Update), TTS(Speak, Stop), ScreenProtectToggle
-
Repositories:
IBookContentViewerRepository,IBookmarkRepository,IPdfMarkerRepository,IS3OperationRepository,IScribbleRepository,ITextHighlightRepository
Presentation#
-
BLoC:
BookContentViewerBloc,ScribbleBloc,ViewerPaymentBloc - Pages: BookContentViewerPage
Customization#
Changing the feature_name variable automatically updates all file names, class names, and import paths:
mason make feature-book_content_viewer --feature_name pdf_viewer