All projects

mechatracker

Repair tracking for mechanics, auto shops, and fleet managers. Go API + Next.js web + React Native mobile sharing a single OpenAPI contract. Reference workload for the Skylab platform.

In progressGoTypeScriptPostgreSQLKubeVelaCrossplaneGitHub ActionsTaskNov 2026

The problem#

Mechanics juggle YouTube tutorials, PDF service manuals, parts lookups, and tribal knowledge across half a dozen tools, with no persistent record per vehicle. Solo mechanics, shop teams, and small fleet operators all want the same thing: one place that tracks vehicles, repairs, parts, and history — and that works on a phone next to a lift.

What I built#

A three-surface stack sharing a single contract:

  • Go API server — HTTP server with sqlc-generated type-safe queries over Postgres, golang-migrate for migrations, Google ID-token verification + HS256 session JWT in an httpOnly cookie, and a separate background-worker binary for push notifications and long-running jobs.
  • Next.js web app — React + TypeScript, consuming an API client auto-generated from the server’s OpenAPI spec.
  • React Native + Expo mobile — same generated client, Expo Push → APNs/FCM for notifications, EAS Build/Submit for release.

Repair cards are the core concept — recipe-style profiles with parts, tools, torque specs, and step-by-step procedures. Users save vehicles, drill into system → repair type, log step completions with timestamped notes and photos, and the finished repair gets archived as an immutable snapshot per vehicle.

A decision I’d defend: one contract, three surfaces#

The Go server’s handlers are annotated so swag emits an OpenAPI spec; openapi-typescript turns that into a shared TypeScript client package, and both web and mobile consume it. Hand-maintaining types across three languages is where product velocity goes to die. This way an API change propagates to every surface in a single commit, and the TypeScript compiler surfaces breakage before the apps even start.

Terminal window
// api/internal/handler/repairs.go — the Go handler drives codegen
// @Summary Create a repair from a template
// @Tags repairs
// @Param body body CreateRepairFromTemplateRequest true "request"
// @Success 201 {object} RepairCard
// @Router /v1/repairs [post]
func (h *RepairHandler) CreateFromTemplate(c *gin.Context) {
// ...
}
Terminal window
// web — same shape, auto-generated, used in a React Query hook
import type { paths } from '@mechatracker/shared/types'
type CreateReq = paths['/v1/repairs']['post']['requestBody']['content']['application/json']
type RepairCard = paths['/v1/repairs']['post']['responses']['201']['content']['application/json']
export const useCreateRepair = () => useMutation({ mutationFn: (body: CreateReq) => api.POST('/v1/repairs', { body }) })

A decision I undid: rip out the two early over-complications#

The first pass picked DigitalOcean (Droplets + Managed Postgres + Spaces + DOCR, provisioned via Terraform) and Clerk for auth. Both were defensible in isolation. Together they were a product-shaped coupling I didn’t need and over-complication I regretted the moment I had to do real work on either.

  • Clerk — the pitch was multi-org support + prebuilt React components. The shop/fleet domain doesn’t need multi-org: a technician works at one shop at a time; if they move, they get a new account. Clerk’s multi-org flexibility drove UI (org switcher), middleware (which org is this request against?), and data (memberships join table) the app didn’t actually benefit from. Full JWT verification never got past the dev-bypass stage; webhook delivery required ngrok with signing-secret rotation per developer. Reverted to Google OAuth 2.0 ID-token verification with an HS256 session JWT in an httpOnly cookie. One less vendor on the critical path.
  • DigitalOcean — Droplets + DOCR + Spaces was optimized for low egress on one provider, but it baked a hosting decision into the application. Rewrote the deployment to ride the Skylab platform: a KubeVela Application in skylab-gitops/workloads/mechatracker/ with a sibling Crossplane-managed Postgres XR that composes to RDS on AWS or CloudSQL on GCP. Cloud choice is now a platform decision; mechatracker’s manifests contain no cloud-specific fields.

Both decisions are documented in-repo with the comparison that led to the original choice preserved alongside the reversal:

Where it stands#

Deployed on the Skylab dev cluster via its KubeVela Application; backend Phase 0 (Clerk → Google OAuth) and Phase 1 (golden-path image + OTel + distroless) both shipped. mechatracker is also the reference workload for the Skylab go-service golden-path template: the Backstage template → platform/tenants PR → KubeVela Application flow is proven here before it ships to other developers. The Crossplane-managed Postgres XR is a dangling CR on the dev cluster until the real-cloud leg of the platform (wave 1 with AWS/GCP credentials) comes up — intentional, and the same block that gates fleet demos across the rest of Skylab.