Frontend for the Bookstore app: browse books, filter/search, view details, manage cart/wishlist, and checkout with Stripe (via the backend).
https://bookstore-app12.netlify.app/
- Books browsing: featured, bestsellers, genre browsing
- Filtering & sorting: URL-synced filters (shareable links), price + rating sliders, client-side sort for price/rating
- Search: debounced search with clear button + results
- Book details: polished details page with related books by genre
- Cart: improved UX, empty states, sticky order summary
- Wishlist: add/remove wishlist items (auth required)
- Profile: profile update form + dynamic orders history
- Payments: Stripe Checkout redirect + success page that polls order status
- Responsive UI: mobile / tablet / desktop layouts across main pages
- React + TypeScript (Vite)
- Tailwind CSS + shadcn/ui components
- React Router
- Axios
- Sonner (toasts)
src/pages/— route pages (books, details, cart, profile, checkout success, etc.)src/components/— UI + feature components (book cards, filters, orders, etc.)src/contexts/— cart state managementsrc/utils/checkout.ts— Stripe-related API helperspublic/_redirects— Netlify SPA routing (important for deep links)
cd Bookstore-app
npm installCreate Bookstore-app/.env:
VITE_BACKEND_API=http://localhost:8000npm run dev
npm run build
npm run preview-
Start the backend and set these backend env vars:
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETCLIENT_URL=http://localhost:5173
-
Run Stripe CLI to forward webhooks:
stripe listen --forward-to localhost:8000/payment/webhook- In the frontend:
- Add a book to cart → proceed to checkout → pay with Stripe test card
4242 4242 4242 4242. - After redirect,
/checkout/successpolls the backend until the order becomespaid.
- Add a book to cart → proceed to checkout → pay with Stripe test card
- Keep
public/_redirectsin place so routes like/books/:idand/checkout/successdon’t 404. - Set
VITE_BACKEND_APIin Netlify environment variables to your deployed backend URL.