# Govind Sankar > Full-Stack Software Engineer based in Kochi, Kerala, India. Architecting scalable backend systems, multi-tenant platforms, and cross-platform web & mobile applications. Currently a Software Engineer at TechTaliya Informatics. Open to: Senior / Mid-level Full-Stack Engineering Roles. Contact: govind@gvndsxnkr.in. github: https://github.com/gvndsxnkr · linkedin: https://linkedin.com/in/gvndsxnkr · x: https://x.com/gvndsxnkr ## Experience ### TechTaliya Informatics (P) Ltd. — Full-time, Jul 2025 - Present, Kochi, Kerala, India - **Software Engineer** (Feb 2026 - Present, Hybrid) - Promoted to Software Engineer; leading full-stack feature architecture, production deployments, and scalable API integrations across web and mobile applications. - Collaborating across engineering teams to optimize system performance, reliability, and release workflows. - **Associate Software Engineer** (Jul 2025 - Feb 2026, On-site) - Developed and maintained production frontend interfaces and RESTful backend services in agile sprint cycles. - Integrated APIs, resolved production bugs, and improved application responsiveness. - Skills: TypeScript, React, Next.js, Node.js, PostgreSQL, REST APIs ### Zimulate Consultech — Full-time, Jul 2024 - Jul 2025, Kochi, Kerala, India - **Software Engineer** (Jul 2024 - Jul 2025, Hybrid) - Engineered full-stack web features, relational database schemas, and authentication/RBAC flows across production applications. - Delivered end-to-end user stories from backend API design through frontend integration and deployment stability. - Skills: TypeScript, JavaScript, React, Node.js, SQL, Git ### IEEE Kerala Section — Internship, Mar 2024 - Jan 2025, Kochi, Kerala, India - **Web Developer** (Mar 2024 - Jan 2025, Hybrid) - Developed, maintained, and optimized official section web portals and event microsites serving statewide student and professional chapters. - Skills: Web Development, WordPress, UI/UX, Frontend ### IEEE & IEDC SNGCE — Leadership & Web Operations, Aug 2021 - Apr 2024, Ernakulam, Kerala, India - **Chairperson & Mentor — IEEE Computer Society SBC SNGCE** (Jun 2022 - Apr 2024, Hybrid) - Co-founded the student branch chapter and organized 22+ technical workshops, seminars, webinars, and coding competitions. - **Webmaster — IEEE PES Kerala Chapter & IEEE SB SNGCE** (Jan 2023 - Apr 2024, Hybrid) - Managed chapter web infrastructure, event portals, and technical content delivery across student and state chapters. - **Web Development Team & Joint CEO — IEDC Bootcamp SNGCE** (Aug 2021 - Apr 2024, On-site) - Maintained and shipped features for the official campus innovation portal (iedcsngce.com) while coordinating student technical initiatives. - Skills: Web Operations, Technical Leadership, Rust, Community Building ## Education - Bachelor of Technology in Computer Science and Engineering, Sree Narayana Gurukulam College of Engineering (SNGCE) (2020 - 2024). Completed undergraduate studies in Computer Science and Engineering; actively led IEEE Computer Society, IEEE SB, and IEDC technical initiatives. - Higher Secondary (Class XII), Kendriya Vidyalaya, Rubber Board (2020). Completed senior secondary education under CBSE curriculum. - Matriculation (Class X), Kendriya Vidyalaya, Rubber Board (2018). Completed secondary education under CBSE curriculum. ## Skills - Backend & data: TypeScript, Node.js, NestJS, PostgreSQL, Sequelize ORM, Redis, REST APIs - Frontend & mobile: Next.js, React, React Native (CLI & Expo), Flutter, Shopify Hydrogen, Tailwind CSS - Cloud, DevOps & Linux: AWS (RDS, S3, EC2), GitHub Actions CI/CD, Vercel, Arch Linux Administration, Playwright E2E Testing ## Case studies ### D2C Organic E-Commerce Platform https://gvndsxnkr.in/work/d2c-commerce-platform End-to-end direct-to-consumer organic e-commerce ecosystem across web, mobile, and cloud infrastructure. Role: Lead Developer. Context: D2C organic grocery. Domain: Commerce & Marketplaces. - backend: 47-model relational schema built with NestJS, PostgreSQL, and Sequelize ORM - caching and storage: Redis for session/catalog caching and AWS S3 media pipeline - clients: Next.js web storefront; React Native CLI mobile application - Challenge: Designed a normalized 47-table schema covering per-warehouse stock with a reservation ledger, discounts and price history, and order fulfillment workflows. - Challenge: Synchronized real-time cart and inventory state across mobile and web clients. - Stack: TypeScript, NestJS, PostgreSQL, Sequelize, Redis, Next.js, React Native, AWS ### Headless Skincare Storefront https://gvndsxnkr.in/work/headless-skincare-storefront Headless Shopify storefront for a D2C skincare brand, built on Hydrogen and deployed to Shopify's edge hosting. Role: Software Engineer. Context: D2C skincare brand (current role). Domain: Commerce & Marketplaces. - storefront: Shopify Hydrogen on React Router v7, deployed to Oxygen, with GraphQL codegen for typed Storefront and Customer Account queries - commerce: Automatic Buy X Get Y offers with auto-added free-gift lines, cart drawer and cart page, wishlist and buy-now - content: Blog with author profiles from metaobjects, per-page FAQs and structured data, a skin-analysis quiz and order tracking - automation: n8n workflow that finds abandoned carts and sends WhatsApp reminders - quality: Vitest unit tests, Playwright end-to-end tests, Core Web Vitals monitoring and a content security policy - Challenge: Kept free-gift cart lines in sync with Shopify's automatic discounts: added at the threshold, removed below it, and pulled back if Shopify doesn't price them free. - Challenge: Fixed a shared in-flight promise that broke on Oxygen's worker runtime, where I/O can't be shared across requests. - Challenge: Rebuilt the wishlist on aliased product lookups after finding the Storefront API search ignores handle filters. - Challenge: Upgraded Hydrogen and restored account pages that silently returned 500 once the Customer Account client required its own query documents. - Stack: Shopify Hydrogen, React Router, TypeScript, GraphQL, Oxygen, Tailwind CSS, Playwright, n8n ### Vehicle Upgrade Marketplace https://gvndsxnkr.in/work/vehicle-upgrade-marketplace Marketplace connecting vehicle owners with accessory sellers, partner workshops and doorstep-fitting technicians, across web and mobile. Role: Full-Stack Engineer. Context: Automotive marketplace. Domain: Commerce & Marketplaces. - backend: Domain-driven NestJS modular monolith on PostgreSQL with Sequelize, unit-of-work transactions and in-process domain events - auth: JWT access tokens with rotating refresh tokens, plus Google and Apple sign-in - payments: Razorpay checkout, S3-compatible media storage and server-side image processing - clients: Customer web app and Flutter app; Seller hub: products, stock, prices, orders and payouts; Admin console and pre-launch site; Flutter field app for technicians fitting accessories at the customer's door - Challenge: Split the backend into isolated domains (identity, organisations, catalogue, commerce) so each can later be extracted into its own service. - Challenge: Served four audiences from one platform (customers, sellers, partner workshops and field technicians), each with its own app and permissions. - Stack: NestJS, PostgreSQL, Sequelize, Next.js, Flutter, Razorpay, AWS S3 ### Car Rental Platform https://gvndsxnkr.in/work/car-rental-platform Car rental platform split into four standalone services (core API, customer booking site, fleet-partner portal and admin console) with automated cross-account deployments. Role: Lead Developer. Context: Car rental platform. Domain: Commerce & Marketplaces. - topology: 4 standalone repositories separating core API, admin portal, partner dashboard, and consumer storefront - backend: NestJS modular monolith on PostgreSQL with versioned migrations, domain events and a separate background-jobs worker - auth: Password and SMS-code sign-in, roles and permissions, audit log and feature flags - devops: Automated GitHub Actions workflows orchestrating Vercel CLI and cloud deployments - clients: Customer booking and checkout site; Fleet-partner portal; Admin console with map views - testing: Outside-in suite: API and contract tests (Vitest, Zod) plus browser flows (Playwright) against a freshly migrated database - Challenge: Avoided shared monorepo UI coupling to guarantee independent release cycles and strict fault isolation across portals. - Challenge: Engineered automated cross-account deployment pipelines via GitHub Actions and Vercel CLI. - Challenge: Built a black-box test harness that boots the API and all three web apps, then verifies sign-in, tenant isolation, pricing, booking and payment end to end. - Challenge: Ran scheduled jobs in a separate worker so background work never competes with API traffic, and gated every deploy on migrations succeeding. - Stack: NestJS, PostgreSQL, Next.js, Playwright, Vitest, Zod, Leaflet, GitHub Actions, Vercel CLI, CI/CD ### Real-Time Matchmaking App https://gvndsxnkr.in/work/realtime-matchmaking-app Privacy-first matchmaking app with anonymous discovery, matching and real-time chat on web and mobile. Role: Full-Stack Engineer. Context: Consumer social app. Domain: Social & Realtime. - backend: NestJS on PostgreSQL with Sequelize, REST plus a Socket.IO gateway for chat - realtime: Live chat with voice clips, reactions and disappearing messages, with media on S3 - auth: Email one-time-code and Google sign-in - clients: Next.js member web app; Flutter member app with feature parity; Staff console: moderation, reports, appeals, roles and audit log - testing: 172 end-to-end tests (pytest + Playwright) across REST, WebSockets, database guarantees and both front ends - Challenge: Shipped safety tooling (reports, appeals and a permission-driven staff console) alongside the consumer features. - Challenge: Covered REST endpoints, WebSocket events and database constraints in one end-to-end suite so real-time features stay reliable. - Stack: NestJS, Socket.IO, PostgreSQL, Next.js, Flutter, Playwright ### Agency Operations OS https://gvndsxnkr.in/work/agency-operations-os Internal operating system for a software agency: CRM, project delivery, engineering ops and finance, with a client portal. Role: Full-Stack Engineer. Context: Software agency. Domain: Multi-Tenant & B2B. - backend: NestJS on PostgreSQL with Sequelize, permission guards and audit interceptors - security: Separate roles for admins, project managers, developers, contractors, finance and clients, plus an encrypted credential vault - automation: Domain events (milestone approved, invoice paid) and a daily invoice-reminder job - clients: Admin panel and client portal (Next.js); Agency marketing site - Challenge: Designed roles so staff, contractors and clients each see only their own projects and data. - Challenge: Kept client credentials in an encrypted vault and automated invoice reminders from domain events. - Stack: NestJS, PostgreSQL, Sequelize, Next.js, RBAC ### Multi-Tenant Central Operations Platform https://gvndsxnkr.in/work/multi-tenant-ops-platform Centralized multi-tenant management platform engineered for isolated enterprise workflows and granular access control. Role: Full-Stack Engineer. Context: B2B operations platform. Domain: Multi-Tenant & B2B. - backend: Modular NestJS API gateway with tenant-scoped PostgreSQL isolation - security: Hierarchical Role-Based Access Control (RBAC) and audit logging - frontend: Next.js operational dashboard - Challenge: Enforced strict tenant data isolation at the ORM and query layer without sacrificing cross-tenant analytics performance. - Challenge: Built configurable state-machine workflows for multi-stage operational approvals. - Stack: NestJS, PostgreSQL, Next.js, Multi-Tenancy, RBAC, TypeScript ### Spice Processing Operations App https://gvndsxnkr.in/work/agri-processing-operations Operations app for a cardamom drying centre: intake, drying, stock, withdrawals and accounts. Role: Full-Stack Engineer. Context: Agri-processing business. Domain: Operations & Data. - mobile: Flutter app with charts, PDF receipts and printing, and push notifications - backend: NestJS + Sequelize on serverless PostgreSQL, moved out of the app's local data layer - security: Super admin created only from a server-side CLI; operators managed in the app - Challenge: Moved every business rule from an offline-first app into a server API without changing how operators work day to day. - Challenge: Closed the 'first visitor claims the admin account' gap by making super-admin creation a server-only step. - Stack: Flutter, NestJS, PostgreSQL, Firebase ### Tech-Park Job Market Tracker https://gvndsxnkr.in/work/tech-park-job-tracker Scraper and website that track job openings across a regional IT park, with history and hiring trends. Role: Developer. Context: Personal project. Domain: Operations & Data. - backend: Python scraper and FastAPI service on PostgreSQL, keeping job history and per-company stats - frontend: Next.js site: search, sort, closing dates and hiring-trend analytics - ops: Syncs itself when data is over a day old, with rate-limited crawling and one sync at a time - Challenge: Kept a full history of postings so trends survive after listings disappear from the source site. - Challenge: Made syncing safe to trigger from the UI: single-run locking, cooldowns, and clear errors when the database is down. - Stack: Python, FastAPI, PostgreSQL, Next.js, Web Scraping ### Cinema Screen Quality Guide https://gvndsxnkr.in/work/cinema-screen-guide Tells moviegoers which screen in the city will show a film with the best picture and sound. Role: Developer. Context: Personal project. Domain: Operations & Data. - data: Daily showtime scraper plus curated screen specs that inferred data never overwrites - scoring: Scores each screen on aspect-ratio fit, projection and audio, giving ranges when specs are unknown - frontend: Next.js app on PostgreSQL: films by date, tiered showtimes and a screen directory - Challenge: Designed a score that stays honest with missing data by returning ranges and confidence levels instead of guesses. - Challenge: Scraped politely: one request at a time, an honest user agent, and robots.txt respected. - Stack: Next.js, PostgreSQL, TypeScript, Web Scraping ### Technical SEO Audit Tool https://gvndsxnkr.in/work/seo-audit-tool Repeatable technical-SEO audits for every site I ship, driven by a single config file. Role: Developer. Context: Personal tool. Domain: Systems & Tooling. - core: One Python file with one dependency and a TOML config for all sites, built on an open-source crawler - checks: Soft-404 probes, canonical host redirects, robots and sitemap consistency, hreflang, structured-data validation and JS-vs-HTML render diffs - alerts: Digests to Slack, Discord, webhooks or email - Challenge: Caught bugs crawlers miss in headless storefronts, such as routes that render an empty page with 200 instead of 404. - Challenge: Audited password-protected staging sites without handing credentials to the crawler. - Stack: Python, SEO, Automation ### Bare-Metal Arch Linux Home Server & Workstation https://gvndsxnkr.in/work/arch-home-server Custom-provisioned 48GB RAM bare-metal home server and hardened Wayland/UKI Linux workstation environment. Role: Systems Engineer. Context: Personal Infrastructure. Domain: Systems & Tooling. - hardware: Custom-assembled desktop server node with 48GB RAM - os and boot: Arch Linux with Unified Kernel Image (UKI) direct UEFI boot and Hyprland Wayland compositor - automation: Zsh-driven terminal workflows and containerized self-hosted services - Challenge: Migrated boot chain from legacy GRUB to signed Unified Kernel Images (UKI) for faster, cleaner boot security. - Challenge: Configured bare-metal networking, storage, and resource isolation for self-hosted workloads. - Stack: Arch Linux, Unified Kernel Image, Hyprland, Self-Hosting, Networking, Zsh ### Brand & Marketing Sites https://gvndsxnkr.in/work/brand-and-marketing-sites Landing pages and portfolios for creative studios, small businesses and professionals. Role: Developer. Context: Small businesses and creatives. Domain: Web & Brand. - sites: Cinematic landing page for an automotive production studio; Portfolio for a UI/UX designer, built from Figma with GSAP motion; Landing page for a software agency; Website for a custom-headlight workshop - stack: Next.js and Tailwind CSS, static-first for speed and SEO - Challenge: Turned Figma designs into responsive, animated pages without hurting load performance. - Challenge: Reused one layout system across sites so small builds ship quickly. - Stack: Next.js, Tailwind CSS, GSAP, TypeScript ## Notes ### Five Shopify Hydrogen Gotchas from a Production Storefront https://gvndsxnkr.in/notes/shopify-hydrogen-gotchas I work on a headless Shopify storefront for a D2C skincare brand, built with **Hydrogen** (Shopify's React Router stack) and deployed to **Oxygen**, Shopify's edge hosting. Hydrogen removes most of the plumbing, but a production store finds the corners. These five each cost me a debugging session, so they get written down. ## 1. A shared promise that Oxygen won't share The store shows its live offers (free shipping thresholds, automatic discounts) on almost every page. To avoid fetching them twice when two loaders asked at once, I cached the in-flight request in a module variable: ```ts let inFlight: Promise | null = null; export function getOffers() { if (inFlight) return inFlight; inFlight = Promise.allSettled([load(OFFERS_QUERY), load(FREE_SHIPPING_QUERY)]) .then(toOffers) .finally(() => { inFlight = null; }); return inFlight; } ``` On a long-running Node server that's a common trick. Oxygen is a **worker runtime** (built on Cloudflare's workerd), and the rules are different. Module-level state can persist across requests in the same isolate, so the promise itself is shared. But the subrequest behind it belongs to the request that started it. Its lifetime is tied to that request, and the runtime doesn't let another request do I/O on its behalf (Cloudflare Workers reports this as *"Cannot perform I/O on behalf of a different request"*). Under concurrency, the second request was waiting on work it didn't own. Requests intermittently hung or failed, depending on which request started the fetch and when it finished. **Fix:** each request fetches its own offers. Deduplicating within one request is still fine. Across requests you need real caching, and Hydrogen's `storefront.query` cache strategies are the right tool for that, not a module variable. ## 2. `products(query: "handle:...")` doesn't filter by handle The wishlist stores product handles in the browser and loads them on the wishlist page. The obvious query: ```graphql products(first: $first, query: "handle:face-wash OR handle:moisturiser") { ... } ``` It returned products, just not the right ones. `handle:` isn't a supported filter for `products(query:)` in the API version we used: the search didn't narrow by it and returned the first products in the catalogue instead. Only wishlisted items that happened to be early in the catalogue showed up, so for most customers the wishlist looked empty. **Fix:** look each product up directly, with GraphQL aliases so it's still one request: ```graphql query Wishlist { p0: product(handle: "face-wash") { ...WishlistProduct } p1: product(handle: "moisturiser") { ...WishlistProduct } } ``` Missing or deleted products come back as `null` and are skipped, and the saved order is kept. One request with N aliases is fine for a wishlist of a few dozen items. A much larger list would need a cap, or to be split into batches. ## 3. A Hydrogen upgrade that 500'd every account page After upgrading Hydrogen, `/account`, order history, order details, profile and addresses **all** returned 500. The error, once I found it, was precise: *Expected a Customer Account API document.* The new Customer Account client only accepts documents built with **its own** `gql()` tag. Our context adapter passed plain query strings, which used to work. ```ts import { gql as customerAccountGql } from "@shopify/hydrogen"; const { data, errors } = await graphql(customerAccountGql(document), { accessToken, variables }); if (errors?.length) console.error(`[customerAccount] ${operationName}`, errors.map((e) => e.message).join("\n")); ``` The second half matters as much as the first. The failure had been **silent** because GraphQL errors weren't logged. Now they are, the same way the storefront adapter logs them. ## 4. Free gifts have to follow Shopify, not the other way round The brand runs "buy 2 get 1 free" offers as **automatic Buy X Get Y discounts** in Shopify. Shopify discounts the free unit, but it doesn't add it to the cart, and customers expect to see their gift. So the cart keeps gift lines in sync after every change: - When a product reaches X paid units, the free unit is added. - If paid units drop below X, the gift is removed. - If Shopify doesn't price the added unit at zero (the discount changed or ended), it's taken back out. - Gift lines have no quantity or remove controls; they follow the paid units. An early version kept a hard-coded fallback list of gift offers for when the live discounts couldn't be read. It drifted from Shopify within days. Now the offers come **only** from the store's automatic discounts, read on the server through Shopify's Admin API, because the Storefront API alone doesn't list them. And the cart checks Shopify's answer rather than trusting the list: if an added gift isn't actually priced at zero, it's removed. If the merchant ends a promotion, the storefront stops promising it. ## 5. Variant options leaking into product URLs Hydrogen used to ship a helper that wrote the selected variant's options into the URL (`?Size=100ml`). A Hydrogen release removed it, and I ported it back unchanged. Shortly after, product URLs started collecting option parameters, which shared links and canonical URLs didn't need. The fix was to delete the helper rather than patch it. The selected variant still works; the URL just stays clean. ## The common thread Headless commerce moves the storefront onto your code, but **the source of truth stays in Shopify**. Most of these bugs came from assuming something about Shopify's runtime or APIs instead of checking it: that the worker behaves like Node, that search filters by handle, that the account client takes strings, that a hard-coded offer list stays true. The fixes all point back at Shopify as the authority. Headless stores also have SEO traps a classic theme doesn't, like routes that render an empty page with `200` instead of `404`, and old `myshopify.com` or preview hosts staying indexable. I built a separate audit tool for those, described in the case study [Technical SEO Audit Tool](/work/seo-audit-tool). ### Twelve Bookings at Once Stalled the API https://gvndsxnkr.in/notes/connection-pool-deadlock The booking API of a car rental platform I built worked perfectly in every manual test. Then an outside-in test fired **twelve bookings at the same moment**. The API stopped answering for 30 seconds, some requests came back as `500`, and every other request that needed the database waited too. The log had one line that explained everything once I understood it: ```text SequelizeConnectionAcquireTimeoutError: Operation timeout ``` It reproduced in three runs out of four: rare enough to ship, common enough to hit production on a busy evening. ## The setup The backend is NestJS with **Sequelize 6** on PostgreSQL. The connection pool was small, as it should be on a modest database plan: ```ts pool: { max: 5, min: 0, acquire: 30000, idle: 10000 } ``` Creating a booking runs inside a transaction, because a booking touches several tables that must change together. ## What actually happened Inside that transaction, the code checked whether the car was still free. The availability query looked innocent: ```ts await sequelize.transaction(async (tx) => { const free = await this.availability.findFreeCars(range); // no { transaction: tx } // ...create the booking with { transaction: tx } }); ``` Without `{ transaction: tx }`, Sequelize 6 does exactly what you asked: it runs the query **outside the transaction**, which means taking a second connection from the pool. So each booking: 1. holds connection #1 for its transaction, 2. asks the pool for connection #2 for the availability check, 3. only releases #1 after #2 has done its work. With one booking that is harmless. With five at once, each holds one connection and waits for a second, and the pool has five. Nobody can finish, so nobody releases anything, and everyone waits until the 30-second acquire timeout gives up. This isn't a database deadlock: no row locks are involved, and PostgreSQL never sees a conflict. It's **pool exhaustion**, where every connection is held by a request that is waiting for another connection. It is arguably worse, because the database's deadlock detector can't see it and won't break it. ## The fix: make transactions follow the code I could have hunted down every query and added `{ transaction: tx }`. That fixes today's bug and invites the next one: the first new query written without it brings the problem back. Sequelize has a better option, **CLS (continuation-local storage)**: any query made inside `sequelize.transaction(cb)` joins that transaction automatically. In Sequelize 7 this is built in and uses `AsyncLocalStorage` by default. In **Sequelize 6** it's off until you call `Sequelize.useCLS()` with a namespace. The documented route is the `cls-hooked` package, but v6 only uses the namespace's `get`, `set` and `run` for transactions, and Node's built-in `AsyncLocalStorage` can provide those without an extra dependency: ```ts import { AsyncLocalStorage } from "node:async_hooks"; import { Sequelize } from "sequelize"; const store = new AsyncLocalStorage>(); Sequelize.useCLS({ get: (key: string) => store.getStore()?.get(key), set: (key: string, value: unknown) => store.getStore()?.set(key, value), run: (fn: (ctx: Map) => unknown) => { const ctx = new Map(store.getStore()); return store.run(ctx, () => fn(ctx)); }, // AsyncLocalStorage already carries the context through awaits and callbacks, // so there is nothing to bind by hand. bind: (fn: T) => fn, } as unknown as Parameters[0]); ``` The cast is there because Sequelize 6's types describe a full `cls-hooked` namespace object. This adapter only implements the part Sequelize calls. Now the availability check runs on the booking's own connection. Each booking needs exactly one connection, and twelve parallel bookings queue for the pool and finish. ## The opposite case Automatic joining has one trap. The background-jobs worker holds a long-lived transaction for a PostgreSQL **advisory lock**, so that only one worker runs a job at a time. With CLS, every query the job made would join that lock's transaction, which isn't what you want for real work. So there's an explicit escape hatch: ```ts /** Runs fn with no current transaction, so its queries don't join the caller's. */ export function outsideTransaction(fn: () => T): T { return store.run(new Map(), fn); } ``` The worker takes the lock, then runs the job's work inside `outsideTransaction`. Those queries take their own connections from the same pool, outside the lock's transaction. ## What I took away - **A transaction holds a connection for its whole life.** Anything that needs a second connection while it's open can exhaust the pool under load. - **Make the safe path the default.** With CLS on, nobody has to remember `{ transaction: tx }` on every call. On Sequelize 6, check that it's actually enabled. - **Concurrency bugs need concurrency tests.** No amount of clicking through the UI would have found this. The test that fires twelve simultaneous bookings stays in the suite as a regression check. - **A bigger pool isn't the fix.** Doubling it would only raise the number of simultaneous bookings needed to trigger the same stall. ### Two Ways Strangers Could Own an Account https://gvndsxnkr.in/notes/account-takeover-signup Two of the platforms I built had the same kind of hole: **someone who got there first could own an account that wasn't theirs.** Neither was a clever exploit. Both came from ordinary-looking flows that skipped one question: *has this person proved they own this?* ## Hole 1: register with someone else's phone number A car rental platform let customers sign up with a phone number and a password, and sign in later with either the password or an SMS code. Registration saved the phone number **without verifying it**. Here is how that goes wrong: 1. An attacker registers with **your** phone number and a password they choose. 2. Weeks later, you sign in for the first time with an SMS code. The code arrives on your phone, so it succeeds. 3. The SMS sign-in finds the existing account for that number, marks the phone as verified, and logs you in. 4. You book a car and save your details. The attacker still has a **valid password** for the account, and verifying your phone didn't revoke it. It now opens your account. No step is a bug on its own. Together they are an account takeover. ### The fix The first time a phone number is proved by an SMS code, anything set by whoever registered it is dropped: the password is cleared, so only the person holding the phone controls the account. Alongside that: - **Codes expire after five minutes, work once, and are counted in the database,** so wrong attempts can't be spread across server instances, and sending is rate-limited per IP. - **Account existence isn't revealed early.** The API only says "please register" after a correct code. At that point the only person who learns the number has no account is the one holding the phone. - **Suspensions and role changes apply immediately.** Before, roles were trusted from the JWT's claims and the session check ignored the user's status, so a suspended admin kept access until the access token expired (15 minutes). Now the session check includes the user's status and roles are read fresh from the database. ## Hole 2: the first visitor becomes the admin An operations app for an agri-processing business had the classic bootstrap problem. A fresh deployment has no users, so how does the first admin get created? The tempting answer is an HTTP endpoint that creates a super admin **if none exists yet**. It works in development. In production it means that between deploying and setting up the account, **whoever reaches that endpoint first owns the system**. Automated scanners commonly probe newly deployed services, so that window isn't safe to rely on. ### The fix Super-admin creation moved out of HTTP entirely. It's a command run on the server: ```bash npm run admin:create ``` It prompts for the email, name and password (with the password hidden), and refuses to run if a super admin already exists. There is no route to attack, because there is no route. Operators are then created from inside the app by that admin. ## The pattern behind both Both bugs trust **who arrived first** instead of **who can prove it**: - Registering a phone number isn't proof of owning it. A code sent to it is. - Reaching a fresh server isn't proof of owning it. Shell access is. When I review an auth flow now, I ask one question of every step that grants or changes control: *what has this person proved at this point?* If the answer is "nothing yet", that step must not leave anything behind that the real owner inherits. ### What an Outside-In Audit Found in My Own Platform https://gvndsxnkr.in/notes/outside-in-audit-findings Before launching a car rental platform (one API and three web apps for customers, fleet partners and admins), I audited it from the outside. The test suite never imports the apps' code. It starts the real stack against a fresh database and attacks it the way users and attackers would: over HTTP, and in a real browser. The audit produced **40 findings**. The everyday bugs were expected. The interesting ones were the bugs that **every unit test would have passed**. Here are the ones worth sharing. ## Money: the same refund, twice Refunds could be sent from two places: the API, when a customer cancels, and the background worker that reconciles payments. Both read "refund pending", both called the payment gateway, and both could succeed. **Fix:** a refund is *claimed* in the database before it's sent, with one conditional update: `UPDATE refunds SET status = 'PROCESSING' WHERE id = $1 AND status = 'PENDING'`. PostgreSQL applies that atomically, so exactly one process gets "1 row updated" and sends the refund. The other gets "0" and stops. A booking change also calculates its refund from the booking row read with `SELECT … FOR UPDATE`, so the same change sent twice waits its turn and refunds once. ## Coupons: a limit that wasn't one A coupon's usage limit was checked when the price was quoted and counted when the booking was confirmed. Two customers quoting at the same moment both saw "1 use left", and both got it. **Fix:** at confirmation, lock the coupon row (`SELECT … FOR UPDATE`) and count the bookings that hold or have paid with it, then decide. The check and the act happen under the same lock. ## Concurrency: twelve bookings stalled the API Twelve simultaneous bookings exhausted the database connection pool and stalled every database-backed request for 30 seconds. That one got its own post: [Twelve Bookings at Once Stalled the API](/notes/connection-pool-deadlock). ## Auth: trusting the first person to arrive Registration accepted a phone number without proving ownership, which let someone register *your* number and keep a working password into your account after you signed in. Also its own post: [Two Ways Strangers Could Own an Account](/notes/account-takeover-signup). ## Access: 403 says too much Asking for another customer's booking returned `403 Forbidden`, while a missing one returned `404 Not Found`. That difference tells an attacker which booking ids exist. **Fix:** both are `404`. It's a privacy trade-off: support can't tell "not yours" from "doesn't exist" from the status code alone, so the server log keeps the real reason. ## Staleness: admins changed things nobody saw The customer site cached the catalogue on a timer. When an admin disabled a car, it kept appearing for customers until the cache expired, and some data was cached for hours. **Fix:** cached reads are tagged, and the backend calls a secured revalidation route whenever the catalogue changes, so edits show up straight away. ## Slugs that broke links Renaming a car model regenerated its URL slug, and the old URL started returning `404`: bad for customers' bookmarks and for search rankings. **Fix:** old slugs are stored and keep answering. ## Smaller ones that add up - **Unknown fields were silently dropped** from request bodies. Now they're rejected, so a typo in a client is an error, not a mystery. That's safe here because the API's only clients are our own apps, released alongside it. A public API would need versioning before going this strict. - **A malformed partner header** crashed into a database error and a `500`. Now it's a `400`. - **The telematics webhook token had a fallback in the source code.** It was a development placeholder, not a leaked production secret, but production config didn't require a real token, so a missing variable would have silently fallen back to a value anyone reading the code could see. That would have let anyone who knew a device id post fake positions and alerts. Production config now requires a real token, so the placeholder can only take effect in development. ## Why outside-in Unit tests check that each piece does what its author intended. These bugs lived **between** the pieces: two processes racing for one refund, a cache and an admin screen disagreeing, a sign-up flow and a sign-in flow that were each correct alone. You only see them when you drive the whole system the way the world will. The suite stays. Each finding has a test named after it that states the correct behaviour, so a regression shows up as a failing test with an explanation attached. ### A Date Formatter That Ate 2.6 GB of Memory https://gvndsxnkr.in/notes/intl-datetimeformat-memory An operations app I built for an agri-processing centre kept getting killed by its host. No crash, no stack trace: the platform simply restarted the instance for **exceeding its memory limit**. It always happened around the same screen, the analytics dashboard. The cause turned out to be a single line that formatted dates. ## The symptom One analytics request could grow the Node.js process by about **200 MB**. Asking for a long date range pushed it to **1.7 GB**. Under a load test the process climbed past **2.6 GB** and didn't come back down. Garbage collection ran and the heap looked reasonable, but resident memory kept rising. That gap is the clue: when the JavaScript heap is fine but the process keeps growing, the memory is being allocated **outside** the heap, in native code. ## The line The backend groups processing batches by day in the centre's timezone. A small helper produced today's date as `YYYY-MM-DD`: ```ts export function todayYmd(now = new Date()) { // en-CA formats as YYYY-MM-DD. return new Intl.DateTimeFormat("en-CA", { timeZone: process.env.APP_TIMEZONE || undefined, year: "numeric", month: "2-digit", day: "2-digit", }).format(now); } ``` Nothing is wrong with it in isolation. The problem was how often it ran: analytics called it **for every batch in every chart period**, hundreds of thousands of times per request. Each `new Intl.DateTimeFormat(...)` builds a formatter backed by ICU, the native internationalisation library inside V8: locale data, timezone rules, pattern caches. That memory lives outside the JavaScript heap. In principle it's freed once the formatter is garbage-collected. In practice, on our Node version and host, creating formatters this fast pushed native memory up much faster than it came back, and the instance hit its limit first. I didn't dig into exactly where it was held. What mattered was that formatter creation was far from free, and that we were doing it hundreds of thousands of times per request. ## The fix Build the formatter once and reuse it. The timezone comes from configuration, so the cache is keyed on it: ```ts let cached: { zone: string | undefined; format: Intl.DateTimeFormat } | null = null; function ymdFormatter(): Intl.DateTimeFormat { const zone = process.env.APP_TIMEZONE || undefined; if (!cached || cached.zone !== zone) { cached = { zone, format: new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }), }; } return cached.format; } export function todayYmd(now = new Date()) { return ymdFormatter().format(now); } ``` A single slot is enough because there's one timezone per deployment. If the timezone ever becomes per tenant or per request, this should become a `Map` keyed by timezone. ## The result That was the only change in the fix, measured the same way before and after: | Measure | Before | After | | --- | --- | --- | | Memory under a 900-request load test | climbing past 2.6 GB | flat at about 415 MB | | All-time analytics request | 4.8 s | 0.28 s | The speed-up was a bonus: building a formatter is expensive, so doing it hundreds of thousands of times was also most of the request's CPU time. ## What I'd do next Reusing the formatter removes the allocation cost, but the loop still formats dates it has already formatted. The better structure is to **format each distinct day once**: group the batches by a numeric day key first, then turn only the unique keys into strings. That makes the hot loop independent of date formatting entirely. ## What I took away - **`Intl` objects are expensive to construct and cheap to reuse.** The same goes for `Intl.NumberFormat`, `Intl.Collator` and friends. Treat them like compiled regular expressions: create once, call many times. - **Watch resident memory, not just the heap.** A healthy heap with a growing process points at native allocations. - **Load-test the heavy screens.** One click on the dashboard looked fine. Nine hundred requests told the real story in minutes. ### Soft Deletes vs Unique Constraints https://gvndsxnkr.in/notes/soft-deletes-unique-constraints In the admin console of an automotive marketplace I built, an admin deleted a vehicle brand by mistake and tried to add it back. The API refused: **a brand with that slug already exists.** The brand list said it didn't. Both were telling the truth. This is the classic collision between **soft deletes** and **unique constraints**. ## How it happens Catalogue tables use Sequelize's `paranoid` mode. Deleting a row doesn't remove it; it sets `deletedAt`, and normal queries filter those rows out. That's what you want for catalogue data: old orders can still point at the brand they were placed under. The `slug` column also has a **unique index**, because URLs and lookups depend on it. And the database doesn't know about `paranoid`. To PostgreSQL, the soft-deleted row is still a row, and its slug is still taken. So: 1. Admin deletes "Example Motors". The row stays, with `deletedAt` set. 2. Admin creates "Example Motors" again with the same slug. 3. The insert hits the unique index and fails. 4. The list, which hides deleted rows, shows nothing to conflict with. ## The options **A partial unique index**, unique only where `deletedAt IS NULL`, makes the slug unique among live rows only. A new row can then be created while the old one stays soft-deleted. It's a good fit when the old row is a finished piece of history and the new one is genuinely a different thing. For a brand that's the same real-world company, you'd end up with two rows for one brand. **Restore instead of insert**, which is what I chose. For catalogue data like brands and vehicle types, "re-adding" a deleted item almost always means "I want it back". So create now looks for a match, including deleted rows: ```ts // Slug stays unique across soft-deleted rows, so revive a deleted match. const existing = await this.vehicleBrandModel.findOne({ where: { slug: data.slug }, paranoid: false, }); if (existing) { if (!existing.deletedAt) { throw new ConflictException("A brand with this slug already exists"); } await existing.restore(); await existing.update({ is_active: true, logo_url: null, ...data }); return this.findById(existing.id); } ``` Three outcomes, each correct: - **No match:** insert as usual. - **A live match:** a real duplicate, reported as `409 Conflict` instead of a raw database error. - **A deleted match:** restore it, apply the new values, and keep its id, so anything that referenced it keeps working. One more guard: the find-then-restore sequence isn't atomic, so two simultaneous requests can both decide to insert. The unique index stays the final safety net, and its violation error should be mapped to the same `409` rather than surfacing as a `500`. ## Renames hit it too The same collision appears when **renaming** to a slug that a deleted row still holds. There the deleted row is genuinely in the way, so it's removed for good before the rename. That's a deliberate trade-off: it's fine for a catalogue entry that nothing important points at any more, and wrong for anything tied to orders or audit history. A live clash still gets a `409`: ```ts const clash = await this.vehicleBrandModel.findOne({ where: { slug: data.slug, id: { [Op.ne]: id } }, paranoid: false, }); if (clash?.deletedAt) await clash.destroy({ force: true }); else if (clash) throw new ConflictException("A brand with this slug already exists"); ``` ## What I took away - **Soft delete is an application idea; uniqueness is a database rule.** When you use both, decide on purpose how they interact, or users find out for you. - **Pick restore or a partial index per table.** Restore fits when re-adding means "the same thing again": brands, categories, and user accounts, where identity, orders and history must stay attached to one row. A partial index fits when the old row is history and the new one is independent, such as a discount code reused for a new campaign, where the old campaign's redemptions must stay with the old row. - **Translate constraint errors.** A `409` with a clear message beats a `500` from an unhandled unique violation every time. ### crypto.randomUUID Is Undefined on Your Phone https://gvndsxnkr.in/notes/randomuuid-plain-http Checkout on a car rental site worked on my laptop and crashed on my phone. Same code, same network, same dev server. The error: ```text TypeError: crypto.randomUUID is not a function ``` ## Why it only broke on the phone On the laptop I opened the site at `http://localhost:3000`. On the phone I opened it by the laptop's LAN address, something like `http://192.168.1.20:3000`. `crypto.randomUUID()` is only available in a **secure context**. In practice that means pages served over HTTPS, plus local addresses browsers treat as trustworthy, such as `http://localhost` and `http://127.0.0.1`. A plain-HTTP LAN address like `192.168.1.20` is neither, so the browser doesn't define the function there. `crypto.getRandomValues()` still works in insecure contexts, but `randomUUID()` and the whole of `crypto.subtle` don't. Checkout called it the moment the page loaded, to create an **idempotency key**: a random id sent with the booking request, so that a double tap or a retry can't create two bookings. ```tsx const [idempotencyKey] = useState(() => crypto.randomUUID()); ``` ## The fix `crypto.getRandomValues()` *is* available everywhere, and a version-4 UUID is just 16 random bytes with a few bits set. So a tiny helper uses `randomUUID` when it exists and builds the same thing by hand when it doesn't: ```ts /** A random v4 UUID. crypto.randomUUID exists only on HTTPS and localhost. */ export function uuid(): string { if (typeof crypto.randomUUID === "function") return crypto.randomUUID(); const b = crypto.getRandomValues(new Uint8Array(16)); b[6] = (b[6] & 0x0f) | 0x40; // version 4 b[8] = (b[8] & 0x3f) | 0x80; // RFC 4122 variant const h = [...b].map((x) => x.toString(16).padStart(2, "0")).join(""); return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`; } ``` Checkout and the corporate booking form both use `uuid()` now, and the phone test works. ## Is this only a dev problem? Mostly, because production runs on HTTPS. But "mostly" covers a few real cases: staging servers without TLS, internal tools on an office network, kiosks and embedded browsers. The fallback costs a dozen lines, so it stays. ## What I took away - **Test on a real phone, over the network, early.** `localhost` is a secure context, which hides a whole class of bugs. - **Know which APIs need a secure context.** `crypto.randomUUID`, the clipboard API, service workers, geolocation and camera access all behave differently on plain HTTP. - **Idempotency is a client–server contract.** The client generates the key once, when the form loads, and resends it with every retry. The server does the real work: it stores the key scoped to the customer, together with the request and its result, and returns that stored result for a repeat instead of creating a second booking. The key on its own makes nothing safe. ### Why I Chose Standalone Repositories Over a Monorepo for Multi-App Client Architectures https://gvndsxnkr.in/notes/standalone-repos-vs-monorepo When a client asked for a platform with four faces (a core API, an admin portal, a partner dashboard and a consumer storefront), the default move in 2025 is a monorepo: one Turborepo, a shared `ui` package, shared types, one CI pipeline. I went the other way and gave each app its own repository. This is why, and what it cost. ## The problem with "shared everything" A monorepo optimises for **consistency**. Every app imports the same button, the same form helpers, the same API client. That is great until the apps stop moving at the same speed. In this project they never did: - The **storefront** shipped several times a week, driven by marketing and catalogue changes. - The **admin portal** changed when operations asked for a new workflow. - The **partner dashboard** had external users with their own release expectations. - The **core API** needed the most care: schema migrations, versioned endpoints, careful rollouts. With a shared UI package, a change made for the storefront silently becomes a change to the partner dashboard. Either every release is coordinated across all four apps, or you start pinning internal package versions, which reintroduces release boundaries inside the monorepo and gives up much of its simplicity. ## What standalone repositories buy you **Independent release cycles.** Each app deploys on its own schedule. A storefront hotfix never waits on an admin-portal review. **Fault isolation.** A broken build, a bad dependency bump or a failing test suite stays in one repository, and the other three keep shipping, as long as their pipelines are genuinely independent. A shared package or a breaking API change can still reach all of them. **Clear ownership and access.** Partner-facing code, internal tooling and the API can have different collaborators and different secrets, which matters when a client brings in outside contractors. **Simpler CI per repo.** Each pipeline only builds one thing, so there's no affected-graph tooling to maintain and no shared cache to debug. The work doesn't disappear, though: dependency updates, lint and format conventions, and contract tests now have to be kept consistent across four repositories. ## What it costs It is not free, and the trade-offs are real: | Concern | Monorepo | Standalone repos | | --- | --- | --- | | Shared UI | One package, always in sync | Copied or published, can drift | | API types | Imported directly | Generated from the API contract | | Cross-app refactors | One PR | One PR per repo | | Deployment coupling | High | Low (the API contract still couples them) | | Blast radius of a bad shared change | Every app that imports it | Apps that adopt the new contract or package | The two costs I had to manage on purpose: 1. **Type drift between API and clients.** I treat the API contract as the source of truth and generate client types from it, instead of importing internals across repositories. 2. **UI drift.** Each portal owns its components. They share a visual language (tokens and conventions), not a package. Some duplication is the price of independence, and for four apps with different audiences it was cheap. ## When I would still pick a monorepo If the apps are built by one small team, release together, and share most of their UI, a monorepo is the better tool. The deciding question is not "how much code is shared?" but **"how often do these apps need to ship independently?"** When the answer is "constantly", separate repositories keep one team's Tuesday from becoming everyone's incident. The deployment side, getting four private repositories into a client's own Vercel account, deserves its own post: [Automating Cross-Account Vercel Deployments with GitHub Actions](/notes/cross-account-vercel-github-actions). ### Designing a 47-Model E-Commerce Schema in PostgreSQL & Sequelize https://gvndsxnkr.in/notes/47-model-ecommerce-schema The backend behind a D2C organic grocery store runs on NestJS, PostgreSQL and Sequelize. Its baseline migration creates **47 tables**, tied together by **76 foreign keys** and **28 unique constraints**. That sounds like over-engineering until you list what a real grocery business has to track. This post walks through the parts that mattered most: stock across warehouses, the reservation ledger, discounts and price history, and the order trail. ## Start from the questions the business asks Before drawing tables, I wrote down the questions operations needed answered without a spreadsheet: - How much of this product can we sell **right now**, and **from which warehouse**? - What does this item cost **today**, and **who changed the price**? - Where is this order, and **what happened to it, in what order**? Most of the schema exists to answer one of those. The rest is plumbing every product needs (sessions, roles, audit logs, join tables), and that's fine. ## Stock lives per warehouse, per variant The same product can sit in several warehouses, and "1 kg" and "500 g" are different stock. So stock is a row per **variant per warehouse** (`inventories`), each with an available quantity and a reserved quantity. ## Every stock movement goes through a ledger The important decision was never to change stock silently. An order moves stock through three steps, and each one writes an `inventory_transactions` row against the exact warehouse row it touched: 1. **Reserve at checkout.** Units move from available to reserved. 2. **Consume on delivery.** The reserved units have left the warehouse. 3. **Release on cancellation.** The reserved units go back to available. Because each reservation records the row it came from, a cancellation releases stock to that same warehouse, and the ledger can always explain the current numbers. Reservation is where concurrency bites: two checkouts can both see "3 left". So the reservation reads the inventory row with `SELECT … FOR UPDATE` inside the order's transaction, re-checks the quantity under that lock, and only then moves units to reserved: ```ts const row = await this.model.findOne({ where: { productId, productVariantId: variantId, availableQuantity: { [Op.gte]: quantity } }, order: [["availableQuantity", "DESC"]], // the warehouse with the most stock transaction: tx, lock: tx.LOCK.UPDATE, }); if (!row) return null; // no single warehouse can fill this line await row.update( { availableQuantity: row.availableQuantity - quantity, reservedQuantity: row.reservedQuantity + quantity }, { transaction: tx }, ); ``` A second checkout for the same row waits for the first to commit, then sees the real remaining quantity. ## Prices and discounts are data, with history Discounts change weekly, and hard-coding them would mean a deploy per promotion. So discounts are rows scoped to a product or variant, with a type, a value and a validity window. Coupons are separate, and every redemption is recorded in `coupon_usages`, so limits are counted from data rather than remembered. Every price change writes a `price_histories` row with the old price, the new price and who changed it, which settles "why was this cheaper last Tuesday?" in one query. ## The order keeps its own history An order's `status` moves through pending, confirmed, processing, shipped and delivered, with cancelled and refunded on the side. Every change also writes an `order_status_histories` row, so "where is it, and who touched it last" has an answer, not just a current value. ## Integrity: what the database enforces, and what it doesn't Sequelize makes it tempting to keep every rule in application code. The schema pushes the structural ones into PostgreSQL: - **Foreign keys** on relations, so an order line can't point at a product that doesn't exist. - **Unique constraints** on natural keys like slugs and codes. - **Soft deletes** on the models, so historical orders never point at a missing row. The database only enforces the invariants you actually encode in it. Quantities never going negative is currently guaranteed by the service, under the row lock above, not by the database. Adding `CHECK (available_quantity >= 0)` is the next step, so that a bug elsewhere can't break that rule either. ## Was 47 too many? No: each core table answers a question someone actually asks. The ones I'd defend hardest are the inventory ledger, price history and order status history. Current values tell you what is true now; those tables tell you **how it got that way**, and that's what makes a store's numbers trustworthy to the people running it. ### Automating Cross-Account Vercel Deployments with GitHub Actions https://gvndsxnkr.in/notes/cross-account-vercel-github-actions A common setup in client work: the code lives in **my** GitHub organisation, but the app must run in the **client's** Vercel account, which they own and pay for. Vercel's Git integration assumes the repository and the project belong to the same team, so connecting them directly either fails or means handing the client access to private repositories. The fix is to stop letting Vercel pull from Git, and push builds to it from GitHub Actions with the Vercel CLI instead. ## How it fits together 1. The client creates the project in **their** Vercel team and generates an access token. 2. The project's org ID and project ID, plus the token, are stored as **GitHub Actions secrets** in my repository. 3. On every push, a workflow pulls the project settings, builds, and deploys the prebuilt output to the client's project. The repository never has to be shared, and the client keeps full ownership of hosting, domains and billing. ## The workflow ```yaml name: Deploy to client Vercel on: push: branches: [main] env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm install --global vercel@latest - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} ``` `vercel pull` downloads the project settings and environment variables from the client's project, `vercel build` builds on the runner, and `vercel deploy --prebuilt` uploads only the output. The repository is never connected to the client's Vercel project. The token can still deploy anything within its scope, though, so who holds it matters (see below). ## Previews for pull requests The same pattern gives you preview deployments. Run the steps on `pull_request`, use `--environment=preview`, drop `--prod`, and post the URL that `vercel deploy` prints as a PR comment. Reviewers get a live link without anyone touching the Vercel dashboard. ## Things that bite - **Turn off Vercel's own Git deployments** for the project, or you will get duplicate or failed builds. - **Scope the token tightly.** Ask the client for a token limited to their team, with the narrowest scope Vercel offers. Store it only as a GitHub Actions secret, and rotate it when the engagement ends. - **Environment variables live in Vercel**, so the client manages their own secrets. But `vercel pull` writes them onto the CI runner for the duration of the job. Use GitHub's ephemeral hosted runners, and never print or upload the pulled `.vercel` directory. - **Commit-author checks are a trade-off, not a nuisance.** For private repositories, Vercel can refuse a deployment whose Git commit author isn't a member of the team that owns the project. In this setup the author never is. We deploy prebuilt output and remove the Git metadata (`rm -rf .git`) before `vercel deploy --prebuilt`. That's a deliberate choice: the deployment is no longer linked to a commit inside Vercel, so you lose Vercel's commit-based history and Git-integration features. Traceability moves to the GitHub Actions run that produced it, and Vercel's Deployment Protection still controls who can view previews. The client should agree to this explicitly, not discover it later. - **Organise workflows per app or with one reusable workflow.** With [standalone repositories](/notes/standalone-repos-vs-monorepo), each app deploys to its own project on its own schedule. A reusable workflow that takes the project as an input works just as well. The result is a clean split of responsibilities: I own the code and the pipeline, the client owns the infrastructure, and nobody has to share credentials they shouldn't.