Senior Application Developer

loc: Maynooth, ON K0L 2S0tel: 613-553-0960email: rgsamways@gmail.com
Robin Samways

$ Pulse · Architecture

The three Cosmos DB containers, their partition keys, and the four HTTP endpoints that tie them together.

## OVERVIEW


The frontend lives in this same repo, next to every other page on this site. The backend is a genuinely separate Azure Functions app (farpost-pulse-func), calling a real Cosmos DB account (farpost-pulse-cosmos) — not reimplemented in this site’s own Python/FastAPI api/, on purpose. The whole point of this page is getting genuine, hands-on time with Node.js and Azure serverless specifically; doing it in Python would defeat that entirely.

Unlike Credential Flow’s relationship with Salesforce, there’s no secret this frontend needs to hide server-side — the Function App holds its own Cosmos DB connection string (and, later, an Azure OpenAI key) entirely on its own side, never sent to the browser. So the frontend calls the Function App directly over HTTP, no proxy through this site’s own api/ — simpler, and a more honest picture of the architecture being shown off.

## PARTITION_SCHEME


ContainerPartition keyHolds
techs/idOne record per seeded field technician
jobs/techIdJob history, 20-30 per tech
coachingHistory/techIdGenerated coaching tips, referencing their source jobs

Every job and coaching-tip query is scoped to a single tech’s partition, never a cross-partition fan-out — the natural query shape throughout this piece is “everything for one tech,” and partitioning by techId means that query is always a fast, single-partition read rather than a scatter-gather across the whole container.

## HTTP_ENDPOINTS


EndpointReturns
GET /api/techsAll seeded technicians, each with a snapshot stat
GET /api/techs/{id}/jobsOne tech’s job history
POST /api/coaching/generateGenerates and stores a coaching tip for a tech (rate-limited per IP)
GET /api/dashboard/patternsAggregated cross-tech stats

All four run at anonymous auth level — a function key embedded in a public frontend’s client-side JS is extractable by anyone regardless, so it would add friction without real protection. Nothing sensitive is at stake here; all of this data is seeded and fake. The one write endpoint, POST /api/coaching/generate, still gets a per-IP rate limiter, the same pattern already used for Credential Flow’s write endpoints — cheap insurance against abuse, especially once a real AI call (with a real per-request cost) is wired in.

Feedback on this page