Technical docs

PrintHub architecture

Stack overview, database schema, and API integrations for the 3D printing marketplace demo.

Technology stack

Production-ready architecture with static export for Firebase Hosting at /printhub.

Next.js 15

App Router, RSC, static export

React 19

Client islands, hooks, forms

TypeScript

End-to-end type safety

Tailwind CSS 4

Design system & responsive UI

shadcn/ui

Accessible component primitives

Supabase

Auth, Postgres, realtime subscriptions

Prisma

ORM, migrations, type-safe queries

Stripe

Checkout, Connect payouts, webhooks

Mapbox

InPost locker map (production)

Resend

Transactional email templates

Framer Motion

Page transitions & micro-interactions

Zustand / localStorage

Demo state persistence

Database schema

Supabase Postgres with Row Level Security. Prisma schema mirrors these tables.

TableKey fields
usersid, email, role, provider_id, created_at
providersid, slug, name, city, country, verified, materials[]
printersid, provider_id, brand, model, technology, build_volume
ordersid, order_number, status, customer_id, provider_id, files[]
quotesid, order_id, breakdown (jsonb), status, expires_at
messagesid, order_id, sender_id, body, read
shipmentsid, order_id, method, tracking_number, status
reviewsid, provider_id, rating, title, verified
notificationsid, user_id, type, order_id, read
audit_logsid, actor_id, action, entity_type, metadata

API integrations

REST routes and webhooks planned for production deployment.

Stripe Checkout

PaymentIntent after quote acceptance. Webhook updates order to PAID.

POST /api/webhooks/stripe
InPost ShipX

Locker selection, label generation, tracking webhooks for PL delivery.

GET /api/shipping/inpost/lockers
DHL Parcel DE

Cross-border EU shipping with customs-ready labels.

POST /api/shipping/dhl/labels
AI Quote Engine

Volume + complexity estimation from STL/OBJ mesh analysis.

POST /api/quotes/estimate
Resend

Order confirmations, quote alerts, shipment updates.

POST /api/email/send
Supabase Realtime

Live order timeline, messages, and notifications.

supabase.channel('orders')

Need implementation help?

This demo uses localStorage for state. See the order wizard and provider marketplace for UI patterns.