Green Cart is a full-stack web application that allows users to search for products, analyze their carbon footprint and eco-friendliness, and manage a shopping cart. The backend uses Flask and Google Gemini API for analysis, while the frontend is built with React and Vite.
- Product Search: Search for products (Amazon, etc.) and view details.
- Carbon Footprint Analysis: Get AI-powered sustainability and carbon footprint analysis for each product.
- Cart Management: Add products to a cart for easy management.
- Modern UI: Responsive React frontend with Bootstrap styling.
- Frontend: https://green-cart-pearl.vercel.app
- Backend API: https://green-cart-backend-cofn.onrender.com
- Node.js (v18+ recommended)
- Python 3.9+
- pip (Python package manager)
- (Optional) A virtual environment tool like venv
git clone <your-repo-url>
cd <repo-folder>- Set up environment variables if needed (e.g., for API keys).
- Edit
main.pyto add your Google Gemini API key if not already present. - Run the backend locally:
cd server
pip install -r requirements.txt
python main.pyThe backend will run on http://localhost:8080 by default.
cd carbon
npm install
npm run devThe frontend will run on http://localhost:5173 by default.
- The frontend expects the backend API URL to be set in the code (see
API_BASE_URLinmain.jsx,index.jsx, andanalysis.jsx). Update this if running locally or deploying elsewhere. - CORS is configured in the backend to allow requests from your deployed frontend and localhost.
- Frontend: Deploy the
carbonfolder to Vercel (or your preferred static hosting). - Backend: Deploy the
serverfolder to Render.com (or your preferred Python hosting). - Make sure to update CORS origins in
main.pyto match your deployed frontend URLs.
- Open the frontend in your browser.
- Search for a product.
- View product details and click "Analyse Product" for a carbon footprint report.
- Add products to your cart as desired.
- If you see CORS errors, ensure your backend CORS settings include your frontend’s deployed URL.
- If API calls fail, check that both frontend and backend are running and accessible.
MIT (or your chosen license)
- Frontend: https://green-cart-pearl.vercel.app
- Backend: https://green-cart-backend-cofn.onrender.com







