Implement multi-channel notification system with:
- Core notification service with email, push, and in-app channels
- Email templates for all notification types (welcome, plant registered,
transport alerts, farm alerts, harvest ready, demand matches, weekly digest)
- Push notification support with VAPID authentication
- In-app notification management with read/unread tracking
- Notification scheduler for recurring and scheduled notifications
- API endpoints for notifications CRUD, preferences, and subscriptions
- UI components (NotificationBell, NotificationList, NotificationItem,
PreferencesForm)
- Full notifications page with preferences management
- Service worker for push notification handling
This commit introduces a complete transparency infrastructure including:
Core Transparency Modules:
- AuditLog: Immutable, cryptographically-linked audit trail for all actions
- EventStream: Real-time SSE streaming and webhook support
- TransparencyDashboard: Aggregated metrics and system health monitoring
- DigitalSignatures: Cryptographic verification for handoffs and certificates
API Endpoints:
- /api/transparency/dashboard - Full platform metrics
- /api/transparency/audit - Query and log audit entries
- /api/transparency/events - SSE stream and event history
- /api/transparency/webhooks - Webhook management
- /api/transparency/signatures - Digital signature operations
- /api/transparency/certificate/[plantId] - Plant authenticity certificates
- /api/transparency/export - Multi-format data export
- /api/transparency/report - Compliance reporting
- /api/transparency/health - System health checks
Features:
- Immutable audit logging with chain integrity verification
- Real-time event streaming via Server-Sent Events
- Webhook support with HMAC signature verification
- Digital signatures for transport handoffs and ownership transfers
- Certificate of Authenticity generation for plants
- Multi-format data export (JSON, CSV, summary)
- Public transparency portal at /transparency
- System health monitoring for all components
Documentation:
- Comprehensive TRANSPARENCY.md guide with API examples
Transport API (11 endpoints):
- POST /api/transport/seed-acquisition - Record seed acquisition events
- POST /api/transport/planting - Record planting events
- POST /api/transport/growing - Record growing transport events
- POST /api/transport/harvest - Record harvest events
- POST /api/transport/distribution - Record distribution events
- POST /api/transport/seed-saving - Record seed saving events
- POST /api/transport/seed-sharing - Record seed sharing events
- GET /api/transport/journey/[plantId] - Get plant journey
- GET /api/transport/footprint/[userId] - Get environmental impact
- GET /api/transport/verify/[blockHash] - Verify block integrity
- GET /api/transport/qr/[id] - Generate QR code data
Demand API (6 endpoints):
- POST/GET /api/demand/preferences - Consumer preferences
- POST /api/demand/signal - Generate demand signal
- GET /api/demand/recommendations - Get planting recommendations
- GET /api/demand/forecast - Get demand forecast
- POST /api/demand/supply - Register supply commitment
- POST /api/demand/match - Create market match
Vertical Farm API (9 endpoints):
- POST /api/vertical-farm/register - Register new farm
- GET /api/vertical-farm/[farmId] - Get farm details
- GET/POST /api/vertical-farm/[farmId]/zones - Manage zones
- GET /api/vertical-farm/[farmId]/analytics - Get farm analytics
- POST /api/vertical-farm/batch/start - Start crop batch
- GET /api/vertical-farm/batch/[batchId] - Get batch details
- PUT /api/vertical-farm/batch/[batchId]/environment - Record environment
- POST /api/vertical-farm/batch/[batchId]/harvest - Complete harvest
- GET /api/vertical-farm/recipes - List growing recipes
Implements comprehensive privacy and anonymity features including Tor
hidden service support, location obfuscation, and anonymous registration.
Privacy Features:
- Anonymous plant registration with zero personal information
- Location privacy levels: exact, fuzzy, city, country, hidden
- Pseudonymous identities and wallet addresses
- Privacy settings component with real-time Tor status
- Encrypted anonymous contact generation
Tor Integration:
- SOCKS proxy support for Tor connections
- Hidden service (.onion) configuration
- Tor connection detection and status API
- Docker Compose setup for easy Tor deployment
- Automatic privacy warnings when not using Tor
Location Obfuscation:
- Fuzzy location: ±1-5km random offset
- City level: ~10km grid
- Country level: ~100km grid
- Hidden: complete location privacy
- Haversine-based distance calculations preserved
Anonymous Registration:
- /plants/register-anonymous endpoint
- Privacy-first UI with Tor status banner
- Anonymous IDs and wallet addresses
- Optional pseudonym support
- Encryption key support for enhanced security
Infrastructure:
- Tor service integration (lib/services/tor.ts)
- Privacy utilities (lib/privacy/anonymity.ts)
- PrivacySettings React component
- Tor status API endpoint
- Docker and docker-compose configurations
- Example Tor configuration (torrc.example)
Documentation:
- Comprehensive TOR_SETUP.md guide
- Installation instructions for Linux/macOS/Windows
- Privacy best practices
- Troubleshooting guide
- Security considerations
- Updated README with Tor features
Dependencies:
- Added socks-proxy-agent for Tor proxy support
This enables:
- Privacy-conscious growers to share anonymously
- Protection of exact home locations
- Censorship-resistant plant sharing
- Community building without identity disclosure
- Compliance with privacy regulations
All privacy features are optional and configurable.
Users can choose their desired privacy level.
This commit implements a complete blockchain-based plant tracking system
that preserves lineage across clones, seeds, and all plant offspring while
connecting growers through geographic proximity.
Features implemented:
- Custom blockchain with proof-of-work consensus
- Plant registration and cloning with lineage tracking
- Geographic discovery to find nearby plants and growers
- Integration with plants.net API for plant identification
- Comprehensive web UI for plant management
- RESTful API endpoints for all operations
- Network statistics and visualization
Core Components:
- lib/blockchain/: PlantBlock, PlantChain, and blockchain manager
- lib/services/: plants.net API and geolocation services
- pages/api/plants/: REST API endpoints for all operations
- pages/: Frontend UI pages for registration, exploration, and lineage
Technical Details:
- TypeScript for type safety
- Next.js for server-side rendering
- Tailwind CSS for responsive design
- JSON file-based blockchain storage
- Haversine distance calculations for geolocation
- OpenStreetMap integration for geocoding
This system enables large-scale adoption by:
- Making plant lineage tracking accessible to everyone
- Connecting local communities through plant sharing
- Providing immutable proof of plant provenance
- Supporting unlimited generations of plant propagation
- Scaling from individual growers to global networks
Documentation includes comprehensive README with:
- Quick start guide
- API reference
- Architecture details
- Scaling recommendations
- Use cases for various audiences
- Roadmap for future enhancements