Skip to content

TabulaRasae/UsedBookExchange

Repository files navigation

BMCC Used Textbooks Portal (Next.js)

Marketplace-style portal for listing, browsing, and purchasing used textbooks. Built with Next.js (pages router), Tailwind CSS, MongoDB via Mongoose, session-backed APIs, and Supabase Storage for user-uploaded images.

Stack

  • Next.js 15 (pages directory) + React 18
  • Tailwind CSS for styling
  • MongoDB + Mongoose models for products, carts, users, orders
  • iron-session for server-side session cookies on API routes and SSR
  • Supabase Storage for image uploads (public bucket product-images)
  • OpenAI (chat completions) to generate listing metadata and cover suggestions

Key features

  • Authenticated dashboard and product catalog with server-side rendered pages
  • Product generation API that enriches listings (headline, description, specs, ISBN, cover suggestions)
  • Image uploads go through client-side compression then Supabase Storage; public URLs are saved with the product
  • Cart/checkout flow that marks purchased listings as sold and removes them from other carts

Important environment variables

  • MONGODB_URL (or MONGODB_URI) for MongoDB connection
  • SESSION_SECRET for iron-session
  • OpenAI: OPENAI_API_KEY or OPENAI_KEY or OPEN
  • Supabase Storage: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, NEXT_PUBLIC_SUPABASE_STORAGE_BUCKET (default product-images)
  • Firebase keys remain for front-end init (not currently used for storage)

Development

  • Install deps: npm install
  • Run dev server: npm run dev
  • Build: npm run build
  • Seed sample data (MongoDB required): npm run seed

Notes

  • OpenAI model usage is limited to generating non-critical listing descriptions to speed up listing creation; core listing data stays user-provided.
  • Image compression is client-side (max 900x900, quality tuned for ~400 KB bucket limit).

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors