EcoTrack AI is an intelligent AI-powered platform that analyzes your transaction history to calculate your personal carbon footprint and provides actionable insights to reduce your environmental impact. By examining your spending patterns on food, transport, and shopping habits, the platform delivers clear CO2 scores and personalized guidance for sustainable living.
- Automated analysis of transaction data
- Real-time carbon footprint calculation
- Pattern recognition for spending habits
- Easy-to-understand carbon footprint metrics
- Historical tracking and trends
- Comparative analysis with sustainable benchmarks
- Step-by-step emission reduction strategies
- Tailored recommendations based on your lifestyle
- Realistic and achievable carbon reduction targets
- AI-powered suggestions for eco-friendly options
- Cost-effective green alternatives
- Impact assessment for recommended changes
- Conversational interface powered by Google Gemini AI
- Real-time chat support for carbon footprint queries
- Contextual advice based on your transaction history
EcoTrack-AI/
├── backend/ # Express.js API server
│ ├── src/
│ │ ├── index.ts # Main server file
│ │ ├── llmUtils.ts # Google Gemini AI integration
│ │ ├── prompt.ts # AI prompt engineering
│ │ └── data.ts # Transaction data processing
│ ├── Dockerfile # Docker configuration
│ └── package.json
│
├── frontend/ # Next.js React application
│ ├── app/
│ │ ├── chat/ # Chat interface
│ │ └── page.tsx # Main landing page
│ ├── components/
│ │ ├── ui/ # Reusable UI components
│ │ ├── NeuralNetwork.tsx # Animated background
│ │ ├── ChatMessage.tsx # Chat components
│ │ └── ...
│ └── package.json
│
└── .github/
└── workflows/ # CI/CD pipelines
- Node.js (v18 or higher)
- npm or pnpm
- Google Gemini AI API Key
- Docker (optional, for containerized deployment)
git clone https://github.com/Ayush272002/EcoTrack-AI
cd EcoTrack-AIcd backend
# Install dependencies
npm install
# Create environment file
touch .env
# Add your Google Gemini API key to .env
echo "GEMNI_API_KEY=your_gemini_api_key_here" > .env
# Build TypeScript
npm run build
# Start the server
npm startThe backend will be running on http://localhost:8000
cd ../frontend
# Install dependencies
pnpm install
# Start development server
pnpm run devThe frontend will be available at http://localhost:3000
Create a .env file in the backend directory:
GEMNI_API_KEY=your_google_gemini_api_key
PORT=8000For the frontend, create a .env.local file:
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000cd backend
docker build -t ecotrack-ai-backend .
docker run -p 8000:8000 -e GEMNI_API_KEY=your_api_key ecotrack-ai-backendThe project includes automated Docker builds via GitHub Actions:
docker pull ghcr.io/ayush272002/ecotrack-ai-backend:latest
docker run -p 8000:8000 -e GEMNI_API_KEY=your_api_key ghcr.io/ayush272002/ecotrack-ai-backend:latestGenerate AI-powered carbon footprint analysis and recommendations.
Request Body:
{
"prompt": "I spent £100 on petrol this month. How can I reduce my carbon footprint?"
}Response:
{
"ans": "Based on your petrol spending of £100, your carbon footprint is approximately 0.4 tonnes of CO2. Consider carpooling, using public transport, or switching to a more fuel-efficient vehicle to reduce emissions by up to 30%."
}- Animated neural network visualization
- Real-time particle system
- Responsive design with Framer Motion
- Real-time messaging with AI
- Typing indicators and animations
- Message categorization (analysis, suggestions, text)
- Mobile-first approach
- Tailwind CSS for styling
- Dark/light mode support
The platform leverages Google Gemini AI for:
- Transaction Analysis: Smart categorization of spending patterns
- Carbon Calculation: Accurate CO2 footprint estimation
- Personalized Recommendations: Tailored advice based on user data
- Natural Language Processing: Conversational interface for user queries
The AI system uses sophisticated prompt engineering to:
- Maintain context awareness
- Provide accurate calculations
- Ensure relevant responses
- Follow corporate communication guidelines
- Data Protection: Transaction data is processed securely
- API Security: CORS enabled for secure cross-origin requests
- Environment Variables: Sensitive data stored in environment variables
- No Data Storage: Conversations are not permanently stored
Backend:
- Node.js + Express.js
- TypeScript
- Google Gemini AI
- Docker
Frontend:
- Next.js 15
- React 19
- TypeScript
- Tailwind CSS
- Framer Motion
- Radix UI
- TypeScript for type safety
- ESLint for code linting
- Automated CI/CD with GitHub Actions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
User: "I spent £150 on Uber rides this month"
AI: "Your ride-sharing expenses of £150 generated approximately 0.3 tonnes of CO2. Consider combining trips, using public transport for longer journeys, or switching to electric vehicle rides to reduce your footprint by 40%."
User: "My grocery bill was £300 and I ordered takeaway 10 times"
AI: "Based on your spending pattern, focus on local, seasonal produce to reduce food-related emissions. Consider meal planning to minimize takeaway orders, which could cut your food carbon footprint by 25%."
- AI-powered carbon footprint analysis
- Real-time chat interface
- Transaction-based recommendations
- Responsive web application
This project is licensed under the ISC License. See the LICENSE file for details.
- Google Gemini AI for powering our intelligent analysis
- Next.js Team for the amazing React framework
- Tailwind CSS for the utility-first CSS framework
- Framer Motion for smooth animations