Delivered remotely for a business based in Vienna, Austria. Names withheld by agreement.
Project Overview
Second-hand fashion trading succeeds when discovery feels as effortless as browsing a social feed while transactions carry the predictability of structured retail. Unlike traditional e-commerce with deep warehouse stock, every garment, pair of sneakers, or handbag in a peer-to-peer marketplace is a unique one-off item whose condition, sizing nuances, and price remain open to negotiation.
This system provides a full-featured social resale marketplace built for community trading across apparel, footwear, and accessories. A Laravel and MySQL foundation governs accounts, closet inventories, escrow-style order lifecycles, and trust-and-safety workflows, while a Node.js and Firebase layer drives real-time buyer-seller chat, live price-bid negotiation, and instant activity notifications across web sessions.
Business Bottleneck
Peer-to-peer apparel platforms face distinct engineering pressures compared with standard multi-vendor retail:
- Single-unit concurrency collisions: When desirable vintage pieces drop, multiple buyers click checkout within milliseconds of each other, creating race conditions unless inventory locks are strictly serialized.
- Chat-driven transaction friction: Buyers routinely ask for garment measurements or propose counter-bids before buying; sluggish inbox polling stalls conversions and drives users off-platform.
- Unstructured seller submissions: Casual sellers upload oversized smartphone photos from varying angles with inconsistent brand or size tags, degrading catalog searchability and page performance.
Architectural Strategy
The architecture divides responsibilities cleanly between transactional integrity and real-time social engagement. Laravel and MySQL own every financial and state-critical operation: user authentication, listing publication, single-unit checkout reservations, shipping label tracking, and payout releases. Blade templates render public storefronts and closet profiles on the server so search crawlers index fresh inventory immediately.
Interactive storefront workflows—drag-and-drop image reordering, faceted wardrobe filters, and inline price-proposal drawers—use jQuery for lean browser responsiveness without heavy frontend build chains. Meanwhile, Node.js acts as the real-time event coordinator bridged to Firebase, broadcasting chat messages, price-bid cards, and sold-status banners in real time so buyers never negotiate on an item that just sold.
Core Capabilities
- Guided Seller Closets: Multi-image listing composer with client-side previewing, brand taxonomy autocomplete, condition grading, and automated thumbnail generation.
- Social Discovery & Feeds: Followable seller closets, curated editorial collections, saved size preferences, and Redis-accelerated browsing across categories and price bands.
- In-Thread Price Negotiation: Structured price-bid cards embedded inside Firebase-backed chat threads, allowing buyers and sellers to accept, decline, or counter without leaving the conversation.
- Escrow Order State Machine: Step-by-step fulfillment tracking from payment authorization through carrier dispatch, delivery confirmation, and buyer inspection window before seller funds clear.
- Moderation & Anti-Fraud Queue: Automated flagging of suspicious keywords, brand-level verification checkpoints, and side-by-side dispute resolution tools for trust-and-safety staff.
Technical Architecture
Transactional actions commit through Laravel to MySQL and emit domain events into Redis, which the Node.js worker fans out to Firebase channels for connected clients.
Flow: User Browser (Blade + jQuery) → Laravel API / Web Controller → MySQL Row Lock & Transaction → Redis Pub/Sub Event → Node.js Event Bridge → Firebase Realtime Sync → Connected Buyer/Seller UI.
Keeping Firebase synchronized via server-emitted events ensures chat threads reflect authoritative order states. When a buyer completes checkout in Laravel, the order state change propagates through Redis and Node.js to lock active negotiation threads on that listing automatically.
Technology Stack
| Category | Technology Detail |
|---|---|
| Core Web Application | Laravel (PHP) orchestrating listings, checkout, payouts, and moderation |
| Server Templates | Blade views delivering SEO-indexable product pages and seller dashboards |
| Client Interactivity | jQuery powering multi-photo uploads, filter facets, and price-bid modals |
| Realtime Bridge | Node.js service coordinating socket events and Firebase message sync |
| Messaging & Presence | Firebase Realtime Database / Cloud Messaging for instant chat threads |
| Transactional Store | MySQL managing user closets, order ledgers, and shipping state machines |
| High-Speed Cache | Redis caching personalized feeds, trending tags, and rate-limit counters |
| Search & Filtering | Indexed MySQL attribute queries paired with Redis-cached category facets |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Storing chat history in MySQL vs. Firebase | Delegated high-frequency chat messages and unread counters to Firebase via Node.js, keeping MySQL focused on financial ledgers, listings, and order transitions. |
| Full SPA rewrite vs. Blade + jQuery storefront | Preserved Blade server rendering for organic search indexing and fast initial paint while using modular jQuery components for interactive filtering and image uploads. |
| Optimistic checkout vs. pessimistic listing locks | Implemented short-lived Redis reservation keys paired with MySQL SELECT ... FOR UPDATE transactions during payment confirmation to prevent double-selling one-of-one garments. |
| Synchronous image processing vs. background pipelines | Offloaded image resizing, orientation normalization, and EXIF stripping to queued workers so mobile uploads return promptly even under poor cellular connectivity. |
Security & Reliability
Two-sided marketplaces attract account takeovers, counterfeit listings, and off-platform payment diversion. Authentication routes apply Redis-backed rate limiting against credential stuffing, while sensitive seller payout edits require re-authentication. Image upload pipelines strip embedded GPS metadata from user smartphone photos before publishing listings, protecting seller home privacy.
Order transitions follow a strict finite-state machine in Laravel: funds cannot release to a seller's ledger unless carrier tracking confirms delivery and the buyer inspection timer expires without an open dispute. Chat payloads routed through Node.js pass lightweight pattern screening to alert moderators when accounts repeatedly push external messaging handles or suspicious payment links.
Performance & Scale
Fashion marketplaces experience sharp traffic spikes around seasonal wardrobe cleanouts and curated social drops. Redis caches hot category grids, followed-closet feeds, and brand facet counts with short TTLs and targeted invalidation when new items publish or sell out.
MySQL tables partition high-growth activity logs away from active catalog indexes, keeping multi-attribute filter queries (size, brand, condition, price ceiling) fast under concurrent browsing. Offloading live messaging fan-out to Firebase and Node.js keeps PHP-FPM worker pools predictable and free from idle polling requests.
Operational Outcomes
Separating transactional commerce in Laravel from real-time communication in Node.js and Firebase gave buyers and sellers instantaneous negotiation workflows without compromising payment or inventory accuracy. Trust-and-safety teams gained deterministic audit trails across messages, price bids, and shipping milestones, cutting manual back-and-forth during buyer disputes. Meanwhile, Redis caching and server-rendered Blade templates kept catalog discovery fast and search-friendly as community closets scaled.