@@ -114,6 +114,47 @@ This keeps interfaces stable even as providers change. Polymarket and Kalshi may
114114
115115PredictNext is organized into four layers, bottom-up.
116116
117+ 4-Layer Architecture Overview:
118+
119+ ``` text
120+ (Responses)
121+ (Requests) ▲
122+ │ │
123+ ▼ │
124+ ┌──────────────────────────────────────────────────────────┐
125+ │ Layer 4: Components (Views → Widgets → Primitives) │
126+ └───────────────────────────┬──────────────────────────────┘
127+ │
128+ ▼
129+ ┌──────────────────────────────────────────────────────────┐
130+ │ Layer 3: Hooks (events/, portfolio/, trading/, etc.) │
131+ └───────────┬───────────────────────────┬──────────────────┘
132+ │ │
133+ │ (Read Path) │
134+ ▼ ┌─────────────┘
135+ ┌─────────────────────────┤ ▼
136+ │ Layer 2: Controller │ ┌────────────────────────────┐
137+ │ (PredictController) │ │ Layer 2: Services │
138+ └───────────┬─────────────┘ │ (MarketDataService, etc.) │
139+ │ └─────────┬──────────────────┘
140+ ▼ │
141+ ┌─────────────────────────┐ │
142+ │ Layer 2: Services │ │
143+ │ (TradingService, etc.) │ │
144+ └───────────┬─────────────┘ │
145+ └─────────────┬─────────────┘
146+ │
147+ ▼
148+ ┌──────────────────────────────────────────────────────────┐
149+ │ Layer 1: Adapters (PolymarketAdapter, KalshiAdapter) │
150+ └───────────────────────────┬──────────────────────────────┘
151+ │
152+ ▼
153+ ┌──────────────────────────────────────────────────────────┐
154+ │ External APIs (Polymarket APIs, Kalshi APIs) │
155+ └──────────────────────────────────────────────────────────┘
156+ ```
157+
117158### Layer 1 — Adapters
118159
119160Adapters are thin protocol boundaries that translate provider APIs into the canonical Predict model.
@@ -480,6 +521,23 @@ Reference [testing.md](./testing.md).
480521
481522PredictNext should present a deliberate public surface.
482523
524+ Module Boundary:
525+
526+ ``` text
527+ ┌────────────────────────────────────────────────────────────────┐
528+ │ PredictNext Module Boundary │
529+ ├───────────────────────────────┬────────────────────────────────┤
530+ │ PUBLIC (index.ts) │ INTERNAL │
531+ ├───────────────────────────────┼────────────────────────────────┤
532+ │ • Views │ • Services │
533+ │ • Components │ • Adapters │
534+ │ • Hooks │ • Widgets │
535+ │ • Types │ • Utils │
536+ │ • Selectors │ • Constants │
537+ │ │ • Provider DTOs │
538+ └───────────────────────────────┴────────────────────────────────┘
539+ ```
540+
483541### Public API
484542
485543The package-level ` index.ts ` should export only the stable product surface:
0 commit comments