A modern, full-stack e-commerce platform built with Next.js 14, Supabase, and Cloudinary.
- Product Browsing - Browse products with category filters, search, and price range filtering
- Product Details - View product images, multiple variants, and size selection (S, M, L, XL, XXL, XXXL)
- Shopping Cart - Add/remove items, update quantities, persistent cart with size tracking
- Checkout - Complete checkout with shipping address and order confirmation
- Order History - View past orders with status tracking
- Google Authentication - Secure login with Google OAuth
- Admin Dashboard - Comprehensive dashboard for store management
- Order Management - View orders, update status (pending β confirmed β shipped β delivered), filter and sort orders
- Product Management - Add, edit, delete products with:
- Multiple image uploads via Cloudinary
- Size selection
- Category assignment
- Trending/Active status toggles
- Search and filter products
- Ad Management - Create and manage homepage carousel ads
- HttpOnly Cookies - Secure session management with Supabase SSR
- Admin Role Protection - Admin routes protected by role-based access
- Row Level Security (RLS) - Database-level security policies
- Cloudinary Integration - Automatic image optimization
- Next.js Image Component - Lazy loading, responsive sizing
- Auto Format - WebP/AVIF conversion with
f_auto - Auto Quality - Bandwidth optimization with
q_auto
| Category | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Database | Supabase (PostgreSQL) |
| Authentication | Supabase Auth (Google OAuth) |
| Styling | Tailwind CSS (CDN) |
| Image Storage | Cloudinary |
| Icons | Font Awesome 6 |
denz/
βββ app/ # Next.js App Router
β βββ admin/dashboard/ # Admin dashboard page
β βββ api/upload/ # Cloudinary upload API
β βββ auth/callback/ # OAuth callback handler
β βββ cart/ # Cart page
β βββ checkout/ # Checkout page
β βββ my-orders/ # Order history page
β βββ product/[id]/ # Product details page
β βββ secret-admin-login/ # Admin login page
β βββ shop/ # Shop/products page
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β
βββ components/
β βββ Navbar.tsx # Navigation bar
β βββ NavbarWrapper.tsx # Navbar with session
β βββ ProductImage.tsx # Optimized image components
β βββ Providers.tsx # React context providers
β
βββ context/
β βββ CartContext.tsx # Shopping cart state
β
βββ lib/
β βββ cloudinaryLoader.ts # Cloudinary URL optimization
β βββ supabase.ts # Supabase client exports
β βββ supabase/
β βββ client.ts # Browser Supabase client
β βββ middleware.ts # Session refresh utility
β βββ server.ts # Server Supabase client
β
βββ pages/ # Page components
β βββ AdminDashboard.tsx # Admin dashboard UI
β βββ AdminLogin.tsx # Admin login UI
β βββ Cart.tsx # Cart UI
β βββ Checkout.tsx # Checkout UI
β βββ Home.tsx # Homepage UI
β βββ MyOrders.tsx # Order history UI
β βββ ProductDetails.tsx # Product details UI
β βββ Shop.tsx # Shop page UI
β
βββ public/ # Static assets
βββ middleware.ts # Next.js middleware (session refresh)
βββ store.sql # Database schema
βββ types.ts # TypeScript interfaces
βββ next.config.js # Next.js configuration
- Node.js 18+
- Supabase account
- Cloudinary account
- Google OAuth credentials (in Supabase)
-
Clone the repository
git clone https://github.com/Bijoy2406/denz.git cd denz -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
-
Set up the database
Run the
store.sqlfile in your Supabase SQL editor to create all tables and policies. -
Configure Supabase Auth
- Enable Google OAuth in Supabase Dashboard
- Add redirect URL:
http://localhost:3000/auth/callback
-
Run the development server
npm run dev
-
Open the app
Visit http://localhost:3000
| Color | Hex | Usage |
|---|---|---|
| Primary | #8B4789 |
Buttons, links, accents |
| Secondary | #DC2626 |
Alerts, delete buttons |
| Brown | #7C3F2E |
Secondary text |
| Beige | #F5F5DC |
Backgrounds, borders |
| Dark | #000000 |
Primary text |
- users - User accounts with admin flag
- categories - Product categories
- products - Product catalog with attributes
- product_variations - Product variants (colors, images)
- orders - Customer orders
- order_items - Order line items with size
- ads - Homepage carousel ads
pending β confirmed β shipped β delivered
β cancelled
- Add your email to the
userstable withis_admin = true - Navigate to
/secret-admin-login - Sign in with Google
- Access the admin dashboard at
/admin/dashboard
The app uses custom Cloudinary loaders for automatic optimization:
import ProductImage from '../components/ProductImage';
// Automatically optimizes with f_auto, q_auto, responsive sizing
<ProductImage src={cloudinaryUrl} alt="Product" fill />| Component | Use Case |
|---|---|
ProductImage |
Product detail pages |
ProductThumbnail |
Small thumbnails |
ProductCardImage |
Product grid cards |
BannerImage |
Hero/carousel banners |
AdminThumbnail |
Admin dashboard |
CartItemImage |
Cart items |
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintThis project is private and proprietary.
Bijoy - @Bijoy2406 Afran - @Afran-zero
Made with β€οΈ using Next.js and Supabase