LitLab links physical books to student-created podcasts, videos, games, infographics and other digital learning materials — with a freemium creator model layered on top.
The core idea stays the same:
Physical book → QR code → Digital book page → Student-created media
V4.5 adds a product/business layer:
- account tiers;
- upload limits;
- premium QR behavior;
- Stripe subscription infrastructure;
- updated Supabase functions, triggers and RLS.
| Free / Student | Premium / Creator |
|---|---|
| Access LitLab content | Access LitLab content |
| Upload up to 1 book | Unlimited book uploads |
| Standard QR access | High-resolution / premium QR experience |
| No paid subscription | Stripe-managed subscription |
- 💳 Stripe subscriptions
- 🧱 freemium access gates
- 🔐 Supabase authentication
- 🛡 Row Level Security
- 🗄 Supabase PostgreSQL + Storage
- 🔗 QR-linked physical books
- 🌍 English, Russian, Romanian and French
- 🎨 bold brutalist UI
- 📱 responsive full-stack experience
flowchart TD
U[User] --> AUTH[Supabase Auth]
AUTH --> T{Tier}
T -->|Free| F[1-book limit]
T -->|Premium| P[Unlimited uploads]
P --> STRIPE[Stripe subscription]
F --> LIB[LitLab content]
P --> LIB
LIB --> QR[QR-connected book experience]
| Area | Technology |
|---|---|
| Framework | Next.js 16 / App Router |
| Language | TypeScript |
| Styling | Tailwind CSS 4 |
| Database | Supabase PostgreSQL |
| Auth | Supabase Auth |
| Storage | Supabase Storage |
| Payments | Stripe |
| Internationalization | next-intl |
git clone https://github.com/xondell/LitLabV4.5.git
cd LitLabV4.5
npm installCreate .env.local:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=
SUPABASE_SERVICE_ROLE_KEY=
# Stripe
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PREMIUM_PRICE_ID=
# App
NEXT_PUBLIC_SITE_URL=http://localhost:3000Run:
npm run devBefore opening a pull request, run:
npm run lint
npm run typecheck
npm run buildThe repository includes a local Supabase configuration and ordered migrations. After authenticating the CLI, link the intended project and apply them:
supabase login
supabase link --project-ref <your-project-ref>
supabase db pushThe migrations create and secure:
profiles, books, characters, media, stripe_events
covers and lab-materials Storage buckets
RLS policies, explicit Data API grants, indexes and plan enforcement
Do not apply migrations to production until they have been tested in a Supabase preview branch or a separate staging project.
- Import this GitHub repository into a new Vercel project.
- Select Node.js 22 and leave the framework preset as Next.js.
- Add every key from
.env.exampleto Development, Preview and Production. - Set
NEXT_PUBLIC_SITE_URLto the canonical URL for each environment. - Connect the Vercel and Supabase integrations if preview database branches are used.
- Deploy a Preview first and validate login, upload, catalog and checkout flows.
Configure Supabase Auth URL settings with the production site URL and these redirect patterns (plus preview equivalents when needed):
https://your-domain.example/*/auth/callback
Create a Stripe webhook pointing to:
https://your-domain.example/api/stripe/webhook
Subscribe it to checkout.session.completed,
customer.subscription.updated, and customer.subscription.deleted, then store
the signing secret as STRIPE_WEBHOOK_SECRET in Vercel.
The Expo app lives in mobile/ and uses Expo SDK 57. Copy
mobile/.env.example to mobile/.env.local, set the deployed web API URL, then
run npm run mobile:typecheck from the repository root before building it.
The following values are server secrets and must never be committed or exposed through NEXT_PUBLIC_*:
SUPABASE_SERVICE_ROLE_KEYSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRET
Review RLS before using production data or payments.
V4.5 is the product-model successor to LitLab V3.0, which remains useful as the earlier multimedia-learning baseline.
LitLab V4.5 — from multimedia reading prototype to subscription-aware platform.