tinyfiles.tv

Narrow down your search

Because you viewed Including ads

Made by people,
for people.

tinyfiles Marketplace is for unique and creative goods, where special items with a human touch shine.

Shop
Gift cards
Registry
Sitemap
Blog
tinyfiles United Kingdom
tinyfiles Germany
tinyfiles Canada
Sell
Seller handbook
Teams
Forums
Affiliates & Creators
About
tinyfiles, Inc.
Policies
Investors
Careers
Press
Impact
Help
Help Center
Privacy settings

United States  |  Terms of Use   Privacy   Interest-based ads   Local Shops   Regions   © 2026 tinyfiles, Inc.

Search for moon lamp, use filters on the left, or tap a listing. Demo only, nothing is bought for real.
Backend  ·  Template · Proposed · Not connected

Backend, Browse Backend, Template

Right now browse is a local demo list plus filters, search, sort, favorites, cart, no order created, no payment taken. This backend is the map to make it real: search listings, filter, sort, paginate, track favorites, add to cart. Proposed, not connected.

01 / Files to create
api/marketplace/search.php       GET /api/marketplace/search?q=
api/marketplace/listings.php      GET /api/marketplace/listings
api/marketplace/favorites.php     POST /api/marketplace/favorites
api/marketplace/cart.php          POST /api/marketplace/cart
sql/marketplace_tables.sql

Keep the tinyfiles PHP pattern: /api/bootstrap.php, json_in() / json_out(), prepared PDO.

02 / Database tables
marketplace_listings
  id BIGINT AUTO_INCREMENT PRIMARY KEY
  shop_id BIGINT NOT NULL
  title VARCHAR(140) NOT NULL
  category VARCHAR(100) NOT NULL
  subcategory VARCHAR(100) NULL
  price_cents INT NOT NULL
  sale_price_cents INT NULL
  color VARCHAR(50) NULL
  item_format VARCHAR(30) NOT NULL DEFAULT 'Physical'
  ships_from VARCHAR(100) NULL
  status VARCHAR(30) NOT NULL DEFAULT 'public'

marketplace_favorites
  id BIGINT AUTO_INCREMENT PRIMARY KEY
  user_id BIGINT NOT NULL
  listing_id BIGINT NOT NULL
  UNIQUE(user_id, listing_id)
03 / API endpoints
GET /api/marketplace/search?q=moon%20lamp&category=Home%20Decor&min_price=0&max_price=90&color=pink&sort=relevant&page=1
- returns listings, total, page, has_more
- fulltext on title + description + tags + shop name

GET /api/marketplace/listings?category=Lamps&sort=low
- same filter, for category pages

POST /api/marketplace/favorites
{ "listing_id": 123 }
- toggles favorite for signed in user

Search must be fast, cache category lists, never return draft listings in search.

04 / Cooldown, moderation and validation
// Cooldown: 1 search per 1s, 1 favorite per 2s, 1 cart add per 2s
// Validation: q 0 to 200, min_price >= 0, max_price >= min_price, page >= 1
// Safety: escape output, prepared statements, never trust client price
// Privacy: favorites are user only, cart is user only, never public

Keep disclaimer until this ships: Tinker toy, not live yet.

05 / Frontend wiring
// On Search input: debounce 300ms, GET /api/marketplace/search, render grid
// On Filter change: rebuild query, reset to page 1, GET search
// On Sort change: rebuild query, GET search
// On Favorite: POST /api/marketplace/favorites, toggle heart
// On Add to cart: POST /api/marketplace/cart, show cart count
// If API fails, fall back to local demo plus disclaimer.
Copy snippets into api/marketplace/ plus sql/marketplace_tables.sql, no GitHub needed. Browse stays safe by never charging a real fee in demo, never showing draft listings, and never using other people's IP in demo listings.