This is a full-stack grocery store web application built using Flask, MySQL, HTML, CSS, and JavaScript. It allows users to browse products, add items to their cart, and place orders seamlessly.
- 🛍️ View products with pricing and unit details
- 🛒 Add items to the cart and manage quantity
- ✅ Place orders, storing them in the database
- 📊 Backend API with proper CORS handling for smooth frontend communication
- 🚀 Deployed using Render (backend) and Netlify (frontend)
server.py→ Flask server handling requests and database operationssql_connector.py→ Connects to the MySQL databaseproducts_dao.py→ Handles product queries from the databaseorders_dao.py→ Manages order-related database transactionsrequirements.txt→ Dependencies for running Flask and MySQL connection
index.html→ Landing page for the storeshop.html→ Displays products and order functionalityscript.js→ Handles API requests and UI updates
- Python 3.x
- Flask (pip install flask flask-cors)
- MySQL Server (Railway-hosted)
mysql-connector-python(pip install mysql-connector-python)- Netlify (for frontend deployment)
- Backend: Render → https://grocers-store.onrender.com
- Frontend: Netlify → https://grocerstore.netlify.app
- Uptime Monitoring: UptimeRobot pings the backend every 5 minutes to keep it active.
1️⃣ Ensure MySQL is running with correct database schema
2️⃣ Open terminal, navigate to backend folder (cd backend/)
3️⃣ Install dependencies:
pip install -r requirements.txt4️⃣ Run Flask server:
python server.py5️⃣ Backend should be available at http://127.0.0.1:5000/
1️⃣ Navigate to ui folder (cd ui/)
2️⃣ Use a simple local server to preview:
npx serve . # OR python -m http.server