Delivered remotely for a business based in Stockholm, Sweden. Names withheld by agreement.
Project Overview
A thriving local marketplace lives or dies on two opposing demands: publishing a listing from a phone must feel effortless, yet browsing tens of thousands of secondhand items across wildly different categories must remain structured and trustworthy. Selling a bicycle requires frame size and condition; renting an apartment demands floor area, deposit rules, and transit proximity; listing a used vehicle hinges on registration year, mileage, and drivetrain. When a classifieds platform flattens those verticals into generic title-and-description boxes, buyers abandon search and sellers drown in repetitive messages.
We built a multi-category local marketplace tailored for high-volume urban commerce across Stockholm and surrounding regions. The architecture pairs a Laravel and PHP core with MySQL spatial storage and Redis caching, serving both a React Native mobile application and a web experience blending server-rendered Blade templates with interactive React discovery views. Firebase underpins real-time negotiation threads and saved-search alerts so buyers and sellers coordinate pickups without exposing personal phone numbers.
Marketplace Friction & Moderation Load
Fragmented classifieds tools routinely stall under four operational pressures:
- Schema rigidity: Adding a new niche vertical—such as marine equipment or seasonal sports gear—often stalls engineering teams when category fields are hardcoded into SQL columns and mobile forms.
- Slow faceted discovery: Filtering simultaneously by municipality radius, price band, condition, and category-specific specs quickly degrades database latency when queries hit unindexed attribute blobs.
- Chat latency and safety gaps: Polling REST endpoints for message replies makes buyer-seller negotiation feel sluggish, while unmoderated threads attract phishing links and off-platform payment scams.
- Mobile photo friction: Sellers photographing household items in poor indoor lighting abandon uploads if image compression blocks the UI or fails silently over commuter transit connections.
Architectural Strategy
Rather than forcing one technology to solve every problem, we separated structural authority from ephemeral interaction. MySQL holds canonical marketplace state—user identities, category definitions, geo-coordinates, moderated listing records, and abuse reports—enforced by Laravel domain services. Redis absorbs read pressure by caching taxonomy trees, pre-computed category counts, and sliding-window rate limits.
For buyer-seller messaging, Firebase handles bidirectional chat synchronization and push delivery via Firebase Cloud Messaging, isolating high-frequency socket traffic from transactional database pools. On the web, Blade delivers indexable category directories and administrative tooling with minimal client payload, whereas React drives stateful map exploration and multi-facet filtering.
Core Capabilities
- Dynamic Category Form Engine: Sellers select a category in React Native or React and immediately receive tailored input controls, unit selectors, and validation constraints served from versioned Laravel schemas.
- Geo-Bounded & Faceted Search: Buyers pan across neighborhood maps or choose commuter zones, combining radius filters with vertical-specific attributes such as energy class, storage capacity, or transmission type.
- In-App Negotiation & Quick Offers: Authenticated chat rooms tied directly to listing IDs support structured price proposals, availability checks, and status updates when an item is reserved or sold.
- Saved Searches & Instant Alerts: Users persist complex filter combinations; background workers evaluate newly approved listings against active criteria and trigger FCM push notifications.
- Trust & Safety Moderation Desk: Automated heuristics flag suspicious pricing, blacklisted keywords, or duplicate image hashes into a Blade review console for rapid takedown or account restriction.
Technical Architecture
Listing submissions originate in React Native or the React web client, where images are resized client-side before multipart upload to Laravel. Laravel validates category attributes against cached schema rules, persists the listing in MySQL, and dispatches Redis-backed queue jobs for thumbnail variants and automated fraud checks. Approved items populate spatial search indexes and invalidate matching Redis result caches. Meanwhile, buyers browse SEO-friendly Blade category entry points that hydrate into React search workspaces, initiating Firebase chat threads linked to verified user tokens minted by Laravel.
Flow: Client Submission (React Native / React) → Laravel Validation & Schema Engine → MySQL Spatial Store + Redis Cache Invalidation → Queue-Based Media & Fraud Screening → Live Discovery (Blade / React) & Firebase Negotiation
Decoupling media processing and spam scoring from the HTTP request cycle keeps publishing crisp while ensuring unvetted listings never bypass moderation rules.
Technology Stack
| Category | Technology detail |
|---|---|
| Core API & Domain Rules | Laravel (PHP 8.x REST API, dynamic taxonomy validation, moderation queues) |
| Mobile Client | React Native for iOS and Android listing creation, browsing, and chat |
| Interactive Web Marketplace | React SPA modules for map-based discovery, faceted filtering, and saved searches |
| SEO & Admin Templates | Laravel Blade for server-rendered category hubs and back-office moderation |
| Primary Datastore | MySQL for user accounts, geo-indexed listings, attributes, and audit logs |
| Cache & Rate Limiting | Redis for hot search facets, taxonomy trees, session state, and job queues |
| Messaging & Push Alerts | Firebase Realtime Database & FCM for buyer-seller chat and saved-search alerts |
| Background Workers | Laravel Horizon / Redis queues for image optimization, expiry sweeps, and spam scoring |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Representing heterogeneous category attributes cleanly in MySQL | Stored listing payloads as validated JSON while materializing high-selectivity filter keys into an indexed facet lookup table, trading modest write amplification for sub-second multi-filter queries. |
| Balancing SEO crawlability with rich map-based web filtering | Paired Blade server-rendered category and listing URLs with hydrated React filter panels, avoiding SSR Node infrastructure complexity while preserving search engine visibility. |
| Preventing chat spam without proxying every keystroke through PHP | Issued short-lived scoped Firebase custom tokens from Laravel after trust checks, allowing direct client-to-Firebase messaging while retaining server-side thread locking when a user is suspended. |
| Keeping React Native image uploads reliable on patchy mobile networks | Implemented progressive client compression and chunked retry queues on the device, trading slightly longer local pre-processing for predictable upload completion. |
Security & Reliability
Local peer-to-peer commerce is a frequent target for credential stuffing, fake-escrow phishing, and automated scraping. Laravel enforces strict API throttling via Redis sliding windows per IP and device fingerprint, requiring step-up verification before new accounts can message sellers or publish high-value categories such as vehicles and rentals. Firebase security rules restrict read and write access to chat participants explicitly authorized in the custom JWT claims minted by the backend.
Moderation resilience relies on immutable audit records. Every status transition—draft, pending review, active, reserved, expired, or removed—writes an append-only event in MySQL recording the actor, timestamp, and reason code. Automated link-inspection filters quarantine external URLs inside chat previews and listing descriptions until verified by trust-and-safety reviewers.
Performance & Scale
Classifieds traffic exhibits sharp diurnal spikes during weekday commutes and Sunday evenings. Stateless PHP-FPM workers behind load balancers scale horizontally, while Redis absorbs repetitive read traffic for category trees, promoted placements, and regional filter counts. Listing expiration and saved-search matching execute in batched Laravel queue workers rather than cron loops scanning full tables, keeping write locks brief and predictable.
On mobile, React Native flat lists paginate cursor-based API responses and prefetch low-weight thumbnails, minimizing memory churn on older Android handsets while keeping scroll transitions fluid during dense neighborhood browsing.
Operational Outcomes
Consolidating disparate verticals onto a schema-driven marketplace platform transformed both engineering velocity and daily marketplace operations:
- Rapid vertical expansion: Product teams launch new classifieds categories and bespoke search filters through configuration schemas rather than database migrations and app-store releases.
- Consistent cross-channel discovery: Buyers move seamlessly from organic Blade landing pages to interactive React filters and React Native push alerts without losing saved searches or chat history.
- Protected buyer-seller communication: Firebase-backed chat threads paired with automated screening keep negotiations responsive while shielding user contact details.
- Disciplined moderation throughput: Risk-scored queues and immutable audit trails let small operations teams contain spam waves before low-quality listings degrade search trust.