A configurable HTTP stub server for e-commerce API testing
Project description
๐ E-commerce API - Python Server
A configurable HTTP stub server for testing and development, built with Flask.
๐ Project Structure
๐ OJTpython/
โ
โโโ ๐ server.py # Main Python server
โโโ ๐ data.py # Product catalog (60+ products)
โโโ ๐ config.json # API endpoints configuration
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ .gitignore # Git ignore rules
โ
โโโ ๐ scripts/ # Utility scripts
โ โโโ install.bat # Setup script (Windows)
โ โโโ run.bat # Quick start script
โ โโโ test_api.py # Automated testing
โ
โโโ ๐ docs/ # Documentation
โ โโโ START_HERE.md # ๐ Start here!
โ โโโ README_PYTHON.md # Complete guide
โ โโโ QUICK_START_HINDI.md # Hindi setup guide
โ โโโ DEMO_CHECKLIST.md # Demo preparation
โ โโโ POSTMAN_TESTING_GUIDE.md
โ โโโ NODEJS_VS_PYTHON.md
โ โโโ ... (other guides)
โ
โโโ ๐ logs/ # Server logs
โโโ requests.log # API request logs
โก Quick Start
Option 1: Using Scripts (Windows)
# Install dependencies
scripts\install.bat
# Start server
scripts\run.bat
Option 2: Manual
# Install dependencies
pip install -r requirements.txt
# Start server
python server.py
Option 3: Test Everything
python scripts\test_api.py
๐ Server Info
Port: 5600
URL: http://localhost:5600
Status Check:
curl http://localhost:5600
๐ Documentation
- ๐ START_HERE.md - Quick overview
- ๐ README_PYTHON.md - Complete documentation
- ๐ฎ๐ณ QUICK_START_HINDI.md - Hindi guide
- ๐ฏ DEMO_CHECKLIST.md - Demo preparation
- ๐ฎ POSTMAN_TESTING_GUIDE.md - API testing
๐ฏ Features
โ
Authentication - Token-based security
โ
Dynamic Routing - Config-driven endpoints
โ
Template Variables - {{timestamp}}, {{randomId}}, etc.
โ
Request Logging - All API calls logged
โ
60+ Products - Complete e-commerce catalog
โ
15+ Endpoints - Full shopping flow
๐ API Endpoints
Authentication
POST /register- Create accountPOST /login- User login
Products (Auth Required)
GET /categories- All categoriesGET /categories/:id- Category detailsGET /categories/:id/subcategories/:id- Products listGET /categories/:id/subcategories/:id/products/:id- Product details
Shopping (Auth Required)
POST /cart/add- Add to cartGET /cart- View cartPOST /order/place- Place orderGET /orders- Order historyGET /order/:id- Track order
๐งช Testing
Automated Testing
python scripts\test_api.py
Manual Testing (Postman)
๐ Tech Stack
- Python 3.8+
- Flask 3.0.0 - Web framework
- Flask-CORS 4.0.0 - Cross-origin support
- Watchdog 3.0.0 - File monitoring
๐ For Students/Demo
This project is perfect for:
- โ Academic presentations
- โ API development learning
- โ Backend testing
- โ Postman demonstrations
Demo Time: 10-12 minutes
Difficulty: Beginner-friendly
๐ Logs
All API requests are logged to:
logs/requests.log
Each entry includes:
- Timestamp
- HTTP method
- URL path
- Status code
- Response time
๐ค Contributing
This is a learning project. Feel free to:
- Add more endpoints
- Enhance features
- Improve documentation
๐ License
MIT License - Free to use for learning and development
๐ Need Help?
- Check START_HERE.md
- Read QUICK_START_HINDI.md
- Review DEMO_CHECKLIST.md
Made with โค๏ธ for learning Python backend development
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file http_stub_server-1.0.0.tar.gz.
File metadata
- Download URL: http_stub_server-1.0.0.tar.gz
- Upload date:
- Size: 72.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b89cc3f0892e1c37e420ce0774571c87e560a02e8e9108830bd5f372221d98a4
|
|
| MD5 |
f93f3177fbe50fe50fa9e32f7c986555
|
|
| BLAKE2b-256 |
c7005f09d6e4d90f178fd3ddcfa5b2097789b238ad7d8c717986b2b260adeefb
|
File details
Details for the file http_stub_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: http_stub_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ce09194f3583a8b98ba3d9645a194fc369076faf7c5cc06ef1b370b1a67ee3c
|
|
| MD5 |
01c437d42a175b020b69713dc539ecaa
|
|
| BLAKE2b-256 |
da3768aa2ca5f3752528c05ecf1d9cde0d378eccf3a494986f3ec018f3afd6be
|