BookNest – Ebook Store

A full e-commerce store selling ebooks: filterable catalog, cart, Stripe payments, user accounts and instant download after purchase.

Next.jsSupabaseStripeTypeScriptFramer MotionE-commerce
https://book-nest-seven-tau.vercel.app/
BookNest – Ebook Store — long website preview

About the project

A complete digital storefront built from scratch on Next.js and Supabase — from the product catalog, through cart and Stripe checkout, to an account panel with order history and secure file downloads. A fully digital model (no physical shipping) with a focus on instant access right after payment.

Timeline: iterative, session by session

What I worked on

  • Product catalog with pagination, category/author filtering, and full-text search
  • Cart and checkout combined into a single flow — no unnecessary intermediate steps
  • Stripe Checkout integration with a webhook confirming payment
  • Supabase Auth authentication (sign-up, sign-in, session-refreshing middleware)
  • Account panel with tabs: personal details, order history, wishlist, delivery addresses, password change
  • Secure ebook downloads — signed links generated only after verifying a paid order
  • Cart and wishlist context (React Context) memoized for performance across many product cards at once
  • Generated product covers (color overlay + typography) as a legally safe alternative to real copyrighted cover art
  • Fully responsive — from the hero section to the account panel, product grids scaling 2→3→5 columns
  • Seed scripts pulling catalog data from real, free sources (Project Gutenberg / Google Books API)

Results

  • A complete, working purchase flow: catalog → cart → Stripe → confirmation → file download
  • No empty placeholders — every book without a photo gets a consistent, generated cover instead of a gray icon
  • Secure file access model — private Supabase Storage bucket, links valid only briefly and only for paid orders
  • Responsive at every screen width, from phone to large desktop

Challenges and solutions

Challenge

Anonymous checkout (without login) kept failing when creating an order in Supabase with an RLS error, despite a correct INSERT policy.

Solution

The cause was the return read after the insert (.select().single()), which fell under a separate, more restrictive SELECT policy. Fix: generating the order ID server-side, removing the need for that return read entirely.

Challenge

Real book covers (scans from Open Library, Google Books) looked inconsistent, and some would infringe copyright if used commercially.

Solution

Designed a cover-generating component: background photo + category-based color overlay + title/author typography — visually consistent and legally safe.

Challenge

The catalog needed real, legally sellable digital content, not just metadata.

Solution

A script that downloads actual public-domain .epub files (Project Gutenberg via the Gutendex API) and uploads them directly into a private Supabase Storage bucket.

Key project decisions

  • Next.js App Router with a mix of Server and Client Components — data fetched server-side, interactivity (cart, forms) client-side
  • Purely digital model instead of hybrid — a simpler checkout with no delivery address or carrier selection
  • Supabase as the single source of truth: Postgres + Auth + Storage in one place, with RLS guarding data access
  • React context (Cart/Wishlist) memoized with useMemo so adding one item doesn't re-render the entire product grid
  • Generated covers as a deliberate aesthetic and legal choice, instead of relying on uncertain image sources

Integrations

Stripe Checkout + webhook (payment confirmation, order status updates)Supabase Auth (email/password, session-refreshing middleware)Supabase Storage (private bucket for ebook files, signed download links)Google Books API and Project Gutenberg / Gutendex — data and file sources for the catalognext/image configured with multiple remote hosts for various cover sources