Features & Functionality Reference¶
Quick reference guide for all features and capabilities in the Diskover platform.
Table of Contents¶
- User Features
- Product Features
- Asset Features
- Transaction Features
- Organization Features
- License Features
- Admin Features
- API Endpoints
User Features¶
Authentication & Registration¶
- User Registration: Sign up with email/password via Clerk
- Login/Logout: Secure authentication via Clerk
- User Profile: View and update personal information
- Session Management: Persistent login sessions
UI Routes:
- /register - Registration page
- /login - Login page
- /dashboard - User dashboard (requires auth)
API Endpoints:
- GET /users/me - Get current user profile
Product Features¶
Product Types¶
- Digital Products: One-time purchase digital goods (ebooks, courses, templates, etc.)
- Memberships: Subscription-based access with time-limited entitlements
Product Management¶
- Create Products: Sellers can create digital products and memberships
- Edit Products: Update product details, pricing, descriptions
- Activate/Deactivate: Control product visibility in marketplace
- Delete Products: Remove products (with constraints on active subscriptions)
- Product Assets: Attach downloadable files to products
Product Fields: - Name - Description - Type (digital/membership) - Price (in cents) - Subscription Days (required for memberships) - Active Status - Organization ID (owner)
UI Routes:
- / - Browse all active products (public)
- /products/{id} - View product details (public)
- /dashboard/selling - Manage your products (seller dashboard)
API Endpoints:
- GET /products - List all active products
- GET /products/{id} - Get product details
- POST /products - Create new product (auth required)
- PUT /products/{id} - Update product (auth required)
- DELETE /products/{id} - Delete product (auth required)
Asset Features¶
Asset Management¶
Assets are downloadable files that can be attached to products. When users purchase a product, they receive entitlements to download all associated assets.
Asset Upload Flow¶
- Seller selects file to upload
- Backend validates against organization's license limits
- Backend creates asset record and returns presigned S3 upload URL
- Frontend uploads file directly to S3
- Asset is ready to be linked to products
Asset Download Flow¶
- Buyer views purchased products
- Backend validates user has valid entitlement for asset
- Backend generates presigned S3 download URL
- Buyer downloads file directly from S3
Storage Configuration¶
- S3-Compatible Storage: Works with AWS S3, Railway Object Storage, MinIO
- Direct Upload: Files upload directly from browser to S3 (not through backend)
- Presigned URLs: Secure time-limited URLs for upload (15 min) and download (1 hour)
- Storage Key Format:
{org_id}/{asset_id}/{filename}
UI Routes:
- /dashboard/assets - List organization assets
- /dashboard/assets/upload - Upload new asset
API Endpoints:
- GET /orgs/{org_id}/assets - List organization's assets
- POST /orgs/{org_id}/assets - Create asset and get upload URL
- GET /orgs/{org_id}/assets/{id} - Get asset details
- PATCH /orgs/{org_id}/assets/{id} - Update asset metadata
- DELETE /orgs/{org_id}/assets/{id} - Delete asset
- GET /orgs/{org_id}/assets/usage - Get storage usage
- GET /orgs/{org_id}/products/{id}/assets - List product's assets
- POST /orgs/{org_id}/products/{id}/assets - Add asset to product
- DELETE /orgs/{org_id}/products/{id}/assets/{asset_id} - Remove asset from product
- GET /assets/{id}/download - Get download URL (validates entitlement)
Transaction Features¶
Purchase Flow¶
- Browse products
- Select product to purchase
- Review checkout page
- Complete payment (simulated or via payment provider)
- Receive entitlements to access product
Transaction Types¶
- One-Time Purchase: Digital products (lifetime access)
- Subscription Purchase: Memberships (time-limited access)
Transaction Statuses¶
pending- Payment initiated but not completedcompleted- Payment successful, entitlements grantedfailed- Payment failedrefunded- Payment refunded, entitlements revoked
UI Routes:
- /checkout - Complete purchase
- /dashboard/purchases - View purchase history
API Endpoints:
- GET /transactions - List user's transactions
- GET /transactions/{id} - Get transaction details
- POST /transactions - Create new transaction (purchase)
Organization Features¶
Organization Types¶
- Personal Organizations: Auto-created for each user, used for individual selling
- Shared Organizations: Created by users for team/company selling
Organization Roles¶
- Owner: Full control, can delete organization, manage all aspects
- Admin: Manage products and members, cannot delete organization
- Member: Create and edit products, view members
- Viewer: Read-only access to organization data
Organization Management¶
- Create Organizations: Users can create shared organizations
- Add Members: Invite users to join organization
- Manage Roles: Assign roles to members
- View Products: See all products belonging to organization
- View Sales: Track organization's sales and transactions
UI Routes:
- /dashboard/orgs - List all organizations
- /dashboard/orgs/{id} - Organization details and management
API Endpoints:
- GET /orgs - List user's organizations
- GET /orgs/{id} - Get organization details
- POST /orgs - Create new organization
- PUT /orgs/{id} - Update organization
- GET /orgs/{id}/members - List organization members
- POST /orgs/{id}/members - Add member to organization
- DELETE /orgs/{id}/members/{user_id} - Remove member
License Features¶
Organization Licenses¶
Each organization has an assigned license that defines usage limits. New organizations automatically receive the default "free" license.
License Limits¶
| Limit | Description | Free Tier Default |
|---|---|---|
max_upload_size_mb |
Maximum single file upload size | 100 MB |
max_total_storage_mb |
Total storage quota for organization | 1000 MB (1 GB) |
max_assets_count |
Maximum number of assets | 100 |
max_products_count |
Maximum number of products | 50 |
max_members_count |
Maximum organization members | 5 |
License Tiers¶
| Tier | Upload | Storage | Assets | Products | Members | Price |
|---|---|---|---|---|---|---|
| Free | 100 MB | 1 GB | 100 | 50 | 5 | $0/mo |
| Starter | 500 MB | 10 GB | 500 | 100 | 10 | $19/mo |
| Pro | 2 GB | 100 GB | 2000 | 500 | 50 | $49/mo |
| Enterprise | 10 GB | 1 TB | Unlimited | Unlimited | Unlimited | Contact |
Note: Only the free tier is currently implemented. Paid tiers are for future billing integration.
License Enforcement¶
- Upload requests are validated against
max_upload_size_mb - Storage usage is checked against
max_total_storage_mbbefore uploads - Asset count is verified against
max_assets_countbefore creating assets - Product count is verified against
max_products_countbefore creating products - Member count is verified against
max_members_countbefore inviting members
UI Routes:
- /dashboard/orgs/{id}/settings - View organization license and usage
API Endpoints:
- GET /orgs/{org_id}/license - Get organization license info
- GET /orgs/{org_id}/assets/usage - Get storage usage statistics
Admin Features¶
System Administration¶
System admins have elevated privileges to manage the entire platform.
Admin Capabilities¶
- View All Transactions: See all user transactions across the platform
- Reconcile Transactions: Update transaction statuses, handle payment issues
- View All Users: Access user data and statistics
- View All Organizations: Monitor all organizations
- View All Products: See all products (active and inactive)
- System Analytics: Access platform-wide metrics and reports
Admin Permissions:
- read: View admin data
- write: Modify transactions, user data, etc.
UI Routes:
- /goose - Admin dashboard (admin only)
- /goose/reconciliation - Transaction reconciliation
- /goose/view-all - System-wide data viewer
API Endpoints:
- GET /admin/transactions - List all transactions (admin only)
- POST /admin/transactions/{id}/reconcile - Reconcile transaction
- GET /admin/users - List all users (admin only)
- GET /admin/orgs - List all organizations (admin only)
- GET /admin/products - List all products (admin only)
How to Become Admin:
Manually insert into system_admins table:
INSERT INTO system_admins (user_id, permissions)
VALUES ('your-user-uuid', '{"read": true, "write": true}');
Subscription & Entitlement Features¶
Subscriptions¶
Created automatically when a membership product is purchased.
Subscription Fields: - User ID - Product ID - Transaction ID (initial purchase) - Status (active, past_due, canceled, expired) - Current Period Start/End - Canceled At (if applicable)
Subscription Statuses:
- active - Subscription is valid
- past_due - Payment issue, grace period
- canceled - User canceled, expires at period end
- expired - Subscription period ended
Entitlements¶
Grant users access to digital assets (downloadable files).
Entitlement Properties: - User ID - Asset ID - Product ID - Transaction ID - Expires At (NULL for lifetime access, date for memberships)
Access Control: - Users can only download assets they have valid entitlements for - Expired entitlements block access - Entitlements are created automatically on purchase
API Endpoints Summary¶
Public Endpoints (No Auth Required)¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /products |
List active products |
| GET | /products/{id} |
Get product details |
User Endpoints (Auth Required)¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /users/me |
Get current user profile |
| PUT | /users/me |
Update user profile |
| GET | /transactions |
List user's transactions |
| GET | /transactions/{id} |
Get transaction details |
| POST | /transactions |
Create transaction (purchase) |
| POST | /products |
Create product |
| PUT | /products/{id} |
Update product |
| DELETE | /products/{id} |
Delete product |
| GET | /orgs |
List user's organizations |
| GET | /orgs/{id} |
Get organization details |
| POST | /orgs |
Create organization |
| PUT | /orgs/{id} |
Update organization |
| GET | /orgs/{id}/members |
List org members |
| POST | /orgs/{id}/members |
Add org member |
| DELETE | /orgs/{id}/members/{user_id} |
Remove org member |
| GET | /orgs/{id}/license |
Get org license info |
| GET | /orgs/{id}/assets |
List org assets |
| POST | /orgs/{id}/assets |
Create asset (get upload URL) |
| GET | /orgs/{id}/assets/{asset_id} |
Get asset details |
| PATCH | /orgs/{id}/assets/{asset_id} |
Update asset metadata |
| DELETE | /orgs/{id}/assets/{asset_id} |
Delete asset |
| GET | /orgs/{id}/assets/usage |
Get storage usage |
| GET | /orgs/{id}/products/{pid}/assets |
List product assets |
| POST | /orgs/{id}/products/{pid}/assets |
Link asset to product |
| DELETE | /orgs/{id}/products/{pid}/assets/{aid} |
Unlink asset |
| GET | /assets/{id}/download |
Get download URL |
Admin Endpoints (Admin Auth Required)¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/transactions |
List all transactions |
| POST | /admin/transactions/{id}/reconcile |
Reconcile transaction |
| GET | /admin/users |
List all users |
| GET | /admin/orgs |
List all organizations |
| GET | /admin/products |
List all products |
Database Schema Overview¶
Core Tables¶
- users: User accounts and profiles
- orgs: Organizations (personal and shared)
- org_members: Organization membership and roles
- products: Digital products and memberships
- assets: Downloadable files/content
- product_assets: Many-to-many product-asset linking
Transaction Tables¶
- transactions: Purchase records
- subscriptions: Active memberships
- subscription_periods: Billing history
- entitlements: User access to assets
Admin Tables¶
- system_admins: System administrator users
- seller_pages: Customizable seller storefronts (optional)
Feature Testing Checklist¶
Use this checklist to verify all features are working:
User Features¶
- [ ] Register new user
- [ ] Login with existing user
- [ ] View user profile
- [ ] Update user profile
- [ ] Logout
Product Features¶
- [ ] Browse products (unauthenticated)
- [ ] View product details
- [ ] Create digital product
- [ ] Create membership product
- [ ] Edit product
- [ ] Deactivate product
- [ ] Delete product
Asset Features¶
- [ ] Upload asset to organization
- [ ] View asset list with usage stats
- [ ] Update asset metadata
- [ ] Delete asset
- [ ] Link asset to product
- [ ] Unlink asset from product
- [ ] Download asset (with valid entitlement)
- [ ] Verify download blocked without entitlement
License Features¶
- [ ] View organization license info
- [ ] View storage usage statistics
- [ ] Verify upload blocked when size exceeds limit
- [ ] Verify upload blocked when storage full
- [ ] Verify asset creation blocked at asset limit
- [ ] Verify product creation blocked at product limit
- [ ] Verify member invite blocked at member limit
Transaction Features¶
- [ ] Purchase digital product
- [ ] Purchase membership
- [ ] View purchase history
- [ ] Access purchased content
- [ ] Verify entitlements
Organization Features¶
- [ ] Personal org auto-created on registration
- [ ] Create shared organization
- [ ] Add organization members
- [ ] Assign member roles
- [ ] View organization products
- [ ] View organization sales
Subscription Features¶
- [ ] Subscription created on membership purchase
- [ ] Subscription status is "active"
- [ ] Subscription period calculated correctly
- [ ] Entitlements expire with subscription
Admin Features¶
- [ ] Access admin dashboard (admin users only)
- [ ] View all transactions
- [ ] Reconcile transaction
- [ ] View all users
- [ ] View all organizations
- [ ] View all products
Common Data Flows¶
User Registration Flow¶
- User submits registration form
- Clerk creates authentication account
- Backend creates user record in database
- Backend creates personal organization for user
- Backend adds user as owner of personal org
- User is redirected to dashboard
Product Purchase Flow (Digital)¶
- User selects product to purchase
- User proceeds to checkout
- User completes payment
- Transaction record is created (status: completed)
- Entitlements are created for all product assets (expires_at: NULL)
- User can download/access product
Product Purchase Flow (Membership)¶
- User selects membership product
- User completes payment
- Transaction record is created
- Subscription record is created (status: active)
- Subscription period calculated (start: now, end: now + subscription_days)
- Entitlements created for all membership assets (expires_at: subscription end)
- User has access until subscription expires
Organization Creation Flow¶
- User clicks "Create Organization"
- User fills in org name and slug
- Organization record created (is_personal: false)
- User added as owner to org_members table
- User can create products under this organization
Next Steps¶
- For detailed testing instructions, see TESTING_GUIDE.md
- For API details, see api/openapi.yaml
- For deployment instructions, see DEPLOYMENT.md