Product Architecture

How Paperbound works

A walkthrough of core flows, the access rules engine, and the data model that powers the reading experience.

Purchase & Read Flow

Reader

Signs in

Book Detail

Browse / Preview

Checkout

Stripe session

Webhook

Grant access

Reader

Read + download

Author Publishing Flow

Upload

PDF + Cover

Storage

S3 (private)

Review

Admin approval

Catalog

Listed publicly

Access Rules Engine
canRead

book.price === 0 OR purchases.has(user, book)

canDownload

purchases.has(user, book) AND signedUrl.notExpired

canEdit

user.id === book.authorId OR user.role === 'admin'

canPublish

user.role === 'admin' OR (user.role === 'author' AND book.draftValid)

canManageUsers

user.role === 'admin'

Role Matrix
CapabilityReaderAuthorAdmin
Browse catalog
Purchase books
Publish books
Edit any bookown only
Manage users
Data Model
users
  • id
  • name
  • email
  • role
  • avatar
books
  • id
  • title
  • authorId
  • price
  • published
  • chapters[]
purchases
  • id
  • userId
  • bookId
  • amount
  • date