Backend Development
Build production-grade backend systems and APIs to power marketing automations, data pipelines, and custom tools.
What This Skill Does
The Challenge: Marketing teams increasingly need custom backend systems — webhook handlers, data pipelines, lead enrichment APIs, and integration services — but lack consistent patterns for building reliable, maintainable code.
The Solution: Backend Development skill provides opinionated patterns for Node.js, Python, Go, NestJS, FastAPI, and Django. Covers REST API design, database integration, authentication, error handling, and deployment-ready configuration.
Activation
Implicit: Activates when user requests API endpoints, server-side logic, database schemas, or backend service design.
Explicit: Activate via prompt:
Activate backend-development skill to build [describe system]
Capabilities
1. Framework Patterns
Production-ready starter patterns per framework.
Supported stacks:
| Framework | Language | Best For |
|---|---|---|
| NestJS | TypeScript | Enterprise APIs, microservices |
| FastAPI | Python | ML integrations, data APIs |
| Django | Python | CMS, admin panels, full-stack |
| Express/Hono | TypeScript | Lightweight APIs, webhooks |
| Go (Gin) | Go | High-throughput, low-latency |
2. REST API Design
Consistent endpoint patterns with validation and error responses.
Standard response format:
// Success
{ success: true, data: T, meta?: { page, total } }
// Error
{ success: false, error: { code, message, details? } }
3. Database Integration
ORM patterns for PostgreSQL and MongoDB.
Prisma (PostgreSQL):
npx prisma init
npx prisma migrate dev --name init
npx prisma generate
Mongoose (MongoDB):
const LeadSchema = new Schema({
email: { type: String, required: true, unique: true },
source: String,
createdAt: { type: Date, default: Date.now },
});
4. Authentication & Security
JWT, API key, and OAuth2 patterns ready to integrate.
Middleware chain: Rate limit → Authenticate → Authorize → Validate → Handle
Prerequisites
- Node.js 20+ / Python 3.11+ / Go 1.22+
- PostgreSQL or MongoDB instance
.envfile withDATABASE_URL,JWT_SECRET
Best Practices
1. Validate at the boundary Use Zod (TS) or Pydantic (Python) for all incoming data. Never trust raw input.
2. Return consistent error shapes Standardize error codes so frontends can handle responses predictably.
3. Log structured JSON
Use pino (Node) or structlog (Python) for machine-readable logs in production.
Common Use Cases
Use Case 1: Webhook Handler for Lead Enrichment
Scenario: Receive form submissions, enrich with Clearbit, store in PostgreSQL.
Stack: Hono + Prisma + PostgreSQL
Workflow:
- POST
/webhooks/leadsvalidates payload with Zod - Enrich email via Clearbit API
- Upsert lead in database
- Trigger email sequence via Resend API
- Return 200 within 3 seconds (async enrichment)
Use Case 2: Analytics Aggregation API
Scenario: Pull GA4 + ad platform data, return unified metrics.
Stack: FastAPI + SQLAlchemy + PostgreSQL
Endpoints:
GET /metrics/overview?period=30dGET /metrics/channels?start=2026-01-01&end=2026-03-01GET /metrics/campaigns/{id}/performance
Troubleshooting
Issue: API responses too slow under load Solution: Add database connection pooling (PgBouncer or Prisma pool config). Cache frequent queries with Redis.
Issue: Environment variables not loading in production Solution: Validate required env vars on startup with a config module. Fail fast if missing.
Related Skills
- Databases - Schema design and query optimization
- DevOps - Deploy backend services
- Frontend Development - Frontend to connect to this API
- Debugging - Debug backend issues
Related Commands
/ckm:plan- Plan backend architecture/ckm:brainstorm- Explore technical approaches