EcoWise AI is an intelligent sustainability coach that helps users track, improve, and gamify their daily habits to reduce their carbon footprint. The application leverages Google's Gemini API for natural language understanding and personalized eco-friendly recommendations.
- Interactive AI Coach: Chat with an AI assistant that provides personalized sustainability advice based on your habits and preferences
- Habit Tracking: Log your daily activities related to transport, diet, energy, waste management, and more
- Carbon Footprint Analysis: Get estimates of your carbon footprint and sustainable alternatives
- Gamification: Earn green points and badges as you adopt more eco-friendly habits
- Personalized Recommendations: Receive tailored suggestions based on your lifestyle and preferences
- Progress Dashboard: View your sustainability score and improvements over time
- Frontend: React with TypeScript, Vite
- Backend: Node.js with Express
- Database: MongoDB Atlas for cloud data storage
- AI: Google Gemini API for natural language processing and generative content
- Authentication: JWT for secure user authentication
- Node.js (v14+)
- MongoDB Atlas account
- Google Gemini API key
- Clone the repository:
git clone https://github.com/yourusername/ecowise-ai.git
cd ecowise-ai
- Install backend dependencies:
cd backend
npm install
- Create a
.envfile in the backend directory with the following variables:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
GEMINI_API_KEY=your_gemini_api_key
NODE_ENV=development
- Install frontend dependencies:
cd ../frontend
npm install
- Start the backend server:
cd ../backend
npm run dev
- Start the frontend development server:
cd ../frontend
npm run dev
The frontend will be available at http://localhost:4200 and the backend at http://localhost:8081 (or the port specified in your backend .env file).
wastezero-app/
├── backend/
│ ├── src/
│ │ ├── config/
│ │ ├── controllers/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── utils/
│ │ └── server.js
│ ├── package.json
│ └── .env
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── contexts/
│ │ ├── services/
│ │ ├── types/
│ │ ├── config/
│ │ └── App.tsx
│ ├── package.json
│ └── vite.config.ts
└── README.md
-
User Endpoints:
POST /api/users/register: Register a new userPOST /api/users/login: Login userGET /api/users/:id: Get user profilePUT /api/users/:id: Update user profileGET /api/users/:id/stats: Get user sustainability stats
-
Habits Endpoints:
GET /api/habits: Get all habits for a userPOST /api/habits: Create a new habitPUT /api/habits/:id: Update a habitDELETE /api/habits/:id: Delete a habitPOST /api/habits/:id/complete: Mark a habit as completed
-
AI Endpoints:
POST /api/ai/chat: Chat with the AI assistantPOST /api/ai/analyze-habits: Get habit analysisPOST /api/ai/suggestions: Get personalized sustainability suggestionsPOST /api/ai/calculate-footprint: Calculate carbon footprint
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini API for powerful language processing
- MongoDB Atlas for cloud database services