A modern, full-featured e-commerce platform built with Next.js 16, TypeScript, and Prisma. Fà dè Essence specializes in luxury perfumes, offering a premium shopping experience with comprehensive admin management capabilities.
Fà dè Essence is a complete e-commerce solution featuring:
- Customer-facing storefront with product browsing, cart management, and checkout
- Admin dashboard for product, order, and inventory management
- User authentication with NextAuth.js v5
- Payment integration with Paystack
- Email notifications via Resend
- Inventory management with low stock alerts
- Order tracking and status management
- Newsletter campaigns with rich text editor
- SEO optimization with dynamic sitemaps and metadata
- Product Catalog: Browse luxury perfumes
- Product Search: Real-time search across products
- Product Filtering: Filter by category, brand, price, and tags (New, Bestseller, Limited)
- Product Details: Comprehensive product pages with galleries, specifications, and reviews
- Related Products: Smart product recommendations
- Brand Collections: Dedicated pages for each brand
- Featured Collections: Curated collections (Featured, New Arrivals, Bestsellers, Limited Edition)
- Shopping Cart: Persistent cart using Zustand with localStorage
- Cart Management: Add, update quantities, remove items with stock validation
- Coupon Codes: Apply discount codes (e.g., FADE10 for 10% off)
- Checkout Flow: Multi-step checkout with shipping and payment
- Address Management: Save and manage shipping addresses
- Delivery Options: Multiple delivery methods
- Payment Integration: Secure payment processing via Paystack
- User Registration: Sign up with email and password
- User Authentication: Secure login with NextAuth.js
- Account Dashboard: View order history, wishlist, and addresses
- Order Tracking: Track order status (Pending β Paid β Shipped β Delivered)
- Order Reviews: Review and rate purchased products
- Wishlist: Save favorite products for later
- Profile Settings: Update name, email, and notification preferences
- Address Book: Manage multiple shipping addresses
- Product Reviews: Read and write product reviews with ratings
- Newsletter Subscription: Subscribe to marketing emails
- Help Center: FAQ, contact, shipping info, and returns policy
- Social Media Integration: Links to Instagram, X (Twitter), WhatsApp, TikTok, and Facebook
- Responsive Design: Fully responsive across all devices
- Dark Mode: Theme toggle for light/dark mode
- Product CRUD: Create, read, update, and delete products
- Bulk Operations: Manage multiple products efficiently
- Image Upload: Upload up to 4 product images with client-side compression
- Product Categories: Organize products by category (Perfumes)
- Product Tags: Mark products as New, Bestseller, Limited, or Featured
- Brand Management: Add and manage product brands
- Collections: Group products into collections
- Product Search: Search products by name or brand
- Soft Deletion: Products with orders are soft-deleted to preserve order history
- Order Dashboard: View all orders with filtering and search
- Order Details: Comprehensive order information with customer details
- Order Status Updates: Update order status (Pending β Paid β Shipped β Delivered)
- Order Notifications: Automatic notifications when orders are paid
- Order Export: Export orders to CSV
- Payment Verification: Verify Paystack payments and update order status
- Stock Tracking: Track product stock levels
- Low Stock Alerts: Automatic alerts for products with stock β€ 10 units
- Stock Validation: Prevent adding out-of-stock items to cart
- Inventory Dashboard: Centralized view of all inventory status
- Category CRUD: Create, edit, and delete product categories
- Auto-Slug Generation: Automatic URL-friendly slug generation
- Category Linking: Link categories to product types
- Collection Management: Create and manage product collections
- Campaign Creation: Create newsletter campaigns with rich text editor
- HTML Editor: WYSIWYG editor with image upload support
- Campaign Management: Edit, duplicate, delete, and send campaigns
- Subscriber Management: View, search, and manage newsletter subscribers
- Subscriber Stats: Track subscriber count and growth
- Admin Notifications: Real-time notifications for new orders
- Notification Center: View and manage all admin notifications
- Unread Badge: Visual indicator for unread notifications
- Unified Search: Search across products, orders, and customers
- Debounced Search: Optimized search with debouncing
- Search Results: Grouped results by type with quick links
- Dashboard Stats: Overview of products, orders, and revenue
- Product Statistics: Total products, active products, low stock items
- Order Analytics: Order status breakdown and trends
- Authentication: Secure user authentication with NextAuth.js
- Route Protection: Protected admin and account routes
- Input Validation: Zod schema validation for all forms
- XSS Prevention: Input sanitization
- Rate Limiting: API rate limiting to prevent abuse
- CSRF Protection: Built-in Next.js CSRF protection
- Secure Cookies: HTTP-only cookies for sensitive data
- Password Hashing: bcrypt password hashing
- Order Confirmations: Automatic email receipts after payment
- Order Status Updates: Email notifications for order status changes
- Newsletter Campaigns: Send marketing emails to subscribers
- Email Templates: Beautiful HTML email templates
- Resend Integration: Professional email delivery via Resend
- Dynamic Sitemap: Auto-generated sitemap.xml
- Robots.txt: Search engine optimization
- Meta Tags: Comprehensive Open Graph and Twitter Card support
- Structured Data: Ready for JSON-LD structured data
- Image Optimization: Next.js Image optimization
- Code Splitting: Automatic code splitting for optimal performance
- Analytics: Vercel Analytics integration
- Next.js 16: React framework with App Router
- React 19: UI library
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Zustand: Lightweight state management
- React Icons: Icon library (Font Awesome 6)
- Sonner: Toast notifications
- React Hook Form: Form management
- Zod: Schema validation
- Next.js API Routes: Serverless API endpoints
- Next.js Server Actions: Server-side form handling
- Prisma: Type-safe database ORM
- PostgreSQL: Relational database via Prisma
- NextAuth.js v5: Authentication and session management
- bcryptjs: Password hashing
- Paystack: Payment processing
- Resend: Email delivery service
- Vercel Analytics: Web analytics
- ESLint: Code linting
- TypeScript: Static type checking
- Prisma Studio: Database GUI
9thluxe-store-starter/
βββ app/ # Next.js App Router pages
β βββ (routes)/ # Public routes
β β βββ page.tsx # Homepage
β β βββ shop/ # Shop page
β β βββ product/[slug]/ # Product detail pages
β β βββ collections/ # Collections pages
β β βββ category/[slug]/ # Category pages
β β βββ cart/ # Shopping cart
β β βββ checkout/ # Checkout flow
β β βββ about/ # About page
β β βββ help/ # Help center
β βββ account/ # User account pages
β β βββ page.tsx # Account overview
β β βββ orders/ # Order history
β β βββ addresses/ # Address management
β β βββ wishlist/ # Wishlist
β β βββ settings/ # Account settings
β βββ admin/ # Admin dashboard
β β βββ page.tsx # Admin dashboard
β β βββ products/ # Product management
β β βββ orders/ # Order management
β β βββ categories/ # Category management
β β βββ collections/ # Collection management
β β βββ inventory/ # Inventory management
β β βββ newsletter/ # Newsletter management
β βββ auth/ # Authentication pages
β β βββ signin/ # Sign in
β β βββ signup/ # Sign up
β β βββ signout/ # Sign out
β βββ api/ # API routes
β βββ auth/ # NextAuth routes
β βββ admin/ # Admin API endpoints
β βββ cart/ # Cart API
β βββ checkout/ # Checkout API
β βββ paystack/ # Paystack webhook
β βββ newsletter/ # Newsletter API
β βββ contact/ # Contact form API
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ admin/ # Admin-specific components
β βββ cart/ # Cart components
β βββ checkout/ # Checkout components
β βββ product/ # Product components
β βββ collections/ # Collection components
β βββ layout/ # Layout components
β βββ auth/ # Auth components
βββ lib/ # Utility libraries
β βββ stores/ # Zustand stores
β βββ services/ # Business logic services
β βββ middleware/ # Middleware functions
β βββ auth.ts # NextAuth configuration
β βββ prisma.ts # Prisma client
β βββ utils.ts # Utility functions
βββ emails/ # Email templates
β βββ sendReceipt.ts # Order receipt email
β βββ sendOrderStatusUpdate.ts # Order status email
βββ prisma/ # Database
β βββ schema.prisma # Prisma schema
β βββ migrations/ # Database migrations
βββ public/ # Static assets
- Node.js 18+ and npm
- Git for version control
- PostgreSQL database (local or hosted)
-
Clone the repository
git clone <repository-url> cd 9thluxe-store-starter
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:# Database DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DB?pgbouncer=true&connection_limit=1" # NextAuth NEXTAUTH_SECRET="your-secret-key-here" NEXTAUTH_URL="http://localhost:3000" # Paystack (for payments) PAYSTACK_PUBLIC_KEY="your-paystack-public-key" PAYSTACK_SECRET_KEY="your-paystack-secret-key" # Resend (for emails) RESEND_API_KEY="your-resend-api-key" NEWSLETTER_FROM_EMAIL="noreply@yourdomain.com" # Site Configuration NEXT_PUBLIC_SITE_URL="http://localhost:3000"
-
Set up the database
npx prisma generate npx prisma migrate dev
-
Create an admin user You can create an admin user directly in the database or through Prisma Studio:
npx prisma studio
- Navigate to the
Usermodel - Create a new user with
role: "ADMIN" - Set a password hash (use bcrypt to hash your password)
- Navigate to the
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
Postgres connection string | postgresql://... |
NEXTAUTH_SECRET |
NextAuth secret key | Generate with openssl rand -base64 32 |
NEXTAUTH_URL |
Base URL of your application | http://localhost:3000 |
| Variable | Description | Example |
|---|---|---|
PAYSTACK_PUBLIC_KEY |
Paystack public key | pk_test_... |
PAYSTACK_SECRET_KEY |
Paystack secret key | sk_test_... |
RESEND_API_KEY |
Resend API key | re_... |
NEWSLETTER_FROM_EMAIL |
Email sender address | noreply@yourdomain.com |
NEXT_PUBLIC_SITE_URL |
Public site URL | https://yourdomain.com |
- User: User accounts (customers and admins)
- Product: Product catalog with images, pricing, and inventory
- Category: Product categories
- Collection: Product collections
- Order: Customer orders
- OrderItem: Order line items
- Coupon: Discount coupons
- Review: Product reviews and ratings
- Wishlist: User wishlists
- Address: User shipping addresses
- NewsletterSubscriber: Newsletter subscribers
- NewsletterCampaign: Newsletter campaigns
- Notification: Admin notifications
- Soft Deletion: Products are soft-deleted (not permanently removed) when they have associated orders
- Audit Trails: Created/updated timestamps on all models
- Relationships: Proper foreign key relationships between models
GET /api/products- List productsGET /api/search?q=query- Search productsPOST /api/newsletter/subscribe- Subscribe to newsletterPOST /api/contact- Submit contact form
GET /api/account/settings- Get user settingsPATCH /api/account/settings- Update user settingsGET /api/cart/summary- Get cart summary
GET /api/admin/products- List products (admin)POST /api/admin/products- Create productGET /api/admin/products/[id]- Get productPATCH /api/admin/products/[id]- Update productDELETE /api/admin/products/[id]- Delete productGET /api/admin/orders- List ordersGET /api/admin/search?q=query- Global searchGET /api/admin/notifications- Get notificationsPATCH /api/admin/notifications- Mark notifications as readGET /api/admin/newsletter/campaigns- List campaignsPOST /api/admin/newsletter/campaigns- Create campaignGET /api/admin/newsletter/subscribers- List subscribers
POST /api/paystack/initialize- Initialize Paystack paymentPOST /api/paystack/webhook- Paystack webhook handler
The project uses a comprehensive set of reusable UI components built with Radix UI:
- Button: Various button styles and sizes
- Input: Text inputs with validation
- Select: Dropdown selects
- Card: Content cards
- Dialog: Modal dialogs
- Popover: Popover menus
- Dropdown Menu: Context menus
- Tabs: Tab navigation
- Accordion: Collapsible content
- Badge: Status badges
- Toast: Notification toasts
- Skeleton: Loading skeletons
- Avatar: User avatars
- Table: Data tables
- User registration and login
- Product browsing and search
- Add to cart and checkout flow
- Payment processing (test mode)
- Order status updates
- Admin product management
- Admin order management
- Newsletter subscription
- Email notifications
- Mobile responsiveness
-
Push to GitHub
git push origin main
-
Import to Vercel
- Go to vercel.com
- Import your GitHub repository
- Framework preset: Next.js (auto-detected)
- Deploy
-
Configure environment variables (Project β Settings β Environment Variables)
DATABASE_URL(Postgres) Γ’β¬β requiredNEXTAUTH_SECRETΓ’β¬β requiredNEXTAUTH_URLΓ’β¬β required (set to your Vercel domain, e.g.https://your-app.vercel.app)ADMIN_EMAILSΓ’β¬β recommended (comma-separated admin emails, e.g.fadeessencee@gmail.com)APP_URLorNEXT_PUBLIC_SITE_URLΓ’β¬β recommended (used for sitemap links)PAYSTACK_PUBLIC_KEY,PAYSTACK_SECRET_KEYΓ’β¬β required for paymentsRESEND_API_KEYΓ’β¬β required for email
-
Database Setup
- Create a Postgres database (Vercel Postgres, Neon, Supabase, etc.)
- Apply migrations:
npx prisma migrate deploy
-
Post-deploy production checks
- Open
https://<your-domain>/api/health - Confirm response has
"ok": true - If status is
503, checkmissingCriticaland update Vercel environment variables - Add this URL to an uptime monitor (UptimeRobot, Better Stack, or similar)
- Open
The application can be deployed to any platform supporting Next.js:
- Netlify: Use Next.js plugin
- Railway: Automatic deployment
- AWS: Use Amplify or EC2
- DigitalOcean: App Platform
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
npx prisma generate- Generate Prisma Clientnpx prisma db push- Push schema changesnpx prisma studio- Open Prisma Studionpx prisma migrate dev- Create migrationnpx prisma migrate deploy- Apply migrations (prod)
- TypeScript: Strict mode enabled
- ESLint: Configured for Next.js
- Prettier: Code formatting (if configured)
-
Prisma Client not found
npx prisma generate
-
Database connection errors
- Verify
DATABASE_URLis set (must bepostgresql://...) - Run
npx prisma migrate deploy(prod) ornpx prisma migrate dev(dev)
- Verify
-
Build errors
- Clear
.nextfolder - Run
npm run buildagain
- Clear
-
Authentication issues
- Check
NEXTAUTH_SECRETis set - Verify
NEXTAUTH_URLmatches your domain
- Check
This project is proprietary software. All rights reserved.
For support, contact:
- Email: fadeessencee@gmail.com
- Phone: +234 8160591348
- Business Hours: Monday - Saturday, 8:00 AM - 8:00 PM
- Next.js team for the amazing framework
- Vercel for hosting and analytics
- Radix UI for accessible components
- Prisma for the excellent ORM
- Paystack for payment processing
- Resend for email delivery
Built with β€οΈ for FΓ dΓ¨ Essence