0%

Noel Niño Olvis

Back to Projects
Next.jsTurborepoSupabaseTailwind CSSPayMongoPostGISZodCQRS

Pundasyon PH

A three-sided B2B/B2C construction materials marketplace connecting buyers, quarry managers, and independent truck drivers via an automated pricing engine.

Pundasyon PH

Project Overview

Pundasyon PH is a three-sided B2B/B2C e-commerce marketplace designed to digitize and streamline the supply chain for heavy construction materials, specifically sand and gravel. It eliminates logistical friction by seamlessly connecting buyers, quarry managers, and a network of independent truck drivers into a unified ecosystem. The platform acts as an automated digital middleman, replacing manual phone calls and disjointed coordination. It ensures secure transactions, real-time dispatching, and verifiable fulfillment while embedding a scalable commission structure directly into a unified customer price.

Role

Full-Stack Developer (Freelance)

Tech Stack

Next.js (App Router)TypeScriptTailwind CSSSupabase (PostgreSQL/PostGIS)TurborepoPayMongoTanStack QueryIndexedDBZod

Backend & Architecture

  • Designed PostgreSQL/PostGIS spatial schemas executing k-NN bounding-box queries to optimize heavy fleet routing, driving spatial query latency to <50ms.
  • Developed a dynamic Turnaround Time (TAT) algorithm parsing granular DB timestamps to track fleet logistics across 5 delivery stages.
  • Automated an escrow handshake mechanism via the PayMongo API and an immutable double-entry financial ledger, triggering zero-drift payout splits immediately upon customer-verified delivery RPC calls.
  • Secured multi-tenant data access by shipping Supabase RLS policies and custom RPCs with `FOR UPDATE` locks to eliminate 100% of broadcast race conditions.
  • Root-caused and patched mass-assignment vulnerabilities in server actions using explicit relational checks and Zod boundary validation.

Frontend & UX

  • Scaled a Next.js App Router frontend across 4 shared packages, proactively refactoring a 1,000+ line monolithic server actions file into domain-specific modules to enforce SRP.
  • Built an offline-first CQRS milestone tracker (IndexedDB + TanStack Query) guaranteeing 99.9% remote resilience for construction sites.
  • Engineered a custom real-time XHR upload pipeline achieving 100% visual progress tracking for heavy media assets.
  • Unified checkout system for buyers that dynamically calculates costs into a single transparent price.

Challenges & Technical Solutions

01—Challenge

Early prototyping resulted in a massive 1,000+ line monolithic server actions file that became impossible to scale and maintain.

↳Solution

Proactively refactored the monolith into 4 Domain-Driven Design (DDD) packages within the Turborepo workspace, enforcing the Single Responsibility Principle and reducing module coupling by ~40%.

02—Challenge

Truck drivers often deliver to remote construction sites with poor or non-existent internet reception, causing proof-of-delivery uploads to fail.

↳Solution

Engineered an offline-first CQRS PWA for the driver app using TanStack Query and IndexedDB to cache checkpoint updates and photo uploads locally, automatically syncing to Supabase when connectivity is restored.

03—Challenge

Securing the backend against malicious payloads attempting to inject data into other tenants' workspaces (Mass Assignment).

↳Solution

Eliminated mass-assignment vulnerabilities across the backend API by enforcing strict relational boundary checks and implementing runtime type-checking across all incoming payloads with Zod.

04—Challenge

Google Maps autocomplete requests were incurring massive per-keystroke costs, making the platform financially unviable for high-traffic usage.

↳Solution

Engineered a hybrid mapping architecture using the free Photon API for keystroke geocoding, reserving the paid Google Maps Routes API exclusively for calculating the final large-vehicle driving distance upon checkout, slashing map API costs by >95%.