Admin Dashboard (Prototype)
Subscriptions
Referrals
Most Viewed
Upload Approvals
Backend Blueprint and Extension Notes
Open developer notes
Recommended stack: Node.js (Express) or Django + PostgreSQL + object storage (S3 compatible).
Users, Papers, Subscriptions, Transactions, Rewards, Referrals, Uploads, AdminActions.
POST /auth/signup, POST /auth/login, POST /subscriptions/pay, POST /subscriptions/renew, GET /papers, GET /papers/{id}, POST /uploads, PATCH /uploads/{id}/approve, POST /referrals, GET /admin/metrics.
Store PDFs in private bucket. Serve through signed URLs and stream in PDF.js with download button disabled. Add watermarks server-side.
On each referral signup: increment referral_count. If referral_count % 3 == 0, add reward_days +7 and record in Rewards table.
After admin approves upload: add reward_days +2, mark reward source = upload_id. Reverse if upload rejected later.
Use STK Push: initiate payment, store CheckoutRequestID, validate callback before extending subscription by 30 days.