How suraj-dhal/printbase works
Printbase is a multi-tenant print-shop operations SaaS. Guests submit files through a shop’s public QR page, configure print options, receive an estimate, and submit an order; shopkeepers manage orders, pricing, payments, and records, while staff onboard and administer shops. The graph covers the documented storage, security, analytics, and live-notification capabilities. Some subsystems are represented from README or index references because their implementation was not excerpted; edges reflect only shown calls or documented relationships.
Main entry points: index.tsx Role dashboards · shop-workspace.tsx Shop workspace · orders.functions.ts Order and file handling · cloudflare.server.ts Cloudflare bindings
Components 28
Customer and Staff Entry
- Public shop page
src/routes/s.$slug.tsx - Staff sign-in
src/routes/login.tsx - Invite acceptance
src/routes/invite.$token.tsx - Role dashboards
src/routes/index.tsx - Landing page
src/components/landing.tsx
Shop Operations
- Shop workspace
src/components/shop-workspace.tsx - Shop QR card
src/components/qr-card.tsx - Print customizer
src/components/print-customizer.tsx - Print preview
src/components/pdf-preview.tsx - Print configuration
src/lib/print-config.ts - Order and file handling
src/lib/orders.functions.ts - Shop pricing
src/lib/pricing.functions.ts - Shop analytics
src/lib/analytics.functions.ts
Platform Operations
- Authentication
src/lib/auth.functions.ts - Invite management
src/lib/invites.functions.ts - Shop onboarding
src/lib/shops.functions.ts - Platform administration
src/lib/admin.functions.ts - Team management
src/lib/team.functions.ts
Server and Storage
- Private file access
src/routes/api.shop-file.$uploadId.ts - Live updates endpoint
src/routes/api.shop-live.ts - Session and security
src/lib/security.server.ts - Cloudflare bindings
src/lib/cloudflare.server.ts - D1 records
- Private file bucket
- Shop live objects
Other components
- Guest customer
- Shop staff
- Shopkeeper
Connections 31
- Guest customer → Public shop page: opens shop
README.md - Public shop page → Order and file handling: uploads and submits
src/routes/s.$slug.tsx - Public shop page → Print configuration: configures printing
src/routes/s.$slug.tsx - Order and file handling → D1 records: records orders
README.md - Order and file handling → Private file bucket: stores private files
README.md - Shopkeeper → Shop workspace: uses workspace
README.md - Shop staff → Staff sign-in: signs in
README.md - Staff sign-in → Authentication: invokes sign-in
src/lib/auth.functions.ts - Authentication → Session and security: checks credentials
src/lib/auth.functions.ts - Role dashboards → Authentication: loads current user
src/routes/index.tsx - Role dashboards → Shop workspace: loads shop workspace
src/routes/index.tsx - Role dashboards → Shop onboarding: lists managed shops
src/routes/index.tsx - Role dashboards → Shop analytics: loads role analytics
src/routes/index.tsx - Role dashboards → Platform administration: runs admin actions
src/routes/index.tsx - Role dashboards → Team management: invites team users
src/routes/index.tsx - Invite acceptance → Invite management: accepts invite
src/routes/invite.$token.tsx - Shop workspace → Order and file handling: manages orders
src/components/shop-workspace.tsx - Shop workspace → Shop pricing: updates pricing
src/components/shop-workspace.tsx - Shop workspace → Shop analytics: requests exports
src/components/shop-workspace.tsx - Shop workspace → Platform administration: updates settings
src/components/shop-workspace.tsx - Print customizer → Print configuration: normalizes settings
src/components/print-customizer.tsx - Print preview → Print configuration: renders configured pages
src/components/pdf-preview.tsx - Order and file handling → Print configuration: prices print choices
src/lib/orders.functions.ts - Private file access → Private file bucket: serves authorized files
README.md - Live updates endpoint → Shop live objects: notifies shop clients
README.md - Session and security → Cloudflare bindings: uses platform bindings
src/lib/security.server.ts - Authentication → Cloudflare bindings: queries staff records
src/lib/auth.functions.ts - Order and file handling → Cloudflare bindings: uses storage bindings
src/lib/orders.functions.ts - Cloudflare bindings → D1 records: provides database
README.md - Cloudflare bindings → Private file bucket: provides bucket
README.md - Cloudflare bindings → Shop live objects: provides live namespace
README.md