RecycleIndia - Sustainable Waste Management System

Welcome to Recycle India.

This idea was born because I realized that, till now, there isn’t a unified organization in India that collects recyclable waste directly from households, processes it, and turns it into something useful. That’s how Recycle India came to life.

Technology Stack

  • Frontend: React 18 + TypeScript + TailwindCSS + Vite
  • Backend: Express.js + TypeScript + Node.js
  • Database: MongoDB with Mongoose ODM
  • Authentication: JWT (JSON Web Tokens)
  • File Upload: Multer (for AI weight estimation)
  • Styling: TailwindCSS with custom corporate design
  • Icons: React Icons (Feather Icons)

Key Features

Core Functionality

  • Role-Based Authentication: Separate interfaces for Locals and Authorities
  • Multi-Item Pickup Requests: Residents can request pickup for multiple recyclable items
  • AI Weight Estimation: Upload images to get estimated weights for recyclables
  • Real-Time Collection Management: Authorities can process requests and award points
  • Comprehensive Point System: Users earn points based on actual weight collected

Community Features

  • Community Creation: Users can create public or private recycling communities
  • Member Management: Role-based permissions (admin, moderator, member)
  • Activity Challenges: Organize recycling challenges, events, and goals
  • Real-Time Chat: Community messaging with edit capabilities
  • Collaborative Tracking: Community-wide recycling statistics and leaderboards
  • Activity Participation: Join challenges and track progress together

User Roles & Features

Local Users (Residents)

Dashboard Features:

  • Statistics Overview: Weight recycled, points earned, completion rate
  • Create Requests: Multi-item pickup requests with AI weight estimation
  • Request History: Table showing all pickup requests and status
  • Points Tracking: Total points earned vs. redeemable points
  • Redeem Points: Button to navigate to redemption page

Request Creation:

  • Select multiple item types (Plastic, Cardboard, Newspapers, Clothes, Other)
  • Enter requested weights or use AI estimation
  • Option to redeem points immediately
  • Real-time point calculation preview

Authority Users (Collectors)

Dashboard Features:

  • Search Interface: Find requests by ID
  • Request Details: View user info, items, requested weights
  • Weight Entry: Input actual collected weights
  • Point Calculation: Real-time point calculation based on actual weights
  • Collection Completion: Mark requests as collected and award points

Collection Process:

  1. Search for request using ID
  2. View request details and user information
  3. Enter actual weights for each item
  4. Review calculated points
  5. Complete collection to award points

Community Features

Community Management:

  • Create Communities: Public or private recycling groups
  • Member Roles: Admin, Moderator, Member with different permissions
  • Join Communities: Browse and join existing communities
  • Community Dashboard: Collective recycling statistics and member leaderboards

Activities & Challenges:

  • Create Activities: Recycling challenges, events, and goals
  • Activity Types: Challenges (competitive), Events (collaborative), Goals (targets)
  • Participation Tracking: Join activities and track progress
  • Rewards System: Points and recognition for activity completion

Community Chat:

  • Real-Time Messaging: Chat with community members
  • Message History: Organized by date with timestamps
  • Edit Capabilities: Edit messages after sending
  • User Identification: Clear sender identification and role display

Collaborative Impact:

  • Community Statistics: Total weight recycled, points earned, member count
  • Member Contributions: Individual recycling contributions within communities
  • Leaderboards: Top contributors and most active members
  • Automatic Updates: Community stats update when members complete collections

Authentication & Security

JWT Implementation

  • Token Storage: localStorage in frontend
  • Token Validation: Middleware on protected routes
  • Role-Based Access: Route protection based on user role
  • Secure Headers: Bearer token in Authorization header

API Security

  • Input Validation: Server-side validation for all inputs
  • Role Checking: Authority-only routes for collection management
  • Error Handling: Comprehensive error responses
  • CORS Configuration: Proper cross-origin setup

Database Schema

User Model

