ScrapSmart Platform

End-to-end digital scrap collection and recycling platform connecting users, drivers, and administrators.

3 Applications 60+ API Endpoints Real-time Tracking 19 Database Tables

Product Requirements Document (PRD)

Comprehensive feature specification for the ScrapSmart scrap collection and recycling platform.

🌱
Product Overview
Vision & Objective

ScrapSmart is a full-stack digital platform that streamlines the process of scrap collection and recycling. It connects households/businesses (users) with scrap collectors (drivers) through a managed marketplace, overseen by platform administrators.

Key Value Propositions:

  • Convenient doorstep scrap pickup scheduling for users
  • Transparent, real-time scrap pricing per kilogram
  • Live tracking of driver arrival and collection progress
  • Verified driver network with KYC documentation
  • Digital payment processing with receipts
  • Centralized admin dashboard for operations management
👥
User Roles & Permissions
Role-based access control (RBAC)
RolePlatformAccess LevelKey Capabilities
User Mobile App (Flutter) Customer Schedule pickups, manage addresses, track drivers, view rates, make payments, rate service
Driver Mobile App (Flutter) Collector Accept/reject pickups, navigate to locations, weigh scrap, capture photos, collect payments, track earnings
Admin Web Dashboard (React) Full access Manage users, drivers, pickups, rates, payments, payouts, reports
Operations Web Dashboard (React) Limited admin User management, driver verification, pickup assignment
Finance Web Dashboard (React) Limited admin Payment processing, rate management, transaction exports
Super Admin Web Dashboard (React) Everything All admin capabilities + admin account management
📱
User Mobile App Features
Flutter — Android & iOS

Authentication & Onboarding

  • OTP-based mobile login (+91)
  • Email-based login option
  • Social login (Google & Apple)
  • App introduction/onboarding screens
  • Auto-login with stored tokens

Pickup Scheduling

  • 3-step pickup creation wizard
  • Multi-category scrap selection (6 types)
  • Weight input with real-time price estimate
  • Photo upload (up to 5 images)
  • 7-day date picker + time slot selection

Address Management

  • Save multiple addresses (Home/Work/Other)
  • Set default address
  • Full CRUD for addresses
  • Geocoded coordinates for each address

Tracking & Notifications

  • Real-time driver location tracking
  • Live pickup status updates (Socket.IO)
  • Push notifications (Firebase)
  • Notification history screen
  • Rate & review completed pickups

Pricing & Payments

  • Live scrap rate cards (per kg)
  • Price estimator tool
  • Payment tracking with receipts
  • Bank account management

Profile & Support

  • Profile photo upload
  • Edit personal details
  • Help & support section
  • Terms & conditions / About us
🚚
Driver Mobile App Features
Flutter — Android & iOS

Registration & Verification

  • Driver onboarding flow
  • KYC document upload (Aadhaar, PAN, License, Selfie)
  • Verification status tracking
  • OTP-based login

Pickup Management

  • Accept or reject pickup requests
  • Nearby pickups discovery
  • Pickup detail view with customer info
  • Online/Offline availability toggle

Collection Workflow

  • Route navigation to pickup location
  • Before/After photo capture
  • Weight verification & recording
  • Payment collection (Cash/UPI/Bank)
  • Collection completion confirmation

Earnings & Profile

  • Real-time earnings dashboard
  • Daily earnings summary
  • Payout history tracking
  • Bank account management
  • Working hours configuration
💻
Admin Dashboard Features
React Web Application

Dashboard & Analytics

  • Total users, active drivers, daily pickups
  • Month-to-date revenue overview
  • Recent pickups feed
  • Report generation (Daily, Performance, Revenue, Acquisition)

User & Driver Management

  • Paginated user listing with search & filters
  • Activate/Deactivate user accounts
  • Driver KYC verification workflow
  • Driver suspension management

Pickup Operations

  • Full pickup lifecycle management
  • Assign drivers to pending pickups
  • Cancel pickups with reason
  • Status-based filtering (9 statuses)

Finance & Rates

  • Scrap rate CRUD (6 categories)
  • Transaction listing & CSV export
  • Driver payout processing
  • Payout history tracking
🔄
Pickup Status Lifecycle
Complete pickup flow from request to completion
Pending Assigned Accepted En Route Arrived In Progress Payment Pending Completed

Alternative paths: Assigned → Rejected (re-assign)  |  Any status → Cancelled (with reason)

Scrap Categories & Pricing
Supported material types with market rates
CategoryIconRate (₹/kg)Min QtyExamples
Paper📄₹12 - ₹141 kgNewspapers, books, office paper
Cardboard📦₹82 kgBoxes, packaging, cartons
Plastic🍺₹10 - ₹151 kgBottles, containers, bags
Metal🔩₹28 - ₹451 kgIron, aluminium, copper, steel
Electronics📱₹20 - ₹251 kgWires, circuit boards, devices
Glass🍻₹2 - ₹52 kgBottles, jars, window glass
🗃
Database Schema (19 Tables)
PostgreSQL relational database
DomainTablesPurpose
Usersusers, user_addresses, user_bank_accountsCustomer accounts, delivery addresses, payment methods
Driversdrivers, driver_documents, driver_earnings, driver_payoutsCollector accounts, KYC verification, earnings & payouts
AdminadminsAdmin accounts with role-based access
Pickupspickups, pickup_categories, pickup_photos, pickup_status_historyPickup requests, item details, photos, audit trail
PaymentspaymentsTransaction records with receipt generation
Ratesscrap_ratesCategory pricing with rate history tracking
Supportsupport_tickets, support_messagesCustomer support with ticket management
NotificationsnotificationsPush notification records with read tracking
Service Areasservice_areasServiceable cities & pincodes
SystemmigrationsDatabase migration tracking
🔗
REST API Endpoints (60+)
Base URL: /api/v1
ModuleEndpointsKey Operations
Authentication8Send/Verify OTP, Admin login, Token refresh, Logout
Users12Profile CRUD, Address CRUD, Pickup history, Payments
Drivers22Profile, Documents, Availability, Pickup ops (10-step flow), Earnings
Pickups6Create, List, Assign, Rates, Time slots
Payments6Details, Receipts, Bank accounts CRUD
Rates4CRUD with rate history
Admin20+Dashboard, User/Driver/Pickup/Rate management, Transactions, Payouts

Work Report & Progress

Development progress, completed milestones, and current project phase.

21
Total Commits
4
Applications Built
60+
API Endpoints
19
Database Tables
🎯
Current Phase: MVP Release
Core features built, stabilized, and packaged for release

The platform has completed its MVP (Minimum Viable Product) phase. All core features across the backend, admin panel, user app, and driver app have been implemented, debugged, and stabilized. A release APK has been built and the admin panel has been compiled for deployment.

📅
Development Timeline
January 16 – January 30, 2026
Phase 1 — Jan 16 – Jan 24
Foundation & Backend API
Project scaffolding, monorepo setup, complete backend API with Express.js, PostgreSQL schema (19 tables), authentication system (JWT + OTP), 60+ REST endpoints, middleware stack, and database migrations.
Phase 2 — Jan 25 – Jan 27
Mobile Applications
Flutter User App (20+ screens) with pickup scheduling, address management, real-time tracking, and price estimator. Flutter Driver App with registration, KYC verification, collection workflow, navigation, and earnings dashboard.
Phase 3 — Jan 28
Admin Panel & Business Logic
React admin dashboard with 8 pages (Dashboard, Users, Drivers, Pickups, Rates, Payments, Reports, Settings). Full CRUD operations, driver verification workflow, payout processing, and WebSocket integration.
Phase 4 — Jan 29
Stabilization & Bug Fixes
9 commits fixing critical issues: Auth flow (OTP, JWT refresh), payment route ordering, SQL fixes, SSL support, Firebase/FCM push notifications, branding assets, image capture/upload, and API response mapping.
Phase 5 — Jan 30 (Current)
Polish, Deployment & Documentation
Android build configuration (desugaring, multiDex, network security), enhanced pickup flow, profile UI improvements, release APK build, admin panel distribution packaging. Added static file serving (express.static) with landing page, project documentation page, and push notification testing tool. Deployed to Render.com with auto-deploy on master push.
Completed Features
All features delivered in MVP

Backend & API

  • Express.js REST API with 60+ endpoints
  • PostgreSQL database with 19 tables
  • JWT + OTP authentication system
  • Role-based access control (6 roles)
  • Socket.IO real-time event system
  • Fast2SMS OTP integration
  • Google Maps geocoding service
  • Multer file upload handling
  • Joi input validation
  • Rate limiting & security headers
  • Receipt generation (text & HTML)
  • Database migrations & seed data
  • Static page serving (landing, docs, notification tester)
  • Upload file serving at /uploads

Mobile Apps (Flutter)

  • User app: 20+ screens with GetX state management
  • Driver app: 15+ screens with collection workflow
  • OTP-based mobile authentication
  • 3-step pickup scheduling wizard
  • Real-time tracking (Socket.IO)
  • Firebase push notifications
  • Camera & gallery image picker
  • Driver KYC document upload
  • Earnings & payout tracking
  • Material Design 3 theming
  • Release APK built & packaged

Admin Panel (React)

  • 8 dashboard pages
  • User & driver management with filters
  • Pickup lifecycle management
  • Scrap rate CRUD with category cards
  • Payment & payout processing
  • Transaction CSV export
  • Protected routes & JWT auth
  • Tailwind CSS responsive UI

