Skip to content

AstralKS/EcoTracker

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EcoTracker - Environmental Impact Monitoring Platform

EcoTracker is a comprehensive environmental monitoring and sustainability platform that helps users track their carbon footprint, energy consumption, water usage, and waste management. The application combines data visualization with AI-powered assistance to promote eco-friendly practices.

๐Ÿ‘ฅ Contributors

๐ŸŒŸ Features

๐Ÿ  Dashboard

  • Real-time environmental metrics tracking
  • Weekly energy usage visualization
  • Active sustainability challenges
  • EcoPoints reward system

โšก Energy Tracking

  • Electrical Energy Management: Monitor home appliances and devices
  • Vehicle Energy Tracking: Track transportation energy consumption
  • Device efficiency monitoring with optimization suggestions
  • Energy-saving tips and recommendations

๐Ÿ† Leaderboard & Competitions

  • Community leaderboard with EcoPoints ranking
  • Weekly energy efficiency competitions
  • Achievement tracking and badges
  • Historical performance analysis

๐ŸŽฏ Challenges & Goals

  • Active sustainability challenges
  • Progress tracking with visual indicators
  • Reward system for completed goals
  • Community events and announcements

๐Ÿค– AI Assistant

  • Integrated AI chatbot for eco-friendly advice
  • Personalized energy-saving recommendations
  • Real-time Q&A about sustainability practices
  • Connected to n8n workflow automation

๐Ÿ“Š Data Dashboard & Visualization

  • Interactive charts and graphs using Recharts
  • Carbon footprint tracking over time
  • Renewable energy usage breakdown
  • Water conservation progress
  • Waste management analytics
  • Device efficiency comparisons
  • Vehicle energy consumption analysis

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 19 with TypeScript
  • Vite for build tooling
  • Tailwind CSS for styling
  • Recharts for data visualization
  • Radix UI for accessible components
  • Lucide React for icons

Backend

  • Node.js with Express
  • CORS for cross-origin requests
  • n8n integration for AI workflows
  • Dotenv for environment management

Development Tools

  • ESLint for code linting
  • TypeScript for type safety
  • PostCSS for CSS processing
  • Vite for fast development

๐Ÿ“ Project Structure

EcoTracker/
โ”œโ”€โ”€ Backend/
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ server.js
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ””โ”€โ”€ vite.svg
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ui/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ card.tsx
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ chart.tsx
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ select.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ utils.ts
โ”‚   โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ App.css
โ”‚   โ”‚   โ”œโ”€โ”€ EcoCharts.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SimpleCharts.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ index.css
โ”‚   โ”‚   โ”œโ”€โ”€ main.tsx
โ”‚   โ”‚   โ””โ”€โ”€ vite-env.d.ts
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ vite.config.ts
โ”‚   โ”œโ”€โ”€ tsconfig.json
โ”‚   โ”œโ”€โ”€ tailwind.config.js
โ”‚   โ””โ”€โ”€ components.json
โ””โ”€โ”€ README.md

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone <repository-url>
    cd EcoTracker
  2. Install Backend Dependencies

    cd Backend
    npm install
  3. Install Frontend Dependencies

    cd ../frontend
    npm install

Environment Setup

  1. Backend Configuration

    Create a .env file in the Backend directory:

    PORT=5000
    NODE_ENV=development
    # Add any additional environment variables here
  2. Frontend Configuration

    The frontend uses Vite's default configuration. No additional environment setup required.

Running the Application

  1. Start the Backend Server

    cd Backend
    node server.js

    Server will run on http://localhost:5000

  2. Start the Frontend Development Server

    cd frontend
    npm run dev

    Frontend will run on http://localhost:5173

Building for Production

  1. Build Frontend

    cd frontend
    npm run build
  2. Preview Production Build

    npm run preview

๐Ÿ”ง Available Scripts

Frontend Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run lint - Run ESLint
  • npm run preview - Preview production build

Backend Scripts

  • node server.js - Start production server
  • npm test - Run tests (not implemented)

๐ŸŒ API Endpoints

Chat Endpoint

  • POST /api/chat
    • Description: Send messages to AI assistant
    • Request body: { "message": "your message here" }
    • Response: { "reply": "AI response" }

๐ŸŽจ UI Components

The application uses a custom design system built with:

  • shadcn/ui components for consistency
  • Tailwind CSS for styling
  • Radix UI for accessibility
  • Custom animations and transitions
  • Dark theme optimized for environmental awareness

๐Ÿ“Š Key Features Breakdown

Energy Tracking

  • Home Devices: LED lights, HVAC, water heating, electronics, appliances
  • Vehicles: Electric cars, gasoline vehicles, airplanes
  • Efficiency Monitoring: Real-time efficiency ratings and consumption data

Environmental Metrics

  • Carbon Footprint: Monthly CO2 emissions tracking
  • Renewable Energy: Solar, wind, and hydro energy consumption
  • Water Conservation: Usage vs. savings tracking
  • Waste Management: Recycling, composting, and landfill percentages

Gamification

  • EcoPoints System: Reward sustainable behaviors
  • Weekly Challenges: Energy reduction goals
  • Community Competitions: Leaderboards and rankings
  • Achievement Badges: Recognition for milestones

๐Ÿ”— Integrations

n8n Workflow

The AI chat feature integrates with n8n for advanced workflow automation:

  • Webhook endpoint: https://temp23.app.n8n.cloud/webhook-test/device-assistant
  • Handles natural language processing for environmental advice
  • Provides personalized recommendations based on user data

๐Ÿš€ Deployment

Frontend Deployment

The frontend can be deployed to:

  • Vercel (recommended for Vite projects)
  • Netlify
  • GitHub Pages
  • Any static hosting service

Backend Deployment

The backend can be deployed to:

  • Heroku
  • Railway
  • DigitalOcean
  • AWS EC2
  • Any Node.js hosting service

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the ISC License - see the LICENSE file for details.

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation for common solutions

๐Ÿ”ฎ Future Enhancements

  • Mobile application development
  • IoT device integrations
  • Advanced AI recommendations
  • Social features and community challenges
  • Real-time data from smart home devices
  • Carbon offset marketplace integration
  • Detailed reporting and analytics
  • Multi-language support

๐Ÿ™ Acknowledgments

  • React community for excellent tooling
  • Recharts for beautiful data visualization
  • Tailwind CSS for rapid UI development
  • n8n for workflow automation capabilities
  • Open source contributors and environmental advocates

EcoTracker - Making sustainability tracking simple, engaging, and effective. Together, we can make a difference for our planet! ๐ŸŒ๐Ÿ’š

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 92.5%
  • CSS 5.1%
  • JavaScript 2.0%
  • HTML 0.4%