cjg/2026
Programming code on screen

Full Stack & AI Developer

Carlos
Gonzalez

← Back to case studies

React | Cloudflare | PostgreSQL | GoogleMaps | RLS | i18n

Multi-Branch Pizza Platform

Live: MutchaPizza →

Mutcha Pizza: La casa de la pizza rellena
Mutcha Pizza, a pizza chain from Nuevo León, Mexico, with 30 branches.

The Challenge

Mutcha Pizza runs 30 branches across Nuevo León, Mexico. Each branch has its own promotions, opening hours, phone channels and delivery area. The old website was static. Each promo change needed a developer, expired offers stayed online, and customers couldn't tell if a branch delivered to their address. The owners wanted a bilingual (ES/EN) site they could run themselves. It also had to support corporate and per-branch promotions, map-based delivery areas, and a "build your own pizza" experience.

The Solution

  • Public site: hero carousel, promotions page, branch directory with a Google Map, per-branch detail pages, menu, franchise and jobs forms.
  • Back office: a role-based admin panel where the owner and staff manage the whole site without a developer.
  • Ordering gates: online ordering only appears when the site, the branch and the selected fulfillment mode (pickup or delivery) are all enabled. Direct URLs can't bypass a paused branch.
Homepage hero carousel
Homepage hero carousel with the brand's red veil and Ken Burns effect.

Scheduled Banners & Promotions

Banners and promotions are records with a schedule and an audience, not hard-coded images. The server decides what each visitor sees on every request.

  • Date window: optional start and end dates. Future items stay hidden until they start, and expired items disappear by themselves.
  • Days of the week: promotions can be limited to certain weekdays. For example, MiércoPizzas only shows on Wednesdays.
  • Audience: corporate items show at every branch. Branch items target one or more branches. A Show on home flag adds them to the homepage.
  • Order & status: manual sort order and an active/inactive switch, so a promo can be paused instantly.
  • Secure images: image storage is private. The server signs short-lived links only after filtering, so unpublished or scheduled artwork never leaks early. If one image fails to sign, the page still loads.
request → active = true
→ audience: corporate OR branch ∈ location_ids (home: OR show_on_home)
→ today within [starts_at, ends_at]
→ weekday ∈ days_of_week (when set)
→ sign image URL (1 h) → render
MiércoPizzas promo
Cheese Xplosion promo
Public promotions page
"MUTCHAS Promos!" page. Only offers valid today are shown.
Promotions admin
Promotions admin with prices, audience, schedule, order and active status.

Delivery Areas with Google Maps

Each branch draws its own delivery areas on a Google Map in the admin panel.

  • Two zone types: a polygon drawn on the map, or a radius in km around a center point.
  • Business rules per zone: custom name, delivery fee, minimum order, priority and an active switch.
  • Address matching: the customer's location is checked on the server. It uses a ray-casting point-in-polygon test for polygons and the Haversine distance for radius zones, and the highest-priority match wins.
  • Privacy: zone shapes and pricing stay on the server. The customer only gets the matched zone's name, fee and minimum order.
  • Branch map: the public directory shows every branch with custom pizza-slice markers that link to its detail page.
customer (lat, lng)
└─► zones ordered by priority DESC
    ├─ polygon? pointInRing(lng, lat, ring) ─┐
    └─ radius?  haversine(center, point) ≤ radius ─┴─► first match
                                         → { name, fee, min_order }
Branch directory
Branch directory with search, A–Z sorting, phone and WhatsApp channels, and directions.

Build Your Own Pizza

A step-by-step builder where customers pick a size, crust, ingredients and a cheese-filled edge. A live SVG pizza updates as they choose.

  • Data-driven visuals: each ingredient has a shape (circle, ring, rect, triangle), a color and a size. Toppings are spread with a golden-angle pattern so the pizza looks natural, never random from one render to the next.
  • Size scaling: each size has a visual scale, so a 14" pizza looks bigger than an 8.5". Premium sizes get a richer cheese tone.
  • Pricing rules: price for 1 ingredient, 2 ingredients, each extra ingredient and the cheese edge, set per size plus a price change per crust. All of it is managed in the admin panel.
Premium 14 inch pizza
Left: the builder's SVG renderer (pepperoni, green pepper, mushroom and cheese edge). Right: the real product.
Pizza builder admin
Builder admin with sizes, prices, extras, cheese edge, visual scale and premium flag.

Back Office: Running the Business Without a Developer

The owner and staff manage menus, options and images from a role-based admin panel (admin, manager, editor). Roles are stored in their own table and checked by both database policies and server functions.

  • Menus: add, edit, reorder and turn on or off Pizzas, Specialties, Stuffed Pizza, Sides and Drinks. Each item has a name, description, price and photo.
  • Options: pizza types with several sizes and price columns (1 ingredient, 2 ingredients, extra, cheese edge, specialty). There is also a list of ingredients with on/off switches, crusts and builder visuals.
  • Images: drag-and-drop uploads for menu items, promotions and banners, saved to private storage folders by category. Only published items get signed public links.
  • Banners & promotions: the scheduling, audience and ordering rules described above, with live preview cards.
  • Branches: address, coordinates, hours and phone, with a "this number is WhatsApp" flag.
  • Per-branch features: turn online orders, delivery or pickup on or off. Owners can schedule a temporary shutdown (for example during bad weather) and apply it to all 30 branches in one click.
  • Content & settings: CMS pages with a safe rich-text editor (color and font size), plus site-wide switches for e-commerce and "coming soon" mode.
  • Users: create users, assign roles and branches, and reset passwords. Deleting a user takes extra confirmation, and admins can't delete their own account.
  • Statistics: page views, unique visitors, searches, referrers and most-visited branches over 7, 30 or 90 days.
Pizzas admin
Pizzas admin: each pizza type has a photo and a size and price grid.
Specialties admin
Specialties: photo, ingredients, price and availability.
Ingredients admin
Ingredients list with on/off switches, edit and delete.
Banners admin
Banners admin with image uploads, order and active status.
Per-branch features
Per-branch features with scheduled shutdowns and bulk apply.
Statistics
Built-in analytics: visits per day, referrers and most-visited branches.

Security

  • Row-level security: on every table. Visitors only see active records, and signing in never exposes unpublished menu content.
  • Private storage: with short-lived signed URLs instead of public buckets.
  • Protected forms: with a puzzle captcha, an email domain (MX record) check, and résumé (CV) uploads that are deleted after 30 days.

Results & Learnings

  • Promotions publish and expire on schedule, so stale offers no longer stay online.
  • The owners manage the menu, prices, images and 30 branches on their own.
  • Delivery coverage is precise, per branch, and checked on the server.
  • Built with Lovable as an AI pair-programmer, with architecture, data model and security decisions kept under my control.
TanStack StartReact 19TypeScriptTailwind CSSCloudflare WorkersPostgreSQL + RLSGoogle Maps JS APISigned Storage URLsi18n ES/ENRechartsLovable