Skip to content
← Work

GlowSimcha

2024 – 2026

Two-sided booking marketplace connecting clients with beauty artists. Framework-free PHP 8.2 API (87 REST endpoints) with a React 19 + TypeScript SPA; Stripe Connect payouts, self-hosted WebSockets, geospatial search on MySQL SPATIAL.

Client
Personal product (B2C)
Role
Sole engineer — API, SPA, payments, infrastructure
Platform
Web
Period
2024 – 2026
Stack
  • PHP 8.2
  • MySQL (SPATIAL)
  • React 19
  • TypeScript (strict)
  • Vite
  • Tailwind v4
  • shadcn/ui
  • Stripe Connect
  • Workerman WebSockets
  • Leaflet / OSM
Source
Private repository
  • 87

    REST endpoints · 40 migrations · 27 tables

  • 592 → 268 kB

    main bundle, −52% gzip

  • 341 + 174

    PHPUnit + Vitest tests, CI on every push

In short

Explained for

I built GlowSimcha, a two-sided booking marketplace where clients can find and book nearby beauty artists for hair, makeup, or nails, pay a deposit or full amount, message the artist, and sync appointments to their calendar, while artists receive payouts through Stripe Connect. As the sole engineer I created a framework-free PHP 8.2 API with 87 REST endpoints, a React 19 + TypeScript single-page app, self-hosted WebSockets, and MySQL SPATIAL geospatial search, and deployed the web platform.

Written by AI from this case study.

Account Security settings on desktop: change-password form, current session with sign-in and expiry times, a log-out-of-all-other-devices button, and a list of signed-in devices each with its own Sign out
GlowSimcha client home feed: an artist's portfolio post with a 1/3 image carousel, Hair and Haircut tags, and a Book button
GlowSimcha home page showing artist discovery
Landing page — artist discovery.
Booking step 2, 'Where should the artist go?': address search, use-my-location, and a map with the artist's free-service-area ring around the chosen address
Booking flow: pick shop or travel, drop a pin, and see at once whether the address falls inside the artist's free radius.
Artist bookings dashboard filtered to Pending: one request showing the appointment in the artist's timezone and the client's timezone, the travel address, the price, and Approve / Decline buttons
Artist side of the same booking — both parties' local times, travel address, and manual approve/decline.
Artist location settings: base address on a map, free service-area radius buttons, travel-for-a-fee toggle with maximum distance, base fee and per-km rate, and a manual-acceptance toggle
Location settings — base pin, free radius, travel pricing, and whether out-of-radius requests need manual approval.
Client messaging thread with an artist: an image message, three text bubbles with timestamps, online indicator, and a composer with image attach
Real-time messaging over the self-hosted WebSocket server, with image attachments.
Create-account screen with a Client / Artist role picker, email, optional phone, password, and Continue with Google
Sign-up picks the role up front; Google sign-in is available for both.

Context & constraints

GlowSimcha lets clients find and book beauty artists — hair, makeup, nails — near them, pay a deposit or in full, message the artist, and sync the appointment to their calendar. Artists get paid out through Stripe Connect. It is a marketplace, so every hard problem shows up: payments with two parties, real-time messaging, location search, and refunds that follow a policy.

I built it to prove I could own a full product without a framework doing the thinking for me: every layer from schema to WebSocket server is code I can explain line by line.

Architecture

The back end is a framework-free PHP 8.2 API — PSR-4, service-layer architecture, PDO prepared statements — exposing 87 REST endpoints over 27 tables managed by 40 migrations. The front end is a React 19 + TypeScript (strict) SPA on Vite with Tailwind v4 and shadcn/ui, route-code-split so the main bundle went from 592 to 268 kB gzipped.

Real-time runs on a self-hosted Workerman WebSocket server: live messaging, typing indicators, presence and push notifications, with heartbeats and exponential-backoff reconnect that degrades silently to polling. Discovery uses native MySQL POINT / SRID 4326 columns with a SPATIAL-indexed mirror table and a two-stage bounding-box → ST_Distance_Sphere query; the map is Leaflet over OpenStreetMap with a hand-built, zoom-gated clusterer.

Key decisions

  • Stripe Checkout + Connect Express, done properly: signature-verified webhooks, an idempotency ledger so a replayed event can't double-book or double-refund, deposit and full-payment modes, policy-driven refunds, and destination charges with proportional transfer reversal so a partial refund claws back the right share from the artist.
  • Self-rolled auth: HS256 JWT in HttpOnly cookies with double-submit CSRF, a per-device session registry and token-version revocation, plus Google OAuth sign-in and SMTP email OTP. Small enough to audit, and it made the security model explicit instead of inherited.
  • Spatial mirror table instead of querying the main table: keeps the SPATIAL index narrow and the hot query cheap; the bounding-box pre-filter means ST_Distance_Sphere only runs on candidates.
  • Two-way Google Calendar sync with refresh tokens encrypted at rest (libsodium) and per-user timezone handling — the feature users asked for most, and the one with the most ways to leak a secret.
  • Operational hygiene from the start: structured JSON logging with correlation IDs, an in-app admin monitoring dashboard, responsive WebP image derivatives with EXIF normalization, and scripted backups with a verified restore drill.

What broke

The first WebSocket implementation assumed the connection stayed up. On mobile networks it didn't, and messages silently vanished. The fix was the reconnect strategy that shipped: heartbeats to detect a dead socket, exponential backoff so a flapping network doesn't hammer the server, and a polling fallback so the conversation keeps working even when the socket never comes back.

Quality

341 PHPUnit tests on the API and 174 Vitest tests on the SPA, run in GitHub Actions on every push. TypeScript strict throughout. Route code-splitting cut the main bundle by 52%. Backups are scripted and the restore has been drilled, not assumed.

What I'd do differently

The framework-free API was the right call for learning and the wrong call for velocity past a certain size. Around the 60-endpoint mark I was maintaining things a framework gives away — request validation plumbing, route grouping, middleware ordering. Next time I'd draw the line earlier: hand-roll the parts that teach (auth, payments, spatial), lean on a framework for the parts that don't.

Evidence

The app is live at glow-simcha.vercel.app. Source is private; the screenshots below are from a test account with seeded artists and bookings, no real clients. Happy to screen-share the payment webhook handling, the spatial query and the WebSocket reconnect logic.

The API skeleton — router, controller, service, repository, PDO, PSR-4 — is public as a starter with the business logic removed.

php-psr4-api-starter on GitHub ↗