SignalFlow — AI-Powered Behavioral Messaging Platform#1
Open
kalyani2912 wants to merge 8 commits into
Open
Conversation
Core scaffolding for the AI-powered behavioral messaging platform: - Domain models: signals, messages, channels, campaigns - Service stubs: signal ingestion with campaign matching, AI message generation - Channel registry with adapter pattern (SMS, email, WhatsApp, Instagram DM) - Express API with versioned signal ingestion endpoint (POST /api/v1/signals) - Validated environment config (Zod), structured logging (Pino) - TypeScript strict mode, ESM-ready project configuration https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
- In-memory data store for signals, campaigns, and messages - Pipeline orchestrator: signal → campaign match → message generation → delivery - Campaign CRUD routes (POST, GET, PUT /api/v1/campaigns) - Message read routes (GET /api/v1/messages with filters) - Trigger rule evaluation (signalType + payload conditions matching) - API key authentication middleware (skips in dev when unconfigured) - Global error handling middleware with async route wrapper https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
- 19 tests (unit + integration) via Vitest with supertest — all passing - Per-shopper rate limiting (sliding window, configurable max/window) - Campaign analytics tracking (signals, messages, delivery success/failure) - GET /api/v1/campaigns/:id/analytics endpoint - Request ID middleware for traceability (X-Request-Id header) - Extracted createApp() factory for testability https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
- Web dashboard served at / with campaign overview and live signal feed - Campaign detail page with analytics bar charts and message history - Server-Sent Events (SSE) at /api/v1/signals/stream for real-time updates - EventBus service decoupling pipeline from SSE transport - GET /api/v1/shoppers/:id for shopper profile aggregation - Dark-themed responsive UI (HTML/CSS/JS, no build tooling) https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
- Fix TypeScript build errors (ESM types, Express 5 param types) - Add Dockerfile with multi-stage build - Add render.yaml for one-click Render deploy - Add "type": "module" and engines field to package.json - Exclude test files from tsc build https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
pino-pretty was a devDependency but needed at runtime when NODE_ENV is not explicitly set to production. Moved to dependencies to fix Render deployment error. https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
- Extract IStore interface from MemoryStore (15 async methods) - Create PrismaStore implementing IStore via Neon HTTP adapter - Prisma schema with Signal, Campaign, Message tables + indexes - All consumers now depend on IStore, not MemoryStore directly - Server auto-selects PrismaStore when DATABASE_URL is set, falls back to MemoryStore - Seed script with 5 campaigns, 25 signals, ~40 messages (idempotent) - All 19 existing tests pass unchanged (they use MemoryStore) - Build command updated for Render: includes prisma generate https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
Ensures database tables are created/synced on every Render deploy. https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation of SignalFlow — an AI-powered behavioral messaging platform for D2C brands.
Phase 1 — Foundation
Phase 2 — Full Pipeline
Phase 3 — Production Readiness
Phase 4 — Web Dashboard & Real-time
/with campaign overviewAPI Endpoints
/health/api/v1/signals/api/v1/signals/stream/api/v1/campaigns/api/v1/campaigns/api/v1/campaigns/:id/api/v1/campaigns/:id/analytics/api/v1/messages/api/v1/shoppers/:idTest plan
npm test— 19 tests passingnpm run build— TypeScript compiles cleanly🤖 Generated with Claude Code
https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6
Generated by Claude Code