How ahtesham-latif/flyrank-capstone-widgetplatform- works
SignalLead lets widget owners configure embeddable lead forms, then captures submissions from visitors on external sites. The main flow is widget setup → script/config delivery → protected submission intake → enrichment and storage → tenant-scoped lead viewing, with optional webhook notification. The graph uses sampled backend source for those calls; dashboard details and several README-described security capabilities are represented only where their paths or wiring are supported by the tree.
Main entry points: app.js Express application · submission.controller.js Submission intake · submission.routes.js Submission routes · delivery.controller.js Script and config delivery
Components 29
Owner control plane
- Control plane UI
frontend/src/App.tsx - Frontend API client
frontend/src/api/index.ts - Widget and lead views
frontend/src/pages/Dashboard.tsx - Widget demo
frontend/src/pages/Demo.tsx
API boundary
- Express application
src/app.js - Auth routes
src/routes/auth.routes.js - Auth controller
src/controllers/auth.controller.js - Session authorization
src/middlewares/auth.middleware.js - Origin validation
src/middlewares/cors.middleware.js - Session handling
src/middlewares/session.middleware.js - Widget routes
src/routes/widget.routes.js - Public delivery routes
src/routes/delivery.routes.js - Submission routes
src/routes/submission.routes.js - Submission rate limit
src/middlewares/rateLimit.middleware.js
Widget delivery
- Widget management
src/controllers/widget.controller.js - Script and config delivery
src/controllers/delivery.controller.js
Lead processing
- Submission intake
src/controllers/submission.controller.js - Geo-IP enrichment
src/services/geoip.service.js - Webhook notification
src/services/webhook.service.js
Persistence and integrations
- Widget repository
src/repositories/widget.repository.js - User repository
src/repositories/user.repository.js - Submission repository
src/repositories/submission.repository.js - PostgreSQL database
src/config/db.js
Other components
- Widget owner
- Customer website
- Website visitor
- ip-api.com
- ipapi.co
- n8n webhook endpoint
Connections 36
- Widget owner → Control plane UI: uses
- Control plane UI → Widget and lead views: renders
- Control plane UI → Widget demo: renders
- Widget and lead views → Frontend API client: requests data
- Frontend API client → Express application: calls API
- Express application → Origin validation: checks origins
- Express application → Session handling: establishes sessions
- Express application → Auth routes: mounts
- Express application → Widget routes: mounts
- Express application → Public delivery routes: mounts
- Express application → Submission routes: mounts
- Auth routes → Auth controller: dispatches
- Widget routes → Session authorization: requires authentication
- Widget routes → Widget management: dispatches
- Submission routes → Session authorization: protects lead listing
- Submission routes → Submission rate limit: limits public intake
- Submission routes → Submission intake: dispatches
- Widget management → Widget repository: manages widgets
- Public delivery routes → Script and config delivery: dispatches
- Script and config delivery → Widget repository: reads widget config
- Customer website → Public delivery routes: loads script
- Script and config delivery → Customer website: delivers embed script
- Customer website → Script and config delivery: requests config
- Website visitor → Customer website: submits form
- Customer website → Submission routes: posts submission
- Submission intake → Widget repository: resolves widget
- Submission intake → User repository: loads owner
- Submission intake → Geo-IP enrichment: enriches IP
- Geo-IP enrichment → ip-api.com: looks up IP
- Geo-IP enrichment → ipapi.co: falls back
- Submission intake → Submission repository: saves and lists leads
- Submission intake → Webhook notification: notifies asynchronously
- Webhook notification → n8n webhook endpoint: sends notification
- Widget repository → PostgreSQL database: reads and writes
- User repository → PostgreSQL database: reads users
- Submission repository → PostgreSQL database: reads and writes