A comprehensive e-waste management system that uses QR codes to track the lifecycle of electronic waste items from collection to disposal.
- Dynamic Form Creation: Fill out detailed forms for e-waste items
- Unique Serial Numbers: Automatically generated unique identifiers (EW-XXXXX-XXXXX format)
- Barcode Generation: Creates both QR codes and barcodes for items
- Backend Integration: Saves all item data to MongoDB database
- Printable Labels: Download high-quality PNG labels for printing
- Real-time Scanning: Scan QR codes using device camera
- Item Details Display: View complete item information after scanning
- Status Management: Update item status through the scanning interface
- Backend Sync: All changes are immediately saved to the database
- Status Workflow: waiting for pickup β in transit β processing β done
- RESTful Endpoints: Complete CRUD operations for e-waste items
- Serial Number Lookup: Find items by unique serial numbers
- Status Updates: Update item status by serial number
- MongoDB Integration: Persistent data storage with Mongoose ODM
ewaste-project/
βββ frontend/
β βββ public/
β βββ src/
β βββ components/
β β βββ campaigns/
β β β βββ CampaignCard.jsx
β β β βββ ParticipationModal.jsx
β β βββ common/
β β β βββ Header.jsx
β β β βββ Footer.jsx
β β β βββ Sidebar.jsx
β β β βββ AuthCallback.jsx
β β β βββ ClerkProvider.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ RedirectHandler.jsx
β β βββ dashboard/
β β β βββ RecentActivity.jsx
β β β βββ StatsCard.jsx
β β β βββ WasteChart.jsx
β β βββ inventory/
β β β βββ AddItemModal.jsx
β β β βββ CategoryFilter.jsx
β β β βββ ItemCard.jsx
β β β βββ QRScanModal.jsx
β βββ hooks/
β β βββ useAuth.js
β βββ pages/
β β βββ Analytics.jsx
β β βββ Campaigns.jsx
β β βββ CompliNCe.jsx
β β βββ ContactUs.jsx
β β βββ Dashboard.jsx
β β βββ Home.jsx
β β βββ Inventory.jsx
β β βββ QRGenerator.jsx
β β βββ RoleSelection.jsx
β β βββ SignIn.jsx
β β βββ SignUp.jsx
β βββ services/
β β βββ api.js
β βββ utils/
β β βββ api.js
β βββ App.jsx
β βββ App.css
β βββ index.css
β βββ main.jsx
β βββ .env
β
βββ backend/
β βββ config/
β β βββ db.js
β βββ controllers/
β β βββ donorController.js
β β βββ ewasteController.js
β βββ middleware/
β β βββ auth.js
β βββ models/
β β βββ Company.js
β β βββ Donor.js
β β βββ EWaste.js
β β βββ Vendor.js
β βββ routes/
β β βββ companyRoutes.js
β β βββ donorRoutes.js
β β βββ ewasteRoute.js
β β βββ items.js
β β βββ userRoutes.js
β β βββ vendorRoutes.js
β βββ server.js
β βββ .env
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn
cd backend
npm installCreate a .env file in the backend directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/ewaste_managementStart the backend server:
npm run devcd frontend
npm install
npm run dev- Navigate to
/qr-generator - Fill out the e-waste item form with:
- Item type, brand, model
- Weight and condition
- Pickup address
- Additional notes
- Click "Generate Label"
- Download the generated label as PNG
- Open the QR scanner (available in multiple pages)
- Point camera at the QR code
- View item details
- Update status if needed
Items progress through these statuses:
- waiting for pickup: Initial state when item is reported
- in transit: Item has been collected and is being transported
- processing: Item is being processed/recycled
- done: Item has been completely processed
POST /api/ewastes # Create new e-waste item
GET /api/ewastes # Get all e-waste items
GET /api/ewastes/:id # Get item by ID
GET /api/ewastes/serial/:serial # Get item by serial number
PUT /api/ewastes/:id/status # Update status by ID
PUT /api/ewastes/serial/:serial/status # Update status by serial
POST /api/ewastes
{
"itemType": "Laptop",
"brand": "Dell",
"model": "Latitude 5520",
"weight": "2.5 kg",
"condition": "Working",
"pickupAddress": "123 Tech Street, Bangalore",
"date": "2024-01-15"
}PUT /api/ewastes/serial/EW-ABC123-XYZ/status
{
"status": "in transit"
}{
serial: String, // Unique serial number (required)
donorId: ObjectId, // Reference to donor (required)
itemType: String, // Type of electronic item (required)
brand: String, // Brand name
model: String, // Model number
age: String, // Age of the item
weight: String, // Weight with unit
condition: String, // Current condition
pickupAddress: String, // Pickup location (required)
date: Date, // Collection date (required)
pictureUrl: String, // Image URL
shortNote: String, // Additional notes
status: String, // Current status (enum)
createdAt: Date, // Creation timestamp
updatedAt: Date // Last update timestamp
}Visit /demo to see a complete demonstration of the system:
- Sample e-waste items with different statuses
- Interactive QR scanning
- Workflow explanation
The system includes test QR codes for development:
ewaste-item-001ewaste-item-002ewaste-item-003
Use the manual serial entry feature in the QR scanner to test with custom serial numbers.
- Input Validation: All form inputs are validated
- Error Handling: Comprehensive error handling for API calls
- CORS Configuration: Proper CORS setup for frontend-backend communication
- Database Validation: MongoDB schema validation
- User Authentication: Add login/signup functionality
- Role-based Access: Different permissions for donors, vendors, admins
- Image Upload: Support for item photos
- Analytics Dashboard: Track e-waste processing metrics
- Mobile App: Native mobile application
- Real-time Notifications: Status change alerts
- Bulk Operations: Import/export multiple items
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support or questions, please open an issue in the repository or contact the development team.
Note: This system is designed for educational and demonstration purposes. For production use, additional security measures, error handling, and testing should be implemented.