Skip to content

SignalFlow — AI-Powered Behavioral Messaging Platform#1

Open
kalyani2912 wants to merge 8 commits into
mainfrom
claude/push-phase-1-WQHHF
Open

SignalFlow — AI-Powered Behavioral Messaging Platform#1
kalyani2912 wants to merge 8 commits into
mainfrom
claude/push-phase-1-WQHHF

Conversation

@kalyani2912

Copy link
Copy Markdown
Owner

Summary

Complete implementation of SignalFlow — an AI-powered behavioral messaging platform for D2C brands.

Phase 1 — Foundation

  • Domain models (signals, messages, channels, campaigns)
  • Express API scaffold with TypeScript strict mode
  • Zod-validated config, Pino structured logging

Phase 2 — Full Pipeline

  • Signal → campaign match → AI message generation → channel delivery
  • Campaign CRUD routes (POST, GET, PUT)
  • Message read routes with filters
  • API key authentication & error handling middleware

Phase 3 — Production Readiness

  • 19 tests (unit + integration) via Vitest — all passing
  • Per-shopper rate limiting (sliding window)
  • Campaign analytics tracking
  • Request ID tracing (X-Request-Id)

Phase 4 — Web Dashboard & Real-time

  • Dark-themed dashboard at / with campaign overview
  • Campaign detail page with analytics bar charts
  • Live signal feed via Server-Sent Events (SSE)
  • Shopper profile aggregation endpoint
  • Deployment config (Dockerfile + render.yaml)

API Endpoints

Method Endpoint Purpose
GET /health Health check
POST /api/v1/signals Ingest signal (triggers pipeline)
GET /api/v1/signals/stream SSE real-time feed
POST /api/v1/campaigns Create campaign
GET /api/v1/campaigns List campaigns
GET/PUT /api/v1/campaigns/:id Get/update campaign
GET /api/v1/campaigns/:id/analytics Campaign stats
GET /api/v1/messages List messages (filter by campaign/shopper)
GET /api/v1/shoppers/:id Shopper profile

Test plan

  • npm test — 19 tests passing
  • npm run build — TypeScript compiles cleanly
  • Deploy on Render and verify dashboard loads
  • Create a campaign, send a signal, verify live feed updates

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pw8qob1AFnxZZu3qNHTsK6


Generated by Claude Code

claude added 8 commits March 27, 2026 22:48
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants