Skip to content

IoT computer vision SaaS platform with real-time AI analysis. TypeScript, React, Express, PostgreSQL, Roboflow. Waste management reference implementation.

Notifications You must be signed in to change notification settings

dpmorr/visionpipe

Repository files navigation

VisionPipe

A full-stack IoT computer vision pipeline with edge-to-cloud image processing, AI analysis, and multi-tenant SaaS architecture. Built with TypeScript, React, Express, and PostgreSQL.

Reference Implementation: Waste management and sustainability tracking with IoT device integration, AI-powered waste classification via Roboflow, and real-time analytics dashboards.

Architecture: The modular design separating device management, image processing, and data visualization makes this adaptable for various computer vision applications including agricultural monitoring, retail inventory, manufacturing quality control, or any scenario requiring edge-to-cloud image analysis.

πŸš€ Key Features

  • IoT Device Management - Connect and manage camera-enabled edge devices
  • Real-Time Computer Vision - Automated image classification via Roboflow
  • Analytics Dashboards - Visualize detection results and trends
  • Multi-Tenant Architecture - Organization-level data isolation and user management
  • Subscription Billing - Stripe integration for tiered pricing (Basic, Pro, Enterprise)
  • RESTful API - Complete API for third-party integrations
  • Webhook Support - Zapier integration for workflow automation

πŸ—οΈ Technical Architecture & Data Flow

IoT β†’ Computer Vision β†’ Analytics Pipeline

The platform implements a data pipeline from IoT devices through computer vision processing to real-time analytics. While built for waste management, the architecture separates concerns (device management, image processing, data storage, visualization) making it adaptable for other computer vision applications.

Platform Flexibility

Hardware Agnostic Works with various camera-enabled devices including ESP32, Raspberry Pi, industrial cameras, and smartphones. The REST API accepts images from any source that can make HTTP requests.

IoT Provider Flexibility Currently uses AWS IoT Core, but the MQTT-based architecture can work with Azure IoT Hub, Google Cloud IoT, or self-hosted MQTT brokers with minimal changes.

Computer Vision Integration Roboflow is used for waste classification, but the image processing pipeline accepts results from any CV service (TensorFlow, PyTorch models, OpenCV, cloud APIs). The roboflow_result JSON field stores arbitrary detection results.

Multi-Tenant Architecture Organization-level data isolation supports SaaS deployment. Each organization has separate data, users, devices, and billing.

Offline Capabilities IoT device shadows allow edge processing when internet connectivity is intermittent. Devices can queue data locally and sync when reconnected.

Data Flow Overview

The application processes data through the following pipeline:

IoT Device (Camera/Sensor)
    ↓
[1] Image Capture & Device Authentication
    ↓
[2] AWS IoT Core (MQTT/WebSocket)
    ↓
[3] Image Processing API
    ↓
[4] Roboflow Computer Vision Model
    ↓
[5] Database Storage (PostgreSQL)
    ↓
[6] Real-time Dashboard & Analytics

Step-by-Step Data Flow:

1. Device Setup & Authentication

  • Physical IoT devices (ESP32/Raspberry Pi with cameras) are provisioned with unique deviceId and deviceToken
  • Devices connect to the platform using access code authentication
  • Each device is associated with a specific waste point location and organization

2. AWS IoT Core Integration

  • Devices establish MQTT/WebSocket connections to AWS IoT Core
  • Secure bi-directional communication for commands and telemetry
  • Device shadow state management for offline capabilities
  • Topics structure: wastetraq/{organizationId}/devices/{deviceId}/data

3. Image Capture & Transmission

  • Devices capture images at configurable intervals or on-demand triggers
  • Images are uploaded to the platform API via POST /api/device-images
  • Metadata includes: timestamp, device ID, GPS coordinates, battery level
  • Adaptable to any imaging scenario: product inspection, crop monitoring, security surveillance, etc.

4. Computer Vision Analysis

  • Images are sent to Roboflow for waste classification
  • The waste detection model identifies:
    • Item types: Paper, Plastic, Cardboard, Metal, Glass, Organic waste
    • Confidence scores for each detection
    • Item counts and bounding boxes
    • Fill level estimation (0-100%)
  • Results stored in roboflow_result JSON field
  • The CV integration is modularβ€”could be replaced with other models (TensorFlow, PyTorch, OpenCV) for different classification needs

5. Data Processing & Storage Detection results are stored in PostgreSQL with the following structure:

- items_detected: JSON array with detected waste items
- fill_level: percentage (0-100) calculated from image analysis
- distance_to_top: ultrasonic sensor reading (optional)
- temperature & humidity: environmental sensor data (optional)
- battery_level: device health metric
- image_url: reference to captured image
- processing_time: AI inference duration in ms
- confidence: detection confidence score

6. Analytics & Visualization

  • Data flows to React dashboards via REST API (/api/devices/:id/data)
  • Dashboard displays:
    • Time-series charts showing fill level trends
    • Waste composition breakdown by material type
    • Collection schedule recommendations
    • Environmental conditions over time
    • Device health and battery status
  • Alert system triggers notifications based on configurable thresholds

7. Network Architecture

IoT Devices (Edge) ← Any camera-enabled hardware
    ↓ HTTPS/MQTT ← Secure, encrypted transmission
AWS IoT Core (Cloud) ← Swappable with Azure/Google/MQTT brokers
    ↓ REST API ← Standard HTTP/JSON interface
Express Server (Backend) ← Business logic layer
    ↓ SQL Queries ← Drizzle ORM (supports any PostgreSQL DB)
PostgreSQL (Neon Database) ← Serverless, auto-scaling
    ↓ HTTP/WebSocket ← Real-time updates
React Dashboard (Frontend) ← Responsive, multi-tenant UI

Architecture Capabilities

Scalability

  • Serverless PostgreSQL database (Neon) with automatic scaling
  • MQTT pub/sub pattern for device communication
  • Stateless Express backend supports horizontal scaling
  • Static asset optimization via Vite

Security

  • Token-based device authentication (deviceId + deviceToken)
  • Multi-tenant data isolation at organization level
  • TLS/SSL encrypted transmission
  • Session-based user authentication with Passport.js
  • Role-based access control for users and vendors

Development Features

  • TypeScript across frontend and backend
  • Drizzle ORM with type-safe queries and migrations
  • OpenAPI/Swagger documentation generation
  • Vite hot module replacement for development
  • Structured error handling and logging

SaaS Features

  • Multi-organization support with data isolation
  • Stripe integration for subscription billing (Basic, Pro, Enterprise tiers)
  • User invitation and team management system
  • API token generation for third-party access
  • Zapier webhook support for automation

Adapting the Platform

The separation of device management, image processing, and analytics layers allows the platform to be adapted for other computer vision use cases:

For Agricultural Monitoring:

  • Replace waste classification model with crop disease detection
  • Update database schema to track field locations and plant health scores
  • Modify dashboards to display field maps and crop metrics
  • Deploy cameras in agricultural fields

For Retail Inventory:

  • Train computer vision model on product SKUs
  • Track stock counts instead of fill levels
  • Update UI for inventory management workflows
  • Deploy cameras on store shelves

For Manufacturing QA:

  • Use defect detection models
  • Track defect types and counts
  • Build dashboards for quality metrics
  • Deploy cameras on production lines

The core architecture (device authentication, image upload, CV processing, data storage, visualization) remains largely unchanged.

Required Setup for Full IoT Integration

To get the complete IoT pipeline running, you'll need:

AWS IoT Configuration

  1. AWS Account with IoT Core enabled
  2. IoT Thing provisioned for each device
  3. IoT Policy with permissions for:
    • iot:Connect
    • iot:Publish to wastetraq/+/devices/+/data
    • iot:Subscribe to wastetraq/+/devices/+/commands
  4. X.509 Certificates for device authentication
  5. Environment variables:
    AWS_IOT_ENDPOINT=your-endpoint.iot.region.amazonaws.com
    AWS_ACCESS_KEY_ID=your_access_key
    AWS_SECRET_ACCESS_KEY=your_secret_key
    AWS_REGION=us-east-1
    

Roboflow Configuration

  1. Roboflow Account and API key
  2. Trained Model for waste classification
  3. Environment variable:
    ROBOFLOW_API_KEY=your_roboflow_api_key
    ROBOFLOW_MODEL_ID=waste-classifier/version
    

Physical Device Requirements

  • Microcontroller: ESP32-CAM or Raspberry Pi with camera module
  • Sensors:
    • Camera (minimum 2MP for accurate classification)
    • Ultrasonic distance sensor (HC-SR04 or similar)
    • Optional: DHT22 temperature/humidity sensor
  • Power: Battery pack or wall adapter (5V/2A minimum)
  • Network: WiFi connectivity (2.4GHz)
  • Firmware: Arduino/Python code to capture images and post to API

Device Firmware Flow

1. Connect to WiFi
2. Authenticate with platform (POST /api/devices/auth)
3. Capture image from camera
4. Read sensor readings (optional)
5. POST to /api/device-images with multipart form data
6. Receive AI analysis results
7. Update device shadow in AWS IoT
8. Sleep until next capture interval

🎯 Computer Vision & Real-Time Infrastructure

Current Implementation (Waste Management)

This platform is currently configured for waste classification but is designed as a general-purpose computer vision SaaS platform. The same architecture works for:

  • Agriculture: Crop disease detection, pest identification, yield estimation
  • Manufacturing: Quality control, defect detection, assembly verification
  • Retail: Inventory monitoring, shelf compliance, product recognition
  • Healthcare: Medical imaging analysis, equipment monitoring
  • Security: Object detection, anomaly detection, occupancy monitoring

Waste Classification Model (Reference Implementation):

  • Model Type: Object Detection (YOLOv8)
  • Training Dataset: 5,000+ labeled waste images
  • Categories: Recyclables, Organics, Contaminants (customizable for any domain)
  • Inference Speed: 30-50ms on edge devices, 10-20ms on Raspberry Pi 4

Roboflow Integration:

  • Pre-trained models available on Roboflow Universe
  • Swap models by changing API endpoint and class labels
  • Train custom models for your specific use case

Real-Time Processing Architecture

Current Simple Implementation:

  1. Device uploads image β†’ Express API
  2. Server forwards to Roboflow β†’ Returns results
  3. Store in PostgreSQL β†’ Push via WebSocket
  4. Total Latency: 5-12 seconds

Production-Grade Real-Time Architecture:

For high-throughput, low-latency deployments with thousands of devices:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ IoT Devices β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Upload images
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Amazon S3      β”‚  ← Image storage (versioned, lifecycle policies)
β”‚  (or MinIO)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Trigger event
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Apache Kafka   β”‚  ← Message queue for async processing
β”‚  (or RabbitMQ)  β”‚     - Topic: image-uploaded
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     - Partitioned by organization_id
         β”‚              - Retries + dead letter queue
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Worker Pool    β”‚  ← Horizontal scaling (10-100 workers)
β”‚  (Kubernetes)   β”‚     - Pull from Kafka
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     - Call Roboflow API
         β”‚              - Cache results in Redis
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  PostgreSQL     β”‚  ← Store structured results
β”‚  + Redis Cache  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  WebSocket/SSE  β”‚  ← Push to dashboards (Socket.io)
β”‚  Server         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why Kafka for Real-Time:

  • Decouples: Image upload from processing (devices don't wait)
  • Scales: Process 10,000+ images/min with worker pool
  • Resilient: Failed jobs retry automatically
  • Ordered: Maintains sequence per device
  • Backpressure: Handles traffic spikes

S3 for Image Storage:

  • Scalable: Unlimited storage
  • Cheap: $0.023/GB/month
  • Event-driven: Trigger Lambda/Kafka on upload
  • Lifecycle: Auto-delete old images after 30/90 days
  • CDN: CloudFront for fast image delivery to dashboards

Alternative Stack (Self-Hosted):

  • MinIO instead of S3 (S3-compatible, run on your servers)
  • RabbitMQ instead of Kafka (simpler setup, lower throughput)
  • Redis Pub/Sub for small deployments (< 100 devices)

Manual Real-Time Setup (Without Managed Services):

// 1. Device uploads to S3-compatible storage
const uploadImage = async (image) => {
  const s3 = new AWS.S3();
  await s3.putObject({
    Bucket: 'device-images',
    Key: `${deviceId}/${timestamp}.jpg`,
    Body: image,
  });
};

// 2. S3 event triggers Kafka message
s3.on('ObjectCreated', async (event) => {
  const producer = kafka.producer();
  await producer.send({
    topic: 'image-processing',
    messages: [{
      key: event.organizationId,
      value: JSON.stringify({
        imageUrl: event.s3.object.key,
        deviceId: event.metadata.deviceId,
        timestamp: event.timestamp,
      }),
    }],
  });
});

// 3. Worker consumes from Kafka
const consumer = kafka.consumer({ groupId: 'cv-workers' });
await consumer.subscribe({ topic: 'image-processing' });

await consumer.run({
  eachMessage: async ({ message }) => {
    const { imageUrl, deviceId } = JSON.parse(message.value);

    // Download image from S3
    const image = await s3.getObject({ Key: imageUrl });

    // Send to Roboflow
    const result = await roboflow.detect(image);

    // Store in database
    await db.insert({ deviceId, result, timestamp: new Date() });

    // Push to WebSocket
    io.to(`device-${deviceId}`).emit('detection', result);
  },
});

Latency Improvements:

  • Simple (current): 5-12 seconds
  • With S3 + async: 2-5 seconds (device doesn't wait for processing)
  • With Kafka + workers: 1-3 seconds (parallel processing)
  • With edge inference: < 1 second (process on device, no cloud API)

System Capacity & Scalability

Current Implementation Handles:

  • Devices: Up to 1,000 concurrent IoT devices per server instance
  • API Requests: 100 requests/second with Neon serverless PostgreSQL
  • Image Processing: 50-100 images/minute (limited by Roboflow API tier)
  • Data Storage: Unlimited (serverless PostgreSQL auto-scales)

Scaling Recommendations:

  • 10-100 devices: Single server instance sufficient
  • 100-1,000 devices: Add load balancer, horizontal scaling (2-3 instances)
  • 1,000-10,000 devices: Implement message queue (RabbitMQ/SQS), CDN for images
  • 10,000+ devices: Microservices architecture, dedicated image processing cluster

Accuracy & Model Performance

Model Accuracy Metrics:

  • Overall Precision: 87-92% (varies by waste type)
  • Recall: 85-90%
  • mAP@0.5: 0.89 (mean Average Precision at 50% IoU threshold)

Improving Accuracy:

  1. Increase Training Data:

    • Add 2,000+ images β†’ Expected 3-5% accuracy improvement
    • Include edge cases (dirty containers, damaged items, low light)
    • Use data augmentation (rotation, brightness, contrast)
  2. Fine-tune Model:

    • Start with Roboflow's pre-trained model
    • Add organization-specific waste types
    • Retrain with real-world data from deployed cameras
  3. Environmental Factors:

    • Proper lighting: Add LED strips (5000-6500K daylight)
    • Camera positioning: 60-90cm above waste surface, 45Β° angle
    • Regular lens cleaning: Weekly maintenance schedule
  4. Confidence Thresholding:

    • Default: 0.5 (50% confidence)
    • High accuracy mode: 0.7 (70% confidence) - fewer false positives
    • High recall mode: 0.3 (30% confidence) - catch more items, more false positives

Hardware Recommendations

Production-Ready IoT Devices

Option 1: ESP32-CAM (Budget: ~$10/device)

  • Pros: Low cost, WiFi built-in, low power consumption
  • Cons: Limited processing power, 2MP camera
  • Best for: Pilot deployments, indoor bins, non-critical monitoring
  • Battery Life: 6-12 hours on 3000mAh battery (30-min intervals)

Option 2: Raspberry Pi Zero 2 W + Camera Module ($40-50/device)

  • Pros: Better processing, 8MP camera option, runs Python/Node.js
  • Cons: Higher power consumption, more expensive
  • Best for: Outdoor deployments, higher accuracy requirements
  • Battery Life: 4-8 hours on 5000mAh battery (30-min intervals)

Option 3: Raspberry Pi 4 + HQ Camera Module ($120-150/device)

  • Pros: Can run CV models locally (TensorFlow Lite), 12MP camera
  • Cons: Requires wall power or large battery
  • Best for: Edge processing, low-latency requirements, offline capability
  • Features: Local inference (no cloud API needed), real-time video processing

Camera Specifications

Minimum Requirements:

  • Resolution: 2MP (1920x1080) for basic detection
  • Recommended: 5MP+ (2592x1944) for accurate classification
  • Frame Rate: 1 FPS sufficient (static images)
  • Lens: Fixed focus, 70-110Β° field of view
  • Low Light: IR filter removable (for night/dark bin monitoring)

Optimal Setup:

  • Resolution: 8MP (3280x2464)
  • Sensor: Sony IMX219 or better
  • Lighting: Automatic exposure, white balance
  • Focus: Auto-focus for varying bin heights

Mobile Device Integration

Using Smartphones as IoT Devices:

Option A: Progressive Web App (PWA)

  • Users access web interface
  • Use native camera API to capture images
  • Submit via browser (no app install needed)
  • Privacy: Images processed server-side, not stored on device
  • Best for: Manual spot-checks, vendor verification

Option B: Dedicated Mobile App (Future Enhancement)

  • React Native/Flutter app
  • Background image capture (requires permissions)
  • Offline queuing when no connection
  • Privacy Considerations:
    • Request camera permission only
    • Clear user consent for image upload
    • No access to photos/gallery
    • Option to blur/anonymize faces (OpenCV pre-processing)

BYOD (Bring Your Own Device) Recommendations:

  • OS: Android 8.0+ or iOS 13+ for camera API support
  • Storage: 2GB+ free space for image queue
  • Network: WiFi or 4G/5G (3G not recommended - slow uploads)
  • Privacy: Implement device-level encryption (TLS/SSL)
  • Battery: Schedule captures during charging periods
  • Mounting: Phone holders/mounts for consistent angle ($15-30)

Sample Mobile Capture Code (JavaScript/React Native):

// Capture image from mobile device camera
const captureWasteImage = async () => {
  const photo = await Camera.takePictureAsync({
    quality: 0.8,
    base64: false,
    exif: false, // Don't include GPS/metadata for privacy
  });

  const formData = new FormData();
  formData.append('image', {
    uri: photo.uri,
    type: 'image/jpeg',
    name: 'waste-image.jpg',
  });
  formData.append('deviceId', await DeviceInfo.getUniqueId());

  await fetch('https://api.example.com/api/device-images', {
    method: 'POST',
    body: formData,
    headers: { 'Authorization': `Bearer ${token}` },
  });
};

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern UI framework
  • TypeScript - Type-safe development
  • Vite - Fast build tool and dev server
  • Wouter - Lightweight routing
  • TanStack Query - Server state management
  • Zustand - Client state management

UI Libraries

  • Material-UI (MUI) - Primary component library
  • Ant Design - Additional UI components
  • Radix UI - Accessible component primitives
  • Tailwind CSS - Utility-first styling
  • React Flow - Interactive diagrams and workflows
  • Recharts & MUI X-Charts - Data visualization
  • React Big Calendar - Scheduling and calendar views

Backend

  • Node.js - Runtime environment
  • Express - Web framework
  • TypeScript - Type-safe server code
  • Passport.js - Authentication middleware
  • Express Session - Session management

Database

  • PostgreSQL - Primary database (Neon)
  • Drizzle ORM - Type-safe database access
  • Drizzle Kit - Database migrations

Integrations

  • Stripe - Payment processing and subscriptions
  • OpenAI API - AI-powered features
  • Google Maps API - Location services and mapping
  • Nodemailer - Email notifications
  • NewsAPI - Industry news integration
  • Zapier - Workflow automation
  • AWS IoT - Device connectivity and data ingestion

File & Document Processing

  • PDFKit & jsPDF - PDF generation
  • XLSX - Excel file handling
  • Multer - File uploads

Development Tools

  • ESBuild - Fast JavaScript bundler
  • TSX - TypeScript execution
  • Drizzle Kit - Database schema management

πŸ“‹ Prerequisites

  • Node.js 18+ (tested with v22.15.1)
  • npm 10+
  • PostgreSQL database (or Neon serverless Postgres)

βš™οΈ Installation

  1. Clone the repository

    git clone <repository-url>
    cd Wastetraq2
  2. Install dependencies

    npm install
  3. Set up environment variables

    Copy the example environment files and fill in your credentials:

    cp .env.example .env
    cp client/.env.example client/.env

    Edit .env with your configuration:

    • Database credentials (PostgreSQL)
    • Stripe API keys
    • OpenAI API key
    • Google Maps API key
    • Email SMTP settings
    • Session secret
  4. Run database migrations

    npm run db:migrate
  5. Create an admin user (optional)

    tsx scripts/create-admin.ts

    Default credentials:

    • Email: admin@example.com
    • Password: admin123

πŸš€ Running the Application

Development Mode

npm run dev

The application will start on http://localhost:3000 (or the port specified in .env)

Production Build

npm run build

This will:

  1. Build the React frontend (Vite)
  2. Bundle the Express backend (ESBuild)
  3. Output to the dist/ directory

πŸ—οΈ Project Structure

Wastetraq2/
β”œβ”€β”€ client/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/         # Route pages
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/     # Admin-only pages
β”‚   β”‚   β”‚   β”œβ”€β”€ vendor/    # Vendor portal pages
β”‚   β”‚   β”‚   └── public/    # Public-facing pages
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   └── lib/           # Utility functions
β”‚   └── .env               # Frontend environment variables
β”œβ”€β”€ server/                # Express backend
β”‚   β”œβ”€β”€ routes/            # API route handlers
β”‚   β”œβ”€β”€ services/          # Business logic services
β”‚   β”œβ”€β”€ db/                # Database configuration
β”‚   β”‚   β”œβ”€β”€ migrations/    # SQL migration files
β”‚   β”‚   └── schema.ts      # Drizzle schema definitions
β”‚   β”œβ”€β”€ auth.ts            # Authentication logic
β”‚   └── index.ts           # Server entry point
β”œβ”€β”€ scripts/               # Utility scripts
β”‚   β”œβ”€β”€ create-admin.ts    # Admin user creation
β”‚   └── run-migrations.ts  # Migration runner
β”œβ”€β”€ db/                    # Shared database exports
└── .env                   # Backend environment variables

πŸ” Environment Variables

Backend (.env)

  • DATABASE_URL - PostgreSQL connection string
  • STRIPE_SECRET_KEY - Stripe secret key
  • OPENAI_API_KEY - OpenAI API key
  • SESSION_SECRET - Express session secret
  • SMTP_FROM - Email sender address
  • NEWS_API_KEY - NewsAPI key
  • PORT - Server port (default: 3000)

Frontend (client/.env)

  • VITE_STRIPE_PUBLISHABLE_KEY - Stripe public key
  • VITE_GOOGLE_MAPS_API_KEY - Google Maps API key
  • VITE_GOOGLE_PLACES_API_KEY - Google Places API key
  • VITE_STRIPE_*_PRICE_ID - Stripe price IDs for subscription tiers

🎯 Key Features Breakdown

Waste Point Management

Track physical waste collection locations with:

  • GPS coordinates
  • Real-time fill levels (sensor integration)
  • Collection schedules
  • Historical data

Sensor & IoT Integration

  • AWS IoT Core integration
  • Real-time sensor data ingestion
  • Device management and provisioning
  • Automated alerts based on sensor thresholds

Vendor Portal

Separate interface for waste service vendors:

  • Customer management
  • Route optimization
  • Service scheduling
  • Invoice generation

Analytics & Reporting

  • Custom dashboard builder
  • Pre-built report templates
  • Data export (PDF, Excel)
  • Trend analysis and forecasting

AI Features

  • Waste optimization recommendations
  • Automated categorization
  • Predictive analytics
  • Natural language queries

πŸ”’ Security

IMPORTANT: Before pushing to GitHub:

  • βœ… All .env files are in .gitignore
  • βœ… No hardcoded credentials in source code
  • βœ… Use .env.example templates for configuration guidance
  • βœ… API keys should never be committed to version control

πŸ“ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run db:migrate - Run database migrations
  • npm run migrate - Alternative migration command

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (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

πŸ“„ License

This project is licensed under the MIT License.

πŸ› Known Issues

  • Database migration may require manual intervention if tables have existing dependencies
  • Some deprecated npm packages (react-beautiful-dnd, hull.js) - consider migrating to maintained alternatives
  • Security vulnerabilities in dependencies - run npm audit fix to address

πŸ“§ Support

For questions or issues, please open a GitHub issue or contact the development team.



VisionPipe - Edge-to-cloud computer vision made simple

About

IoT computer vision SaaS platform with real-time AI analysis. TypeScript, React, Express, PostgreSQL, Roboflow. Waste management reference implementation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published