PyMart is a clean and scalable e-commerce web application built using FastAPI + Jinja2 templates.
It provides a complete shopping flow — from browsing products to placing orders — with a simple and fast UI.
- Browse products with clean UI
- View product details
- Add / remove items from cart
- Dynamic cart updates
- Quantity handling
- Persistent cart flow
- Checkout page
- Place order functionality
- Automatic cart clearing after order
- Order history & detailed view
- Login required for placing orders
- Protected routes
- Redirect system for unauthorized users
| Layer | Technology |
|---|---|
| Backend | FastAPI |
| Frontend | HTML, CSS, Jinja2 |
| Server | Uvicorn |
| Templating | Jinja2 Environment |
| Database | SQLite / PostgreSQL (configurable) |
pymart/ │── app/ │ ├── routers/ │ │ ├── products.py │ │ ├── cart.py │ │ ├── orders.py │ │ └── auth.py │ │ │ ├── templates/ │ │ ├── products.html │ │ ├── cart.html │ │ ├── orders.html │ │ ├── checkout.html │ │ └── order_detail.html │ │ │ └── main.py │ │── static/ │── requirements.txt │── README.md │── pymart_ui.png
git clone https://github.com/your-username/pymart.git
cd pymart
2️⃣ Create Virtual Environment
python -m venv .venv
3️⃣ Activate Environment
# Windows
.venv\Scripts\activate
4️⃣ Install Dependencies
pip install -r requirements.txt
5️⃣ Run Server
uvicorn app.main:app --reload --port 7000
🌐 Run Application
Open in browser:
http://127.0.0.1:7000
🧪 Routes Overview
Route Description
/products View all products
/cart View shopping cart
/orders View all orders
/orders/checkout Checkout page
/orders/place Place order
/orders/{id} Order details
/auth/login User login
🔄 Order Flow
User browses products
Adds items to cart
Goes to checkout
Places order
Cart is cleared automatically
Order appears in order history
⚠️ Important Notes
.venv and __pycache__ should NOT be pushed to GitHub
Authentication required for order routes
Uses Jinja2 Environment for rendering templates
🔥 Future Enhancements
💳 Payment Gateway Integration
📦 Order Status Tracking (Pending / Shipped / Delivered)
📧 Email Notifications
🧠 AI-based Product Recommendations (QuantumX integration)
🌍 Multi-language support
👨💻 Author
Built with ❤️ by Myra
⭐ Support
If you like this project, don’t forget to ⭐ the repo!
---
## ⚡ Important (image ke liye)
👉 Jo image maine diya tha (`pymart_ui.png`)
usse **same folder me README ke saath upload kar dena**
---
Agar bole to mai next level bana deta hu:
👉 badges + live demo + deploy (Render/Vercel) + portfolio ready 🔥