A comprehensive, full-stack e-commerce application built with Next.js 15, TypeScript, Supabase, and modern web technologies. This platform features all the essential functionality you'd expect from a production-ready e-commerce site.
- Product Catalog: Browse products with categories, search, and filtering
- Shopping Cart: Full cart management with add/update/remove functionality
- User Authentication: Secure login/registration with Supabase Auth
- Order Management: Complete order processing and tracking
- Payment Integration: Stripe payment gateway integration
- Review System: Customer reviews and ratings
- Wishlist: Save favorite products for later
- Admin Dashboard: Comprehensive admin panel for store management
- Image Hosting: Cloudinary integration for product images
- Real-time Updates: WebSocket support for live notifications
- Responsive Design: Mobile-first design with Tailwind CSS
- Database Management: Supabase PostgreSQL with Row Level Security
- API Integration: RESTful APIs for all functionality
- Modern UI: Beautiful, intuitive interface with shadcn/ui components
- Search & Filter: Advanced product search and category filtering
- Order History: Complete order tracking and management
- User Profile: Personal dashboard with order history and preferences
- Secure Checkout: Safe and secure payment processing
- Next.js 15: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- shadcn/ui: Modern UI component library
- Lucide React: Beautiful icon library
- Framer Motion: Smooth animations
- Next.js API Routes: Server-side API endpoints
- Supabase: PostgreSQL database with real-time capabilities
- Supabase Auth: Authentication and authorization
- Row Level Security: Database-level security policies
- Stripe: Payment processing
- Cloudinary: Image hosting and management
- ESLint: Code linting and formatting
- TypeScript: Static type checking
- Hot Reload: Fast development experience
-
Clone the repository
git clone <repository-url> cd shophub
-
Install dependencies
npm install
-
Set up Supabase
- Create a project at https://app.supabase.com
- Run
supabase-schema.sqlin SQL Editor - Run
supabase-sample-data-auth.sqlin SQL Editor - Get your API keys from Settings > API
-
Set up environment variables
cp ENV_TEMPLATE.txt .env
Configure the following variables in
.env:# Supabase (REQUIRED) NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key # App NEXT_PUBLIC_APP_URL=http://localhost:3000 # Stripe (Optional) NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret # Cloudinary (Optional) NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Start the development server
npm run dev
src/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ cart/ # Shopping cart API
β β βββ checkout/ # Payment processing
β β βββ orders/ # Order management
β β βββ products/ # Product catalog
β β βββ reviews/ # Review system
β β βββ wishlist/ # Wishlist functionality
β βββ admin/ # Admin dashboard
β βββ dashboard/ # User dashboard
β βββ globals.css # Global styles
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ cart/ # Cart-related components
β βββ providers/ # Context providers
βββ lib/ # Utility libraries
β βββ auth.ts # Supabase Auth utilities
β βββ supabase.ts # Supabase client
β βββ stripe.ts # Stripe configuration
β βββ cloudinary.ts # Cloudinary setup
βββ hooks/ # Custom React hooks
- Persistent cart storage in database
- Real-time cart updates
- Quantity management
- Checkout integration
- Product management (CRUD operations)
- Order tracking and management
- Sales analytics and reporting
- User management
- Stripe integration for secure payments
- Webhook handling for payment confirmation
- Order status updates
- Refund processing
- Customer ratings and reviews
- Review moderation
- Average rating calculations
- Verified purchase badges
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Database
npm run db:push # Push schema to database
npm run db:studio # Open Prisma Studio
npm run seed # Seed database with sample data
# Code Quality
npm run lint # Run ESLint
npm run type-check # Run TypeScript checksThis application is designed to be deployed on modern hosting platforms:
-
Vercel (Recommended)
- Automatic deployments from Git
- Built-in Next.js optimization
- Edge functions support
-
Netlify
- Static site generation
- Serverless functions
- Form handling
-
AWS/Google Cloud
- Full control over infrastructure
- Scalability options
- Custom configurations
GET /api/products- Get all products with filteringGET /api/products/[id]- Get single productPOST /api/products- Create new product (admin)PUT /api/products/[id]- Update product (admin)DELETE /api/products/[id]- Delete product (admin)
GET /api/cart- Get user's cartPOST /api/cart- Add item to cartPUT /api/cart- Update cart itemDELETE /api/cart- Remove item from cart
GET /api/orders/user- Get user's ordersPOST /api/checkout- Process checkoutGET /api/admin/dashboard- Get admin stats
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- shadcn/ui for beautiful components
- Prisma for excellent ORM
- Stripe for payment processing
- Cloudinary for image hosting
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the code comments
Built with β€οΈ using modern web technologies