{
  name: string,
  email: string (unique),
  password: string (hashed),
  role: 'local' | 'authority',
  points: number (redeemable balance),
  totalWeight: number,
  redemptionHistory: Array<{
    date: Date,
    points: number,
    amount: number
  }>
}

Request Model

{
  user: ObjectId (ref: User),
  itemType: string,
  requestedWeight: number,
  actualWeight: number (optional),
  status: 'Pending' | 'Collected',
  points: number,
  redeemed: boolean,
  createdAt: Date,
  updatedAt: Date
}

Community Model

{
  _id: ObjectId,
  name: string,
  description: string,
  isPrivate: boolean,
  createdBy: ObjectId (User),
  totalMembers: number,
  totalWeight: number,
  totalPoints: number,
  members: [{
    user: ObjectId (User),
    role: 'admin' | 'moderator' | 'member',
    joinedAt: Date,
    contributionWeight: number,
    contributionPoints: number
  }],
  activities: [{
    title: string,
    description: string,
    type: 'challenge' | 'event' | 'goal',
    startDate: Date,
    endDate: Date,
    targetWeight?: number,
    participants: [ObjectId (User)],
    rewards: { points: number, description: string },
    status: 'upcoming' | 'active' | 'completed'
  }],
  chatMessages: [{
    sender: ObjectId (User),
    message: string,
    timestamp: Date,
    edited: boolean
  }],
  createdAt: Date,
  updatedAt: Date
}

🛠️ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login

Requests

  • POST /api/request - Create pickup request
  • GET /api/request/user - Get user's requests
  • GET /api/request/all - Get all requests (Authority only)
  • PUT /api/request/:id/complete - Complete collection (Authority only)

AI Processing

  • POST /api/ai/calculate-weight - AI weight estimation

Communities

  • POST /api/community/create - Create new community
  • GET /api/community - Get all accessible communities
  • GET /api/community/:id - Get community details
  • POST /api/community/:id/join - Join community
  • POST /api/community/:id/activities - Create activity (Admin/Moderator)
  • POST /api/community/:id/activities/:activityId/join - Join activity
  • POST /api/community/:id/messages - Send chat message

🎨 UI/UX Design

Design System

  • Color Palette: Professional slate/gray tones with green accents
  • Typography: Clean, readable fonts with proper hierarchy
  • Icons: Consistent Feather icons throughout
  • Layout: Responsive grid system with proper spacing
  • Components: Reusable, modular design components

Corporate Styling Features

  • Professional Navbar: Company branding with user controls
  • Clean Forms: Icon-enhanced inputs with proper validation
  • Data Tables: Sortable, responsive tables with status indicators
  • Statistics Cards: Clean metric display with icons
  • Modal Dialogs: Proper overlay with scroll support

Contributing

  1. Fork the repository
  2. Create a feature branch(or any name of your wish) (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

API Endpoints

Authentication Routes

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login

Request Management Routes

  • POST /api/request - Create pickup request
  • GET /api/request - Get all requests
  • GET /api/request/:id - Get specific request
  • PUT /api/request/:id - Update request
  • PUT /api/request/:id/complete - Complete collection

AI Processing Routes

  • POST /api/ai/calculate-weight - AI weight estimation

Troubleshooting

Common Issues

  1. MongoDB Connection Error

    • Ensure MongoDB is running
    • Check MONGODB_URI in .env file
    • Verify network connectivity
  2. JWT Token Issues

    • Check JWT_SECRET in .env
    • Verify token in localStorage
    • Ensure middleware is applied correctly
  3. Port Conflicts

    • Backend default: 5000
    • Frontend default: 5173
    • Update ports in package.json if needed
  4. TypeScript Errors

    • Run npm install to ensure all types are installed
    • Check tsconfig.json configuration
    • Verify import paths

Support

For support and questions, please create an issue in the repository .Contributors Welcome.


RecycleIndia - Building a sustainable future through technology 🌱

Share this project:

Updates