A web application that helps organizations analyze procurement data for environmental sustainability. The app uses AI-powered analysis to evaluate procurement items and provide green scoring recommendations.
- CSV File Upload: Upload procurement data in CSV format
- AI-Powered Analysis: Uses OpenAI API to analyze procurement items
- Green Scoring: Rule-based heuristic scoring for environmental impact
- Firebase Authentication: Secure user authentication with Google
- History Tracking: View previous analysis results
- Real-time Analysis: Get instant feedback on procurement decisions
Green_Tech.-.Made.with.Clipchamp.mp4
- React 19
- Vite
- Firebase Auth
- Axios
- Modern CSS
- Node.js
- Express.js
- Firebase Admin SDK
- OpenAI API
- Multer for file uploads
- CSV Parser
GreenProcurementAdvisor/
βββ client-app/ # React frontend application
β βββ src/
β β βββ App.jsx # Main application component
β β βββ firebase.js # Firebase configuration
β β βββ ...
β βββ package.json
βββ server/ # Node.js backend server
β βββ index.js # Main server file
β βββ .env.example # Environment variables template
β βββ package.json
βββ README.md
- Node.js (v14 or higher)
- npm or yarn
- Firebase project
- OpenAI API key
-
Navigate to the server directory:
cd server -
Install dependencies:
npm install
-
Create a
.envfile with your environment variables:OPENAI_API_KEY=your_openai_api_key_here
-
Add your Firebase service account key as
serviceAccountKey.json -
Start the server:
npm start
-
Navigate to the client-app directory:
cd client-app -
Install dependencies:
npm install
-
Update Firebase configuration in
src/firebase.js -
Start the development server:
npm run dev
- Start both the backend server (port 3001) and frontend development server (port 5173)
- Open your browser and navigate to
http://localhost:5173 - Sign in with Google authentication
- Upload a CSV file with procurement data
- View the analysis results and green scores
- Check your analysis history
Your CSV file should include a column for product names (can be named "product", "Product", "item", or "Item"). The system will analyze these product names for environmental keywords.
Example:
product,quantity,price
Recycled A4 Paper,100,25.00
Disposable Plastic Cups,200,15.00
LED Light Bulbs,50,120.00
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Make sure to set up the following environment variables:
OPENAI_API_KEY: Your OpenAI API key
- Update the Firebase configuration in
client-app/src/firebase.jswith your project details - Add your Firebase service account key as
server/serviceAccountKey.json
- Never commit sensitive files like
.envorserviceAccountKey.json - These files are already included in
.gitignore - Make sure to configure your Firebase security rules appropriately