Skip to content

Repository files navigation

📚 LitLab V4.5

Freemium evolution of the QR-connected multimedia literature hub

LitLab links physical books to student-created podcasts, videos, games, infographics and other digital learning materials — with a freemium creator model layered on top.

Next.js Supabase Stripe next-intl Tailwind CSS


From V3.0 to V4.5

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.

Freemium model

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

Features

  • 💳 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

Architecture

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]
Loading

Tech stack

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

Local setup

git clone https://github.com/xondell/LitLabV4.5.git
cd LitLabV4.5
npm install

Create .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:3000

Run:

npm run dev

Before opening a pull request, run:

npm run lint
npm run typecheck
npm run build

Supabase setup

The 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 push

The 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.

Vercel deployment

  1. Import this GitHub repository into a new Vercel project.
  2. Select Node.js 22 and leave the framework preset as Next.js.
  3. Add every key from .env.example to Development, Preview and Production.
  4. Set NEXT_PUBLIC_SITE_URL to the canonical URL for each environment.
  5. Connect the Vercel and Supabase integrations if preview database branches are used.
  6. 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.

Mobile app

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.

Security

The following values are server secrets and must never be committed or exposed through NEXT_PUBLIC_*:

  • SUPABASE_SERVICE_ROLE_KEY
  • STRIPE_SECRET_KEY
  • STRIPE_WEBHOOK_SECRET

Review RLS before using production data or payments.

Version relationship

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.

About

Freemium multimedia literature platform linking physical books to digital learning content with QR codes, Supabase and Stripe.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages