Plastic Drop-off Tracking Application
A comprehensive system for tracking plastic waste drop-offs with SMS integration, real-time monitoring, and geographic visualization.
System Architecture
Components
- SMS Gateway - Twilio integration for receiving drop-off reports via SMS
- API Layer - Express.js REST API for data management
- Application Logic - Data validation, processing, and user authentication
- Database - PostgreSQL with PostGIS for geographic data
- GIS Integration - Location-based queries and spatial analysis
- Notification System - SMS confirmations and alerts
- Analytics - Real-time reporting and insights
- Admin Dashboard - React-based monitoring interface
Tech Stack
Backend
- Node.js + Express.js
- PostgreSQL + PostGIS
- Prisma ORM
- Twilio SDK for SMS
- JWT for authentication
- Winston for logging
Frontend
- React 18
- React Router for navigation
- Chart.js for data visualization
- Leaflet for maps
- Material-UI for styling
- Axios for API calls
Project Structure
plastic-dropoff-tracker/
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── middleware/
│ │ ├── utils/
│ │ └── server.js
│ ├── prisma/
│ ├── package.json
│ └── .env.example
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ ├── utils/
│ │ └── App.js
│ ├── public/
│ └── package.json
├── docker-compose.yml
└── README.md
Installation
Prerequisites
- Node.js 18+
- PostgreSQL 14+ with PostGIS extension
- Twilio account (for SMS functionality)
Backend Setup
- Navigate to backend directory:
cd backend
npm install- Set up environment variables (copy
.env.exampleto.env):
DATABASE_URL=postgresql://user:password@localhost:5432/plastic_tracker
JWT_SECRET=your-secret-key
TWILIO_ACCOUNT_SID=your-twilio-sid
TWILIO_AUTH_TOKEN=your-twilio-token
TWILIO_PHONE_NUMBER=your-twilio-number- Initialize database:
npx prisma migrate dev
npx prisma generate- Start the backend server:
npm run devFrontend Setup
- Navigate to frontend directory:
cd frontend
npm install- Set up environment variables (create
.env):
REACT_APP_API_URL=http://localhost:3001/api- Start the frontend:
npm startDocker Deployment
docker-compose up -dUsage
SMS Format for Drop-offs
Users send SMS messages in the following format:
DROP <plastic_type> <quantity> <location>
Example: DROP PET 5 40.7128,-74.0060
Admin Dashboard
Access the dashboard at http://localhost:3000/admin
Features:
- Real-time drop-off map
- Analytics and charts
- User management
- Report generation
- Alert configuration
API Endpoints
Public Endpoints
POST /api/sms/webhook- Twilio SMS webhookPOST /api/auth/login- Admin login
Protected Endpoints (require JWT)
GET /api/dropoffs- List all drop-offsGET /api/dropoffs/:id- Get drop-off detailsGET /api/analytics/summary- Get analytics summaryGET /api/users- List usersPOST /api/notifications/send- Send notification
Security Features
- JWT-based authentication
- Encrypted data transmission (HTTPS)
- Password hashing with bcrypt
- Rate limiting on API endpoints
- SQL injection prevention (Prisma ORM)
- XSS protection
- CORS configuration
- Audit logging
Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
On this page
Languages
JavaScript98.2%Dockerfile0.8%HTML0.5%CSS0.5%
Contributors
MIT License
Created January 4, 2026
Updated January 4, 2026