Kinetic API Gateway is a compact Express service designed to model a realistic internal-facing backend for SaaS revenue operations. It exposes read-only resource endpoints for accounts, leads, and campaigns, then adds a scoring endpoint that turns firmographic and engagement signals into a sales-prioritization decision.
The goal is not to simulate a full CRM. The goal is to demonstrate how a backend engineer or platform leader can package business context, API clarity, and production discipline into a service that feels deployable and decision-oriented.
- Incoming requests pass through
helmet,cors,morgan, and JSON body parsing. - Route handlers map requests to lightweight resource controllers under
src/routes. - Data-backed endpoints read from in-memory sample datasets in
src/data.js. POST /api/scorecallssrc/utils/scoring.js, which translates company size, revenue, engagement, and intent into a normalized score and operating recommendation.- Unknown routes and application errors are sent through a centralized JSON error handler for consistent responses.
- Swagger UI is served at
/docsusing the OpenAPI definition stored indocs/openapi.yaml.
| Endpoint | Responsibility |
|---|---|
GET /health |
Runtime status and service metadata |
GET /api/leads |
B2B lead listing for funnel review and demo use |
GET /api/leads/:id |
Single lead retrieval with explicit 404 behavior |
GET /api/accounts |
Account context for firmographic and segmentation views |
GET /api/campaigns |
Campaign performance and pipeline contribution snapshot |
POST /api/score |
Revenue lead scoring and next-action recommendation |
GET /docs |
Interactive Swagger UI |
The scoring model is intentionally simple and explainable:
companySizerewards enterprise and upper mid-market fitannualRevenueacts as a proxy for likely budget maturityengagementScoreconverts behavioral intensity into a weighted signalintentSignalsapply direct weights to commercial actions such as pricing-page visits and demo requests
The final score is capped at 100 and mapped to four operating tiers:
0-39: cold40-69: warm70-84: qualified85-100: high-intent
This approach is useful when teams need a transparent routing model they can explain to sales, marketing, RevOps, and leadership without requiring a machine learning pipeline.
helmetsets baseline HTTP security headerscorskeeps cross-origin behavior explicit and easy to harden laterexpress.json()ensures the API can safely accept structured payloads- centralized error handling avoids leaking stack traces in response bodies
- Swagger UI is generated from a static spec, which keeps API documentation deterministic
- add request schema validation with a library such as
zodorjoi - move in-memory data to PostgreSQL and introduce repository or service abstractions
- add rate limiting, authn/authz, and audit trails for internal or partner integrations
- emit structured logs and metrics to an observability platform
- add async event publishing for CRM sync, nurture orchestration, and analytics enrichment