ποΈ Fashion Mart
A full-stack web application for managing a modern fashion retail store, built with Flask (Python) and MySQL.
π Overview
Fashion Mart Management System is a comprehensive digital platform that automates core retail operations including:
- Product Management - Browse, search, and filter fashion products
- Order Processing - Complete shopping cart and checkout functionality
- Customer Management - Registration, authentication, and profile management
- Inventory Tracking - Real-time stock management
- Review System - Customer reviews and product ratings
β¨ Implemented Features
1. Product View Feature β
- Product Catalog: Browse all available products with images, prices, and details
- Search & Filter: Search by product name and filter by category
- Product Details: View detailed product information including:
- Product name, category, and description
- Price and stock availability
- Customer ratings and reviews
- Embroidery type and special features
- Product Cards: Responsive grid layout with hover effects
- Stock Management: Real-time stock availability display
2. Order Management Feature β
- Shopping Cart:
- Add/remove products
- Update quantities
- Real-time cart total calculation with delivery charge
- Session-based cart storage
- Checkout Process:
- Order summary with item breakdown
- Fixed ΰ§³100 delivery charge
- Multiple payment methods (Cash on Delivery, Online Payment, Bank Transfer)
- Order confirmation with payment status
- Automatic inventory updates
- Order History:
- View all past orders
- Track order and delivery status
- Payment status tracking (for COD orders)
- Detailed order information
- Order Tracking:
- Order status monitoring
- Delivery status updates
- Payment status for Cash on Delivery
- Order details with item breakdown
3. Payment Status Tracking β
- Cash on Delivery Orders:
- Payment status: Pending β Paid
- Delivery man confirms cash receipt
- Two-step completion process (delivery + payment)
- Online Payment/Bank Transfer:
- Auto-completion on delivery
- Single-step completion
- Payment status auto-marked as βPaidβ
4. Delivery Management β
- Delivery Dashboard:
- View assigned orders
- Mark orders as delivered
- Confirm cash received (COD only)
- Real-time status updates
- Smart Status Management:
- Button state changes (Mark as Delivered β β Done)
- Conditional payment confirmation
- Auto-complete for pre-paid orders
5. Delivery Charge System β
- Fixed Delivery Charge: ΰ§³100.00 on all orders
- Transparent Pricing: Shows subtotal, delivery charge, and total
- Cart Display: Delivery charge visible in cart summary
- Checkout Breakdown: Itemized pricing at checkout
- Order Confirmation: Complete price breakdown on confirmation page
π οΈ Technologies Used
- Backend: Python 3.x, Flask 3.0
- Database: MySQL
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Additional Libraries: Flask-MySQLdb, Flask-CORS, python-dotenv
π Project Structure
Fashion mart/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ database/
β βββ schema.sql # Database schema and sample data
β βββ db_config.py # Database configuration
βββ static/
β βββ css/
β β βββ style.css # Main stylesheet
β βββ js/
β βββ main.js # JavaScript utilities
βββ templates/
βββ base.html # Base template
βββ index.html # Homepage
βββ login.html # Login page
βββ register.html # Registration page
βββ products.html # Product catalog
βββ product_detail.html # Product details
βββ cart.html # Shopping cart
βββ checkout.html # Checkout page
βββ orders.html # Order history
βββ order_detail.html # Order details
π Installation & Setup
Prerequisites
- Python 3.8 or higher
- MySQL Server 5.7 or higher
- pip (Python package manager)
Step 1: Clone or Navigate to Project
cd "/home/tahmid/Documents/Fashion mart"
Step 2: Create Virtual Environment
python3 -m venv venv
source venv/bin/activate # On Linux/Mac
# OR
venv\Scripts\activate # On Windows
Step 3: Install Dependencies
pip install -r requirements.txt
Edit .env file with your MySQL credentials:
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASSWORD=your_mysql_password
MYSQL_DB=fashion_mart
MYSQL_PORT=3306
SECRET_KEY=your-secret-key-here
FLASK_ENV=development
Step 5: Setup Database
Option A: Using MySQL Command Line
mysql -u root -p < database/schema.sql
Option B: Using MySQL Workbench or phpMyAdmin
- Open MySQL Workbench/phpMyAdmin
- Import the
database/schema.sql file
- Execute all queries
Option C: Using Python Script
Update the password in database/db_config.py and run:
python database/db_config.py
Step 6: Update Database Credentials in app.py
Edit app.py and update the DB_CONFIG dictionary with your MySQL password:
DB_CONFIG = {
'host': 'localhost',
'user': 'root',
'passwd': 'your_mysql_password', # Update this
'db': 'fashion_mart',
'charset': 'utf8mb4'
}
Step 7: Run the Application
The application will be available at: http://localhost:5000
π Database Schema
Core Tables
Customer
- CustomerID (PK), Username, Password, Name, Email, Number
- RewardPoint, Road, Area, City, District
Product
- ProductID (PK), ProductName, Category, Price, Quantity
- Demand, Rating, Embroidery, Description, ImageURL
Order
- OrderID (PK), OrderDate, TotalAmount, OrderStatus
- PaymentMethod, PaymentStatus, DeliveryAddress
- CustomerID (FK β Customer)
OrderItem
- OrderID (FK β Order), ProductID (FK β Product)
- Quantity, Price
Delivery
- DeliveryID (PK), DeliveryDate, DeliveryStatus
- OrderID (FK β Order)
DeliveryMan
- DeliveryManID (PK), Name, Username, Password
- Number, Area, Rating
Admin
- AdminID (PK), Name, Username, Password
- Email, Number
Review
- ReviewID (PK), CustomerID (FK), ProductID (FK)
- Rating, ReviewDate, Comment
Payment (Structure ready for future implementation)
- PaymentID (PK), PaymentMethod, Amount, PaymentDate
- PaymentStatus, DealerID (FK), OrderID (FK)
Dealer (Structure ready for future implementation)
- DealerID (PK), DealerName, Contact, Email
Ranking (Structure ready for future implementation)
- CustomerID (FK), ProductID (FK), Quantity
π― Usage Guide
For Customers
- Registration
- Click βRegisterβ in navigation
- Fill in username, password, name, email
- Optionally add address details
- Submit to create account
- Login
- Click βLoginβ in navigation
- Enter username and password
- Access personalized features
- Browse Products
- Visit βProductsβ page
- Use search bar to find specific items
- Filter by category using dropdown
- Click on product cards for details
- Add to Cart
- Click βAdd to Cartβ on product cards
- Or select quantity on product detail page
- View cart icon for item count
- Place Order
- Go to Shopping Cart
- Review items and quantities
- Proceed to Checkout
- Confirm order placement
- Track Orders
- Visit βMy Ordersβ page
- View order history and payment status
- Click order for detailed tracking
For Delivery Personnel
- Login
- Visit
/delivery/login
- Use delivery man credentials
- Manage Deliveries
- View assigned orders
- Mark orders as delivered
- Confirm cash received (for COD orders)
For Administrators
- Login
- Visit
/admin/login
- Use admin credentials
- View Dashboard
- Monitor orders and customers
- View sales statistics
- Manage system operations
Default Test Accounts
Sample Customers (Password: password123 for all):
- Username:
john_doe - John Doe
- Username:
jane_smith - Jane Smith
- Username:
guest_user - Guest User
Admin Account:
- Username:
admin
- Password:
admin123
Delivery Man Account:
- Username:
deliveryman1
- Password:
pass123
π Future Enhancements (Not Yet Implemented)
The following features are planned for future development:
- Advanced Payment Features
- Payment gateway integration (bKash, Nagad, Cards)
- Digital payment receipts
- Payment history tracking
- Enhanced Admin Dashboard
- Product management (add, edit, delete with UI)
- Advanced analytics and reports
- Customer management tools
- Inventory alerts and notifications
- Advanced Features
- Product review submission (currently view-only)
- Reward points redemption system
- Email/SMS notifications
- Product recommendations based on purchase history
- Advanced search with multiple filters
- Wishlist functionality
- Order cancellation and returns
- Security Enhancements
- Password hashing (bcrypt/scrypt)
- CSRF protection
- Enhanced input validation
- Rate limiting for API endpoints
- Two-factor authentication
- UI/UX Improvements
- Image upload for products
- Product image gallery
- Enhanced mobile responsiveness
- Dark mode
- Real-time notifications
- Progressive Web App (PWA) support
π Troubleshooting
Database Connection Error
- Verify MySQL server is running
- Check credentials in
.env or app.py
- Ensure
fashion_mart database exists
Import Errors
- Activate virtual environment
- Run
pip install -r requirements.txt
- Check Python version (3.8+)
Port Already in Use
- Change port in
app.py: app.run(port=5001)
- Or kill process using port 5000
MySQLdb Import Error
- Install MySQL development headers:
# Ubuntu/Debian
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
# macOS
brew install mysql
# Then reinstall
pip install mysqlclient
π API Endpoints
Products
GET /products - View all products with filters
GET /product/<id> - View product details
GET /api/products - JSON API for products
Cart
POST /api/cart/add - Add item to cart
GET /api/cart/get - Get cart contents
POST /api/cart/update - Update cart item quantity
POST /api/cart/remove - Remove item from cart
Orders
POST /api/order/create - Create new order
GET /orders - View customer orders
GET /order/<id> - View order details
GET /order/confirmation/<id> - Order confirmation page
Delivery
POST /api/delivery/update-status/<id> - Update delivery status
POST /api/delivery/confirm-payment/<id> - Confirm cash received
GET /delivery/dashboard - Delivery man dashboard
Admin
GET /admin/dashboard - Admin dashboard
GET /admin/orders - Manage all orders
Authentication
POST /register - Customer registration
POST /login - Customer login
POST /delivery/login - Delivery man login
POST /admin/login - Admin login
GET /logout - Logout
π¨βπ» Development
Running in Development Mode
export FLASK_ENV=development # Linux/Mac
set FLASK_ENV=development # Windows
python app.py
Database Reset
To reset database with fresh sample data:
mysql -u root -p < database/schema.sql
π License
This project is developed for educational purposes.
π€ Contributing
This is a learning project. Future features will be implemented based on requirements.
π§ Support
For issues or questions, please refer to the troubleshooting section above.
Built with β€οΈ for Fashion Mart
Last Updated: November 10, 2025
π Additional Documentation
For detailed technical documentation, see:
CODE_TRIGGER_MAP.md - Complete button-to-code mapping guide
FACULTY_CODE_FLOW_GUIDE.md - Code execution flow explanations
PAYMENT_STATUS_FEATURE.md - Payment tracking workflow
PAYMENT_STATUS_FIX.md - Online payment auto-update details