Skip to content

Repository files navigation

🗑️ WasteWise: Smart Waste Management System

WasteWise is a comprehensive solution for urban waste management, featuring a mobile app for citizens and collectors, a web admin dashboard for oversight, and an IoT-ready backend for real-time monitoring.


🏗️ Project Architecture

  • Backend: Node.js, Express, MongoDB, Socket.io (Real-time updates)
  • Mobile: React Native (Expo), Redux Toolkit, Lucide Icons
  • Frontend: React (Vite/Tailwind) - Admin Dashboard

🛠️ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • MongoDB (Local instance or MongoDB Atlas URI)
  • EAS CLI (npm install -g eas-cli) for mobile builds
  • Expo Go (On your mobile device for testing)

📡 Backend Setup

The backend serves both the mobile app and the web dashboard.

  1. Navigate to Folder:
    cd backend
  2. Install Dependencies:
    npm install
  3. Environment Variables: Create a .env file in the backend folder:
    PORT=5000
    MONGO_URI=your_mongodb_atlas_uri
    JWT_SECRET=your_secret_key
    CLIENT_URL=http://localhost:5173
    For the full set of required variables, copy backend/.env.example and fill in your real values.
  4. Run Dev Server:
    npm run dev
  5. Seed Test Data (Important for first-time setup):
    node seed_test_data.js

🔐 Env Setup

Use the same backend keys in both places:

  • Local development: create backend/.env from backend/.env.example
  • Render production: set the same variables in the Render service environment

Required values include MongoDB, JWT, CORS URLs, Cloudinary, and Brevo API:

  • BREVO_API_KEY=<your Brevo API key>
  • BREVO_SENDER_EMAIL=<your verified Brevo sender email>
  • BREVO_SENDER_NAME=WasteWise
  • BREVO_API_TIMEOUT_MS=15000

Do not commit your real .env file to git.


📱 Mobile App Setup

The mobile app handles garbage reporting, reward tracking, and bin discovery.

  1. Navigate to Folder:

    cd mobile
  2. Install Dependencies:

    npm install
  3. Configure API URL: Open src/utils/constants.js and update the BASE_URL with your Local IP Address:

    export const BASE_URL = 'http://192.168.x.x:5000/api';

    Tip: Find your IP by running ipconfig (Windows) or ifconfig (Mac).

  4. Run Development Server:

    npx expo start
  5. Open on Device: Scan the QR code with the Expo Go app.

📦 Building the APK

To create a standalone installable file:

  1. Login to Expo: eas login
  2. Build: eas build -p android --profile production
  3. Download: Download the APK from the link provided after the build finishes.

💻 Web Frontend Setup (Admin/Collector Site)

  1. Navigate to Folder:
    cd frontend
  2. Install Dependencies:
    npm install
  3. Run Dev Server:
    npm run dev

🧪 Common Fixes & Troubleshooting

  • EADDRINUSE (Port 5000 busy): Another process is using the port. Run npx kill-port 5000 to clear it.
  • Network Error in Mobile: Ensure your phone and computer are on the same Wi-Fi. Check that your Windows Firewall isn't blocking port 5000.
  • Camera/Location Crash: Ensure you are using a physical device. Emulators often struggle with camera permissions.
  • Points not showing: Use the seed_test_data.js script in the backend to populate your account with initial data.

📜 Repository Structure

  • /backend: Express API, Mongoose Models, Controllers.
  • /mobile: React Native app source code.
  • /frontend: Admin Dashboard web application.
  • /backend/uploads: Store for reported garbage images.

About

A waste management platform

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages