Skip to content

Chenuli12/Eco-Track-Oct-06-2025-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eco Track - Recycling Support System

A comprehensive recycling management system with:

  • Mobile app for users/recyclers (Flutter)
  • Admin website for recycling companies (React.js)
  • Backend API (Node.js)
  • Database (MongoDB)
  • AI-powered recyclable item recognition

System Architecture

Eco Track
├── backend/              # Node.js + MongoDB backend
├── admin-website/        # React.js admin frontend
├── user-app/             # Flutter user mobile app
└── ai-service/           # AI image recognition service

Features

User App (Recyclers)

  1. User Registration, Authentication & Profile Management
  2. Educational Resources
  3. Recyclable Item Submission (with AI scanning)
  4. Pickup Scheduling & Tracking
  5. Live Location Tracking of Recycling Trucks
  6. Notifications
  7. Payment Processing & Rewards

Admin Website (Recycling Company)

  1. User Management
  2. Recyclable Item Review & Approval
  3. Pickup Scheduling & Route Optimization
  4. Real-time Location Monitoring
  5. Payment Management

Technology Stack

  • Frontend (Web): React.js (HTML, CSS, JavaScript)
  • Frontend (Mobile): Flutter
  • Backend: Node.js
  • Database: MongoDB
  • AI Service: Node.js with TensorFlow.js (mock implementation)

Setup Instructions

Backend Setup

  1. Navigate to the backend directory
  2. Install dependencies: npm install
  3. Start the server: npm start
  4. The backend will be available at http://localhost:5000

Admin Website Setup

  1. Navigate to the admin-website directory
  2. Install dependencies: npm install
  3. Start the development server: npm start
  4. The admin website will be available at http://localhost:3000

User App Setup

  1. Navigate to the user-app directory
  2. Install dependencies: flutter pub get
  3. Run the app: flutter run
  4. The app will run on an emulator or connected device

AI Service Setup

  1. Navigate to the ai-service directory
  2. Install dependencies: npm install
  3. Start the service: npm start
  4. The AI service will be available at http://localhost:5001

Testing Registration

To test the registration functionality:

  1. Make sure the backend server is running
  2. Navigate to the backend directory
  3. Run the registration test: npm run test:registration

This will test admin registration and user registration with different combinations of address and postal code.

Testing API Endpoints

To test the API endpoints directly:

  1. Make sure the backend server is running
  2. Navigate to the backend directory
  3. Run the API test: npm run test:api

This will test the basic API endpoints and help diagnose connectivity issues.

Registration Flow

The registration flow has been optimized to ensure seamless navigation to the home page after successful registration:

  1. User fills in registration details in the mobile app
  2. Upon successful registration, the app:
    • Shows a success message
    • Saves authentication token to device storage
    • Navigates to the home page after a short delay
  3. User can immediately access all features without additional login steps

The system includes robust error handling for network issues and provides clear feedback to users.

API Documentation

The backend API is available at http://localhost:5000/api

Authentication

  • POST /api/auth/register - Register a new user (address is optional, postalCode is required)
  • POST /api/auth/register-admin - Register a new admin (first admin registration is public, subsequent registrations require admin authentication)
  • POST /api/auth/login - Login user
  • GET /api/auth/profile - Get user profile
  • PUT /api/auth/profile - Update user profile

Recyclable Items

  • POST /api/items - Submit a new recyclable item
  • GET /api/items/user - Get user's items
  • GET /api/items - Get all pending items (admin only)
  • PUT /api/items/:id/review - Review an item (admin only)

Pickups

  • GET /api/pickups/user - Get user's pickups
  • GET /api/pickups - Get all pickups (admin only)
  • PUT /api/pickups/:id - Update pickup schedule (admin only)

Payments

  • POST /api/payments - Process a payment
  • GET /api/payments/user - Get user's payment history
  • GET /api/payments - Get all payments (admin only)
  • PUT /api/payments/:id/complete - Complete a payment (admin only)

Educational Resources

  • GET /api/educational - Get all educational resources
  • GET /api/educational/search - Search resources by category
  • GET /api/educational/:id - Get a specific resource
  • POST /api/educational - Create a resource (admin only)
  • PUT /api/educational/:id - Update a resource (admin only)
  • DELETE /api/educational/:id - Delete a resource (admin only)

Notifications

  • GET /api/notifications - Get user's notifications
  • PUT /api/notifications/:id/read - Mark notification as read
  • GET /api/notifications/unread-count - Get unread notifications count

Trucks

  • GET /api/trucks - Get all trucks (admin only)
  • GET /api/trucks/:id - Get a specific truck (admin only)
  • POST /api/trucks - Create a truck (admin only)
  • PUT /api/trucks/:id - Update a truck (admin only)
  • PUT /api/trucks/:id/location - Update truck location (admin only)

AI Service

  • GET /api/ai/health - Check AI service health
  • GET /api/ai/categories - Get supported categories

Communication Flow

  1. User registers/logs in through the mobile app
  2. User submits recyclable items with photos
  3. If AI recognition is enabled, the backend sends the image to the AI service
  4. Admin reviews submitted items through the admin website
  5. Accepted items are automatically scheduled for pickup
  6. Users can track pickup schedules and truck locations
  7. After collection, payments are processed and rewards are awarded
  8. Users receive notifications throughout the process

Database Schema

The system uses MongoDB with the following collections:

  • Users
  • RecyclableItems
  • Pickups
  • Trucks
  • Payments
  • EducationalResources
  • Notifications

Security Considerations

  • All API endpoints (except login/register) require authentication
  • Admin-only endpoints require admin role
  • Passwords are hashed before storage
  • JWT tokens are used for authentication
  • HTTPS should be used in production

Future Enhancements

  • Implement real AI model for image recognition
  • Add route optimization for pickup trucks
  • Implement push notifications
  • Add analytics dashboard for admins
  • Integrate with payment gateways
  • Add social features for users

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors