How unixbytes/erecycle works
Purpose and Entry Points
EcoRecycle is a Flask-based electronic-waste pickup management system. It supports public pickup submission and tracking, plus an admin workflow for managing requests, device types, email settings, labels, and dashboards.
Primary runtime entry points:
• run.py starts the Flask application.
• init_db.py and update_db.py establish or evolve the SQLite-backed application data.
• app/__init__.py is the likely application factory/configuration and route/model registration boundary.
Public Request Intake
The public-facing flow collects an e-waste pickup request, likely including customer contact details, address, and selected devices. GPS-based address autofill is a browser/UI concern surfaced through the public templates.
Key UI boundaries:
• app/templates/index.html
• app/templates/request_pickup.html
• app/templates/track_form.html
• app/templates/track_request.html
A submitted request becomes the central persisted record consumed by administration, tracking, label generation, and email notification stages.
Request Tracking and Lifecycle
Tracking is a separate public read path: a client supplies request-identifying information through the tracking form and receives the current request state/details. This isolates customer visibility from administrative management while sharing the underlying request data.
Relevant templates:
• app/templates/track_form.html
• app/templates/track_request.html
• app/templates/admin/request_detail.html
The admin request-detail view is the likely lifecycle-control point for reviewing a request and changing its fulfillment/status information.
Administrative Control Plane
Administrative pages provide authenticated operational management: login, dashboard visibility, request queues/detail, device-type catalog management, and email configuration.
Architectural UI endpoints are represented by:
• app/templates/admin/login.html
• app/templates/admin/dashboard.html
• app/templates/admin/requests.html
• app/templates/admin/request_detail.html
• app/templates/admin/device_types.html
• app/templates/admin/email_settings.html
Admin authentication forms a trust boundary between public submission/tracking and operational data changes.
Labels and Fulfillment Handoff
The system creates QR-code labels for pickup requests, enabling physical-item or pickup-job identification during recycling operations. Label rendering/printing is a distinct output stage from request intake and status management.
Relevant path:
• app/templates/admin/print_label.html
The QR payload likely identifies a request and connects physical handling back to the tracking/request record.
Notifications and External Integration
Email confirmations are generated after relevant request events, especially pickup-request creation or confirmation. Email content is separated from operational templates.
Relevant path:
• app/templates/email/pickup_confirmation.html
The system also integrates browser/device geolocation for address autofill. Email delivery requires SMTP or a comparable configured mail service, with settings managed through the admin interface.
Runtime and Persistence
The application runs on Python with Flask for HTTP routing/rendering, WTForms for form validation, and SQLAlchemy for persistence. SQLite is the declared local database, initialized and maintained via:
• init_db.py
• update_db.py
Static frontend assets are served from:
• app/static/css/main.css
Templates under app/templates/ define the server-rendered presentation layer; application logic and database wiring are concentrated beneath app/ and launched by run.py.
Main entry points: dashboard.html Operations dashboard · request_pickup.html Pickup submission · request_detail.html Request detail · __init__.py Application boundary
Components 19
Application Runtime
- Flask launcher · Starts the application.
run.py - Application boundary · Configures routing, models, and server rendering.
app/__init__.py - Database initialization
init_db.py - Database migration
update_db.py - Application data · Stores pickup requests, statuses, device types, and email settings.
Public Experience
- Public landing
app/templates/index.html - Pickup submission · Collects customer, address, and device details.
app/templates/request_pickup.html - Request tracking · Looks up and displays request state.
app/templates/track_form.html - Tracking result
app/templates/track_request.html
Admin Control Plane
- Admin login · Separates operational changes from public access.
app/templates/admin/login.html - Operations dashboard
app/templates/admin/dashboard.html - Request queue & lifecycle · Reviews requests and updates fulfillment status.
app/templates/admin/requests.html - Request detail
app/templates/admin/request_detail.html - Device type catalog
app/templates/admin/device_types.html - Email settings
app/templates/admin/email_settings.html
Fulfillment & Integrations
- QR pickup label · Links physical handling to a pickup request.
app/templates/admin/print_label.html - Pickup confirmation
app/templates/email/pickup_confirmation.html - Mail delivery service
- Browser geolocation · Supplies address autofill during intake.
Connections 20
- Flask launcher → Application boundary: starts
- Database initialization → Application data: creates
- Database migration → Application data: evolves
- Application boundary → Public landing: renders
- Public landing → Pickup submission: begins request
- Browser geolocation → Pickup submission: autofills address
- Pickup submission → Application data: creates request
- Pickup submission → Pickup confirmation: triggers
- Pickup confirmation → Mail delivery service: delivers through
- Request tracking → Tracking result: submits lookup
- Tracking result → Application data: reads request state
- Admin login → Operations dashboard: grants access
- Operations dashboard → Request queue & lifecycle: opens queue
- Request queue & lifecycle → Request detail: opens request
- Request detail → Application data: reads and updates
- Operations dashboard → Device type catalog: manages
- Device type catalog → Application data: updates
- Operations dashboard → Email settings: configures
- Email settings → Mail delivery service: configures delivery
- Request detail → QR pickup label: generates label