Private project | Lead engineer and project manager
Multi-Store Equipment Rental and Operations System
This system handles equipment rentals and day-to-day operations across stores. It includes an online booking site, an operations dashboard, shared login, and payment event handling. Three engineers designed and built it together. I led engineering and managed the project, from clarifying requirements and designing the system to writing frontend and backend code and running acceptance tests.
Client and brand details are omitted. This page covers the overall system design.
Problems to solve
- Walk-in rentals need an in-store registration form.
- Staff need to track equipment transfers between stores and mark them complete.
- Staff need to assign equipment sizes flexibly and check available stock.
- The system needs to handle online bookings and overdue payments. When customers edit a booking, it must recalculate the price and update pickup and drop-off plans.
- We need to measure ads and conversions, but only after users consent and without sending personal data to tracking tools.
System design
- Booking: Customers use ① the booking website, which calls ② the booking API.
- Operations: Staff use ③ the operations dashboard, which calls ④ the operations API.
- Shared services: ② and ④ share PostgreSQL and Redis. Both use ⑤ SSO, with ② as a confidential client.
- Payments: The payment provider sends a webhook when hosted checkout is complete. ⑥ The payment event router verifies the signature, saves the event, and uses the order to find the service that should get it. A queue delivers it.
- Analytics: ① The booking site loads ⑦ GA4 and Meta Pixel only after consent. Consent Mode controls storage. Only allowed pages in the booking flow report events.
Parts
Booking
- ① Booking website
Customers can book equipment, register, and sign in by email. The site supports multiple languages. Customers can change bookings and pickup or drop-off plans under My Orders. The site estimates a new price with discounts applied.
React 19, TypeScript, Vite, TanStack Router / Query / Form, Zod, Tailwind CSS, i18next
- ② Booking API
Handles bookings, member accounts, and payments. It connects to shared SSO as a confidential client and sets up hosted checkout with a third-party payment provider.
NestJS, Drizzle ORM, PostgreSQL, Redis, JWT
Operations
- ③ Operations dashboard
Store and operations staff use it for orders and refunds, in-store rentals, shuttle and vehicle scheduling, driver and vehicle assignments, shipment records, store transfers, warehouses and products, discount codes, customers, and role permissions.
React, TypeScript, Vite, TanStack Router / Query / Form, Ant Design, GraphQL codegen, Vitest
- ④ Operations API
The GraphQL API handles shuttle schedules and pricing for order changes. Staff can preview, publish, unpublish, and restore website guides and itinerary content. Images are kept in object storage. An AI agent can manage content through MCP but has no access to other functions.
NestJS, GraphQL, Drizzle ORM, PostgreSQL, Redis, scheduled jobs
Shared login
- ⑤ SSO service
One login service for all systems. It separates public and confidential clients, manages the lifecycle of several session layers and tokens, and keeps sign-in status in sync across browser tabs.
__Host- cookie, separate public and confidential clients
Payments
- ⑥ Payment event router
Receives webhooks from the payment provider. It verifies the signature, saves the event, looks up where to send it by order, and forwards it through a queue. Redis prevents replay.
NestJS, BullMQ, Redis, Drizzle ORM, PostgreSQL
Analytics
- ⑦ Ad and conversion tracking
The site loads GA4 and Meta Pixel only on the production domain and after the user consents. Consent Mode controls ad and analytics storage. Login, callback, and in-store order pages do not report events. Only source attribution parameters are kept from the URL. If users decline, the site withdraws consent and clears ad cookies.
GA4 (gtag, Consent Mode), Meta Pixel, consent banner
Testing, deployment, and operations
- We wrote Playwright end-to-end tests for flows across services, including local SSO login. We checked the result against the acceptance criteria for each issue.
- We set up isolated PostgreSQL and Redis in Docker, plus a test inbox. This lets us rerun dashboard and API acceptance checks without using real data or live payments.
- We wrote AI coding agent skills for the business rules, stock availability, and how to check results during acceptance. Agents can build new features from specs, and the same checks apply.
- Backend services run on Railway. Fixes go to staging before production. When dashboard login showed a CORS error, deployment and HTTP logs showed the real cause: the production API was missing a required environment variable and exited during startup checks.
- We stored images and other files in Cloudflare R2 and set up a domain, caching, and CORS. We created credentials limited to one bucket, saved them in Railway shared variables, and read them back to verify the setup.
- We redirected the old domain to the new one with 301 redirects that kept paths and query parameters. A separate subdomain goes straight to booking. We left DNS unchanged and set up and tested the redirects via CLI.
- We tested payment webhook retries by forcibly stopping the service and having the provider resend events. Returning 200 too soon stopped retries. We changed the service to return 409 while an event is still being processed so the provider retries.
- Before release, we backed up the production database, restored and checked it in a disposable Docker container, and then removed the container. When we could not read migration records in production, we used read-only schema fingerprints to confirm the versions matched.