A complete Flipkart-like e-commerce application built with Python and Streamlit, featuring product browsing, shopping cart, user authentication, order management, and an admin dashboard.
- Product Browsing: Browse products by category with search and filter options
- Advanced Search: Search products by title and description
- Sorting Options: Sort by Featured, Price (Low/High), and Customer Rating
- Product Details: View detailed product information with images
- Shopping Cart: Add/remove items, adjust quantities
- User Authentication: Login and registration system
- Order Placement: Complete checkout process with multiple payment options
- Order Tracking: View order history and status
- Product Reviews: Read and write customer reviews
- Analytics Dashboard: View business metrics and KPIs
- Revenue Analytics: Revenue by category and trend analysis
- Order Management: View and manage all orders, update status
- Product Management: Add, edit, and delete products
- Image Upload: Support for local image uploads and URL images
- Inventory Management: Track stock levels
- Python 3.8 or higher
- pip (Python package manager)
-
Clone or download the project
cd Apna_Bazaar -
Install dependencies
pip install -r requirements.txt
-
Initialize the database The database will be automatically initialized when you run the application for the first time.
-
Start the Streamlit app
streamlit run app.py
-
Open your browser Navigate to
http://localhost:8501
- Username:
admin - Password:
admin123 - Email:
admin@apnabazaar.com
- Username:
priya - Password:
customer123 - Email:
priya@gmail.com
Apna_Bazaar/
βββ app.py # Main customer-facing application
βββ admin.py # Admin dashboard
βββ database.py # Database operations and initialization
βββ styles.py # Custom CSS styling
βββ requirements.txt # Python dependencies
βββ apna_bazaar.db # SQLite database (auto-created)
βββ images/ # Directory for uploaded product images
βββ README.md # This file
The application uses SQLite with the following tables:
- users: User accounts with authentication
- products: Product catalog with images and details
- reviews: Customer product reviews
- orders: Customer orders
- order_items: Individual items in each order
- Add products with title, description, price, category, and images
- Upload local images or provide image URLs
- Edit product details
- Delete products
- Manage stock levels
- Category-based browsing
- Real-time search
- Price range filtering
- Multiple sorting options
- Responsive product grid
- Add to cart functionality
- Quantity adjustment
- Address and phone number validation
- Multiple payment methods (UPI, Credit Card, Debit Card, Net Banking, COD)
- Order confirmation
- Automatic stock deduction
- Total revenue tracking
- Order count and status distribution
- Product count
- Customer count
- Revenue by category charts
- Revenue trend over time
- Order status pie chart
Edit the category dropdown in app.py and admin.py to add new product categories.
Custom CSS is defined in styles.py. Modify the get_custom_css() function to change colors, fonts, and layouts.
Database settings are in database.py. The default SQLite database file is apna_bazaar.db.
The application supports two image sources:
- Local Upload: Images are saved to the
images/directory - URL: Direct image URLs (e.g., from Unsplash)
Default placeholder images are used if no image is provided.
- Passwords are hashed using SHA-256
- Session management uses Streamlit's session state
- Admin-only pages are protected
- Input validation on forms
If you encounter database errors, delete apna_bazaar.db and restart the application to reinitialize.
Ensure the images/ directory exists and has write permissions.
If port 8501 is in use, specify a different port:
streamlit run app.py --server.port 8502- streamlit: Web application framework
- pandas: Data manipulation
- plotly: Interactive charts
- pillow: Image processing
- Email notifications for orders
- Wishlist functionality
- Product comparison
- Advanced search filters
- Payment gateway integration
- Multi-language support
- Mobile app version
This project is open source and available for educational purposes.
Created as a complete e-commerce solution demonstrating Python and Streamlit capabilities.
- Streamlit team for the amazing framework
- Unsplash for placeholder images
- Flipkart for design inspiration
Happy Shopping! ποΈ