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
canReadbook.price === 0 OR purchases.has(user, book)
canDownloadpurchases.has(user, book) AND signedUrl.notExpired
canEdituser.id === book.authorId OR user.role === 'admin'
canPublishuser.role === 'admin' OR (user.role === 'author' AND book.draftValid)
canManageUsersuser.role === 'admin'
Role Matrix
| Capability | Reader | Author | Admin |
|---|---|---|---|
| Browse catalog | ✓ | ✓ | ✓ |
| Purchase books | ✓ | ✓ | ✓ |
| Publish books | — | ✓ | ✓ |
| Edit any book | — | own only | ✓ |
| Manage users | — | — | ✓ |
Data Model
users
- id
- name
- role
- avatar
books
- id
- title
- authorId
- price
- published
- chapters[]
purchases
- id
- userId
- bookId
- amount
- date