Documentation
Architecture
Event-sourced CQRS on Cloudflare — summary for operators and integrators.
OnlyFansAPI webhook
→ Worker HMAC + idempotency
→ Event store (D1 events)
→ ChatSession Durable Object (session open/close)
→ Projectors → rm_messages / rm_sessions / rm_fans / rm_alerts …
→ Dashboard + intelligence APIsPrinciples
- Event store is source of truth — do not mutate read models without events (or documented admin helpers).
- Rules before models — latency, $, unlock rates, alert codes are deterministic.
- Analysis-only — no send path in v1.
- No LLM in webhook — intelligence is async/admin.
Monorepo packages
| Package | Role |
|---|---|
@chatalyze/domain | Session policy (pure) |
@chatalyze/contracts | Zod events |
@chatalyze/metrics | Features, alerts, recommendations |
@chatalyze/models | Model router + thread analysis |
@chatalyze/projections | Event → read models |
@chatalyze/ofapi | Normalize + HMAC + client |
apps/api | Worker HTTP |
apps/web | Dashboard + this wiki |
Deep ADRs live in the repo under docs/adr/. Product vision:docs/PRODUCT.md.