A complete full-stack e-commerce platform for SJ Jewelry, featuring a React frontend, FastAPI backend, and React admin panel with advanced filtering capabilities.
- Frontend: React + TypeScript + Tailwind CSS + Zustand
- Backend: FastAPI + SQLAlchemy + SQLite + JWT Authentication
- Admin Panel: React + TypeScript + Tailwind CSS + Elegant Jewelry Theme
- Database: SQLite with comprehensive product and user management
chmod +x start.sh
./start.shstart.batcd backend
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.pycd my-app
npm install
npm run devcd adminPanel
npm install
npm run devSJDjwellery/
├── backend/ # FastAPI backend
│ ├── main.py # Main FastAPI application
│ ├── models.py # SQLAlchemy database models
│ ├── schemas.py # Pydantic schemas
│ ├── crud.py # CRUD operations
│ ├── auth.py # JWT authentication
│ ├── database.py # Database configuration
│ ├── config.py # Application settings
│ ├── seed_data.py # Database seeding
│ └── requirements.txt # Python dependencies
├── my-app/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ │ ├── FilterPanel.tsx # Advanced filtering
│ │ │ ├── FilteredProducts.tsx # Filtered product display
│ │ │ ├── MaterialGrid.tsx # Material-based browsing
│ │ │ ├── CategoryGrid.tsx # Category-based browsing
│ │ │ └── Stylegrid.tsx # Style-based browsing
│ │ ├── pages/ # Page components
│ │ ├── store/ # Zustand state management
│ │ └── data/ # API service functions
│ └── package.json
├── adminPanel/ # React admin panel
│ ├── src/
│ │ ├── components/ # Admin components
│ │ │ └── Sidebar.tsx # Elegant sidebar with jewelry theme
│ │ ├── pages/ # Admin pages
│ │ │ ├── Dashboard.tsx # Enhanced dashboard
│ │ │ ├── ProductManagement.tsx # Product CRUD operations
│ │ │ └── Login.tsx # Secure admin login
│ │ └── contexts/ # React contexts
│ └── package.json
├── start.sh # Unix startup script
└── start.bat # Windows startup script
- Authentication: JWT-based user authentication with bcrypt password hashing
- Products: Full CRUD operations for jewelry products with image management
- Advanced Search & Filtering: Multi-parameter product search with real-time filtering
- Admin Management: Role-based access control with admin privileges
- Database: SQLite with SQLAlchemy ORM and automatic migrations
- Product Catalog: Browse products by category, material, style with compact single-screen layout
- Advanced Filtering: Real-time product filtering with multiple criteria
- Search: Real-time product search with instant results
- Shopping Cart: Add/remove items with quantity management
- User Authentication: Login/signup functionality
- Responsive Design: Mobile-first approach with Tailwind CSS
- Product Management: Add, edit, delete products with image upload
- Enhanced Dashboard: Beautiful jewelry-themed dashboard with statistics
- Secure Access: Admin-only authentication with elegant login interface
- Real-time Updates: Immediate product updates with live preview
- Elegant Design: Gold-themed UI with Playfair Display typography
- Backend API: http://localhost:8000
- Frontend: http://localhost:5173
- Admin Panel: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- Email: admin@sjewelry.com
- Password: admin123
- id, email, name, hashed_password, phone, is_admin, created_at, updated_at
- id, name, description, original_price, sale_price, discount, category, material, gemstone, occasion, in_stock, new_arrivals, certified, customizable, specifications, created_at, updated_at
- id, product_id, src, alt, is_primary, created_at
- id, user_id, total_amount, status, created_at, updated_at
- id, order_id, product_id, quantity, price
- id, user_id, product_id, created_at
POST /token- Login and get JWT tokenPOST /register- User registrationGET /me- Get current user info
GET /products- Get all products with filtersGET /products/{id}- Get product by IDGET /products/search- Advanced search with multiple filter parametersGET /products/category/{category}- Get products by categoryGET /products/material/{material}- Get products by material
POST /admin/products- Create new productPUT /admin/products/{id}- Update productDELETE /admin/products/{id}- Delete product
GET /orders- Get user ordersPOST /orders- Create new order
GET /wishlist- Get user wishlistPOST /wishlist/{product_id}- Add to wishlistDELETE /wishlist/{product_id}- Remove from wishlist
- Material: Gold, Silver, Diamond, Natural Diamond, Lab Grown Diamond, Pearl
- Category: Rings, Earrings, Necklaces, Pendants, Bangles/Bracelets, Accessories
- Metal Type: 10k, 14k, 18k, Sterling Silver, Platinum
- Metal Tones: Yellow Gold, White Gold, Rose Gold, Two Tone, Silver
- Diamond Weight: <0.25, 0.25, 0.50, 0.75, 1.00, 1.50, 2.00, >2.00 CT
- Price Range: Under $100, $100-$500, $500-$1000, $1000-$2500, Over $2500
- Real-time filtering without category selection
- Multiple filter combinations
- Active filter display with badges
- Clear filters functionality
- Product count and filter count display
- Responsive filter panel for mobile and desktop
- Log into the admin panel at http://localhost:3002
- Use the enhanced Product Management interface
- Fill in product details including:
- Basic info (name, description, pricing)
- Category and material classification
- Product specifications and features
- Multiple product images with primary image selection
- Products will be immediately available on the frontend with filtering
- Modify components in
my-app/src/components/ - Update pages in
my-app/src/pages/ - Adjust styling using Tailwind CSS classes
- Enhance filtering logic in
FilterPanel.tsxandFilteredProducts.tsx
- Add new models in
backend/models.py - Create corresponding schemas in
backend/schemas.py - Implement CRUD operations in
backend/crud.py - Add API endpoints in
backend/main.py - Enhance search functionality in the search endpoint
- Update the elegant jewelry theme in
adminPanel/src/index.css - Modify admin components in
adminPanel/src/components/ - Enhance admin pages in
adminPanel/src/pages/ - Customize the gold color palette in
adminPanel/tailwind.config.js
- Set up a production database (PostgreSQL recommended)
- Update
DATABASE_URLin environment variables - Set
SECRET_KEYfor JWT tokens - Configure CORS for production domains
- Deploy using uvicorn or gunicorn
- Build the production version:
npm run build - Deploy the
distfolder to your hosting service - Update API base URL in the frontend configuration
- Configure environment variables for production
- Build the production version:
npm run build - Deploy the
distfolder to your hosting service - Update API base URL in the admin panel configuration
- Ensure secure admin access in production
- JWT token-based authentication with secure token handling
- Password hashing with bcrypt and proper salt rounds
- Role-based access control with admin privileges
- Input validation with Pydantic schemas
- CORS configuration for secure cross-origin requests
- SQL injection protection with SQLAlchemy ORM
- Secure admin panel with authentication checks
The platform is fully responsive and optimized for:
- Desktop: Full-featured experience with sidebar filters
- Tablet: Adaptive layout with touch-friendly controls
- Mobile: Mobile-first design with collapsible filter panel
- All modern browsers: Chrome, Firefox, Safari, Edge
- Modern, clean design with jewelry-focused aesthetics
- Compact single-screen layout for efficient browsing
- Intuitive navigation with clear category organization
- Fast loading times with optimized images
- Smooth animations and hover effects
- Accessible design patterns for all users
- Elegant jewelry theme with gold color palette
- Professional typography using Playfair Display
- Beautiful gradients and shadows for depth
- Responsive admin interface
- Intuitive product management workflow
- Real-time updates and feedback
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly on all components
- Ensure responsive design works on all devices
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Check the API documentation at http://localhost:8000/docs
- Review the code comments and documentation
- Test the filter functionality on the frontend
- Verify admin panel access and functionality
- Open an issue on the repository
- Independent filter operation without category selection
- Real-time product filtering with multiple criteria
- Enhanced backend search endpoint with advanced parameters
- Beautiful filter UI with active filter badges
- Responsive filter panel for all devices
- Elegant jewelry-themed design with gold accents
- Enhanced product management with image handling
- Improved dashboard with statistics and quick actions
- Professional typography and visual hierarchy
- Secure authentication with admin privileges
- Compact single-screen layout
- Reduced image sizes for better performance
- Optimized spacing and typography
- Enhanced mobile responsiveness
- Improved loading states and error handling
SJ Jewelry E-commerce Platform - A complete solution for jewelry retail management and online sales with advanced filtering capabilities.