Integrations & Infra

  • Fast2SMS (OTP delivery)
  • Google Maps API (geocoding)
  • Firebase Cloud Messaging
  • Socket.IO (real-time events)
  • Render PostgreSQL (production DB)
  • Postman API collection
  • Production migration scripts
  • SSL/TLS support
  • Render.com auto-deploy on push
  • Static web pages served via Express
🚀
Pending / Future Enhancements
Roadmap for post-MVP iterations
FeaturePriorityStatusDetails
Payment Gateway IntegrationHighPlannedRazorpay/Paytm integration for UPI & bank transfers
Revenue Analytics ChartsMediumStubChart.js/Recharts for dashboard analytics
Report GenerationMediumStubPDF export for daily, performance & revenue reports
iOS App Store BuildHighPlannediOS-specific configurations & App Store submission
Automated TestingMediumPlannedUnit tests, integration tests, E2E tests
Multi-language SupportLowPlannedHindi, Telugu, and other regional languages
Redis Cache LayerMediumPlannedOTP storage, rate limiting, session caching
Docker ContainerizationLowPlannedDockerized backend for CI/CD pipeline
📦
Deliverables
Artifacts produced
DeliverableTypeStatusLocation
Backend API ServerNode.js ApplicationDeployedscrapplatform.techlanditsolutions.com
PostgreSQL DatabaseDatabaseDeployedRender (Virginia)
Admin PanelReact Web AppBuiltadmin-panel-react/dist.zip
User App APKAndroid APKBuiltuser-app-release.apk (54.8 MB)
Driver AppFlutter SourceReadydriver-app-flutter/
Postman CollectionAPI DocumentationCompletepostman/ directory
Database MigrationsSQL ScriptsCompletebackend-node/src/migrations/
Project Documentation PageStatic HTMLDeployedscrapplatform.techlanditsolutions.com/project-docs.html
Notification TesterStatic HTMLDeployedscrapplatform.techlanditsolutions.com/push-notification-test.html

Technology Stack & Installation Guide

Complete technical architecture, dependencies, and setup instructions.

🏗
System Architecture
High-level platform architecture

Client Layer

📱 User App
Flutter / Dart
🚚 Driver App
Flutter / Dart
💻 Admin Panel
React / Vite
▽   REST API + WebSocket   ▽

Server Layer

⚙ Node.js + Express.js
REST API Server
⚡ Socket.IO
Real-time Server
▽   TCP / SQL   ▽

Data & Service Layer

🗃 PostgreSQL 15+
Primary Database
💬 Fast2SMS
OTP Service
📍 Google Maps
Geocoding
🔔 Firebase FCM
Push Notifications
🔨
Technology Stack
All technologies used across the platform

Backend

Node.js
v24.x
JavaScript runtime for server-side application. Runs the Express API server.
🚀
Express.js
v5.2.1
Web framework for building REST APIs. Handles routing, middleware, and request processing.
🗃
PostgreSQL
v15+
Relational database with JSONB, arrays, UUID support. Hosted on Render.
🔒
JWT + bcrypt
v9.0.3 / v6.0.0
JSON Web Tokens for stateless auth. bcrypt for password hashing (10 salt rounds).
Socket.IO
v4.8.3
Real-time bidirectional communication. Powers live tracking, status updates, and notifications.
📜
Joi + Multer
v18.0.2 / v2.0.2
Joi for request validation schemas. Multer for multipart file uploads (max 5MB).

Frontend — Admin Panel

React
v19.2.0
Modern UI library with hooks and functional components. Router DOM v7.1.1 for navigation.
Vite
v7.2.4
Next-generation build tool. Fast HMR in development and optimized production builds.
🎨
Tailwind CSS
v4.1.8
Utility-first CSS framework for responsive, modern admin interface styling.

Frontend — Mobile Apps

📱
Flutter
Dart 3.0+
Cross-platform mobile SDK for building Android & iOS apps from a single codebase.
🔄
GetX
v4.6.6
State management, routing, and dependency injection. Reactive programming with Obx.
🔔
Firebase
Core 3.8.1 / FCM 15.1.6
Firebase Cloud Messaging for push notifications. Local notifications for in-app alerts.

External Services

💬
Fast2SMS
API
SMS gateway for OTP delivery via DLT route. Template-based messaging for Indian mobile numbers.
📍
Google Maps
API
Geocoding & reverse geocoding service. Converts addresses to coordinates and vice versa.
Render
Cloud
Cloud hosting for PostgreSQL database (Virginia region) and backend API deployment.
💻
Backend Installation
Node.js API Server Setup

Prerequisites

  • Node.js v18+ (recommended: v24.x)
  • PostgreSQL v15+ (local or cloud)
  • npm v9+ (comes with Node.js)
  • Git for cloning the repository

Step 1: Clone & Install

