A modern e-commerce platform for premium Indian ethnic wear, built with React, TypeScript, and Supabase.
- Product Browsing: Browse through premium sherwanis, jodhpuri suits, and indo-western wear
- Dynamic Image Management: Real product images with multiple views per product
- Shopping Cart: Add items to cart with quantity management
- Order Management: Track order status and request cancellations
- Wishlist: Save favorite products for later
- User Authentication: Phone number-based authentication
- Responsive Design: Mobile-first design with modern UI
- Product Management: Add, edit, and delete products with image uploads
- Order Management: Process orders, update statuses, and handle cancellations
- Analytics Dashboard: Real-time sales and order analytics
- Inventory Management: Track product stock and availability
- Real-time Data: Live updates using React Query
- Image Optimization: Dynamic image loading with fallbacks
- Error Handling: Comprehensive error management and recovery
- Type Safety: Full TypeScript implementation
- Modern UI: Built with shadcn/ui and Tailwind CSS
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + shadcn/ui
- State Management: TanStack Query (React Query)
- Backend: Supabase (PostgreSQL + Auth + Storage)
- Routing: React Router DOM
- Icons: Lucide React
- Date Handling: date-fns
-
Clone the repository
git clone <repository-url> cd indian-groom-elegance-main
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:8086(or the port shown in terminal)
The application uses the following Supabase tables:
products- Product information and detailscategories- Product categoriesorders- Customer ordersorder_items- Individual items in orderscustomer_profiles- User profile informationcart_items- Shopping cart itemswishlist_items- User wishlistproduct_images- Product image URLs (Supabase storage)order_status_history- Order status change tracking
To set up the database schema, run the SQL commands in database_migration.sql in your Supabase SQL editor.
- Local Images: Stored in
public/images/products/ - Supabase Storage: Uploaded via admin panel to
product-imagesbucket - Priority System: Supabase images take precedence over local images
- Single Image:
product-name.jpg - Multiple Images:
product-name_1.jpg,product-name_2.jpg, etc. - Fallback:
placeholder.svgfor missing images
The system automatically maps product names to image files:
// Example: Product "Royal Blue Sherwani" maps to:
// - /images/products/Royal Blue Sherwani.jpg
// - /images/products/Royal Blue Sherwani_1.jpg
// - /images/products/Royal Blue Sherwani_2.jpg- Pending β Order placed, awaiting confirmation
- Processing β Order confirmed, being prepared
- Shipped β Order dispatched to customer
- Delivered β Order successfully delivered
- Cancelled β Order cancelled (with refund logic)
- User-Initiated: Customers can request order cancellation
- Admin Review: Admins review and approve/reject requests
- Refund Policy: 90% refund, 10% cancellation fee
- Status Tracking: Full audit trail of status changes
The application implements robust error handling across all components:
- Database Errors: Connection issues, constraint violations
- Network Errors: API failures, timeout issues
- Validation Errors: Form validation, data integrity
- Image Errors: Upload failures, missing images
- Order Errors: Cancellation conflicts, status issues
- Retry Logic: Exponential backoff for failed requests
- Fallback Mechanisms: Placeholder content for missing data
- User Feedback: Clear error messages with actionable steps
- Graceful Degradation: App continues working despite non-critical errors
- Loading States: Show progress during operations
- Error Boundaries: Prevent app crashes from component errors
- Toast Notifications: User-friendly error messages
- Retry Options: Allow users to retry failed operations
// Example: Error handling in queries
const { data, error } = useQuery({
queryKey: ['orders'],
queryFn: async () => {
try {
const { data, error } = await supabase.from('orders').select('*');
if (error) {
const appError = handleSupabaseError(error, 'Fetching orders');
throw appError;
}
return data;
} catch (error) {
logError(error, 'Orders query');
throw error;
}
},
retry: (failureCount, error) => {
if ((error as any)?.statusCode === 401) return false;
return failureCount < 3;
},
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000),
});Navigate to /admin and use admin credentials to access the management panel.
- Product Management: CRUD operations for products
- Order Processing: Update order statuses and handle cancellations
- Analytics: Real-time sales and order statistics
- Image Upload: Bulk image upload to Supabase storage
Built with shadcn/ui components and custom Tailwind CSS classes:
- Color Scheme: Royal navy, gold accents, ivory backgrounds
- Typography: Serif fonts for headings, sans-serif for body text
- Spacing: Consistent 4px grid system
- Shadows: Custom shadow classes for depth
- Mobile-First: Optimized for mobile devices
- Tablet: Adaptive layouts for medium screens
- Desktop: Full-featured desktop experience
src/
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ ... # Custom components
βββ hooks/ # Custom React hooks
βββ pages/ # Page components
βββ utils/ # Utility functions
βββ integrations/ # External service integrations
β βββ supabase/ # Supabase client and types
βββ lib/ # Library configurations
useAuth- Authentication state managementuseCart- Shopping cart functionalityuseProducts- Product data fetchinguseOrders- Order managementuseWishlist- Wishlist functionality
- React Query: Server state management
- React Context: Global app state
- Local State: Component-specific state
npm run buildEnsure all required environment variables are set in production:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Set up Row Level Security (RLS) policies
- Configure storage buckets and policies
- Set up authentication providers
- Configure email templates
- Revenue Tracking: Real-time sales data
- Order Analytics: Order status distribution
- Product Performance: Best-selling products
- Customer Insights: User behavior patterns
- Total revenue and growth
- Order completion rates
- Product popularity
- Customer retention
- Phone number-based authentication
- OTP verification
- Session management
- Role-based access control
- Row Level Security (RLS) policies
- Input validation and sanitization
- Secure API endpoints
- HTTPS enforcement
- Network failures
- Database connection issues
- Invalid user inputs
- Missing data scenarios
- Authentication failures
- Product browsing with various filters
- Cart operations (add, remove, update)
- Order placement and tracking
- Admin panel functionality
- Error handling and recovery
- Responsive design across devices
Detailed documentation for all database tables and their relationships.
Documentation for all custom React hooks and their usage.
Props and usage examples for all custom components.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Check the error handling guide in
ERROR_HANDLING_GUIDE.md - Review the database migration file
- Check the Supabase dashboard for configuration issues
- Initial release with core e-commerce functionality
- Comprehensive error handling system
- Admin panel with analytics
- Mobile-responsive design
- Real-time order management