# Clone the repository $ git clone <repository-url> $ cd scrap-platform/backend-node # Install dependencies $ npm install

Step 2: Environment Configuration

# Create .env file from template $ cp .env.example .env # Edit the .env file with your values: PORT=3001 NODE_ENV=development # PostgreSQL DB_HOST=localhost DB_PORT=5432 DB_NAME=scrapPlatform DB_USER=postgres DB_PASSWORD=your_password_here # JWT Authentication JWT_SECRET=your-super-secret-jwt-key JWT_EXPIRES_IN=7d # SMS (Fast2SMS) SMS_API_KEY=your_fast2sms_api_key # Google Maps GOOGLE_MAPS_API_KEY=your_google_maps_api_key

Step 3: Database Setup

# Create database (if PostgreSQL is local) $ npm run db:create # Run migrations (creates all 19 tables + seed data) $ npm run migrate # Create initial admin account $ npm run setup:admin

Step 4: Start Server

# Development (with hot-reload via nodemon) $ npm run dev # Production $ npm start # Server runs on http://localhost:3001 # Health check: GET /health
🎨
Admin Panel Installation
React + Vite Web Application

Prerequisites

  • Node.js v18+
  • npm v9+

Setup & Run

# Navigate to admin panel directory $ cd scrap-platform/admin-panel-react # Install dependencies $ npm install # Start development server $ npm run dev # Opens at http://localhost:5173 # Build for production $ npm run build # Output: dist/ directory (deploy to any static host)

Default Admin Credentials

Email: admin@scrapplatform.com Password: Admin@123
📱
Flutter Mobile Apps Installation
User App & Driver App

Prerequisites

  • Flutter SDK v3.0+ (stable channel)
  • Dart v3.0+
  • Android Studio with Android SDK (for Android builds)
  • Xcode (for iOS builds, macOS only)
  • Firebase project configured with google-services.json

User App Setup

# Navigate to user app $ cd scrap-platform/user-app-flutter # Install Flutter dependencies $ flutter pub get # Run on connected device/emulator $ flutter run # Build release APK $ flutter build apk --release # Output: build/app/outputs/flutter-apk/app-release.apk

Driver App Setup

# Navigate to driver app $ cd scrap-platform/driver-app-flutter # Install Flutter dependencies $ flutter pub get # Run on connected device/emulator $ flutter run # Build release APK $ flutter build apk --release

Firebase Configuration

# Place Firebase config files: # Android: android/app/google-services.json # iOS: ios/Runner/GoogleService-Info.plist # Ensure Firebase project has: # - Cloud Messaging enabled # - Android app registered with package name # - iOS app registered with bundle ID
🔗
API Configuration
Connecting clients to the backend
EnvironmentBase URLSocket URL
Development http://localhost:3001/api/v1 http://localhost:3001
Production https://scrapplatform.techlanditsolutions.com/api/v1 https://scrapplatform.techlanditsolutions.com

Postman Testing

# Import the Postman collection and environment from: postman/Scrap-Platform-API.postman_collection.json postman/Scrap-Platform-Local.postman_environment.json postman/Scrap-Platform-Production.postman_environment.json
📁
Project Structure
Repository layout overview
scrap-platform/ ├── backend-node/ # Node.js + Express API │ ├── src/ │ │ ├── config/ # DB & app configuration │ │ ├── constants/ # Roles, statuses, enums │ │ ├── controllers/ # Request handlers (7 modules) │ │ ├── middlewares/ # Auth, error, rate limiter │ │ ├── migrations/ # SQL schema & seeds │ │ ├── routes/ # API route definitions │ │ ├── services/ # Business logic (9 services) │ │ ├── validators/ # Joi schemas │ │ └── utils/ # Errors, logger, response │ ├── public/ │ │ ├── index.html # Landing page │ │ ├── project-docs.html # Project docs page │ │ └── push-notification-test.html # Notification tester │ ├── uploads/ # User-uploaded files │ └── package.json ├── admin-panel-react/ # React admin dashboard │ ├── src/ │ │ ├── components/ # Layout, Modal, Sidebar │ │ ├── pages/ # 9 page components │ │ └── services/ # API service layer │ └── package.json ├── user-app-flutter/ # Flutter user mobile app │ ├── lib/ │ │ ├── core/ # API, routes, services, theme │ │ ├── features/ # 11 feature modules │ │ └── shared/ # Reusable widgets │ └── pubspec.yaml ├── driver-app-flutter/ # Flutter driver mobile app │ ├── lib/ │ │ ├── core/ # API, routes, services, theme │ │ ├── features/ # 7 feature modules │ │ └── shared/ # Reusable widgets │ └── pubspec.yaml ├── postman/ # API testing collection ├── user-app-release.apk # Built Android APK └── admin-panel-react.zip # Built admin panel