This commit is contained in:
2025-05-27 04:23:51 -05:00
parent f4bcf72b9b
commit 381f78b4e2
12 changed files with 282 additions and 79 deletions

196
README.md
View File

@ -1,47 +1,185 @@
# Nature In Pots Modular Flask Plant Management App
# 🌿 Nature In Pots — Ultra Plant Tracker Platform
This project is a modular, plugin-driven Flask application for tracking plants, their health, lineage, pricing, media, and more.
> Modular, collaborative, end-to-end plant tracking and pricing platform with QR+barcode IDs, propagation logs, resale tools, and role-based management.
---
## 📦 Core Features
## 🧩 Overview
- 🔐 User Authentication (`auth`)
- 🌱 Plant Identity Profiles (`plant`)
- 📊 Grow Logs with Events (`growlog`)
- 🖼 Media Upload & Attachments (`media`)
- 🔍 Tag-based and name-based Search (`search`)
- 🛠 CLI Tools for Preloading and Seeding (`cli`)
- 🎨 UI Macros and Shared Layout (`core_ui`)
This is a full-feature, plugin-driven Flask 2+ web application for managing and tracking plant ownership, propagation, pricing, and growth. It supports dynamic plant attributes, collaboration groups, trade logs, QR/barcode labeling, resale workflows, offline sync, moderator tools, and future AI/ML modules.
Built for hobbyists, businesses, breeders, and community gardens.
---
## 🧱 Plugin System
## 🚀 Core Features
Each feature is implemented as a plugin under the `plugins/` directory. Each plugin is self-contained and includes:
### 🌱 Plant Profiles
- Add, edit, and log plants with full propagation and ownership history
- Each plant is assigned a permanent, scannable **QR code** and **barcode**
- Plants can be marked as `Public`, `Unlisted`, or `Folder-only`
- All pricing, logs, and lineage are tied to a plant ID and user
- `models.py`
- `routes.py`
- `forms.py` *(if applicable)*
- `templates/`
- `plugin.json`
### 🧾 Grow Logs
- Add logs with images, notes, and growth metrics
- Track success/failure events, mutation events, pest/disease sightings
- Link logs to substrate recipes and fertilizers
Plugins are auto-loaded via `app/__init__.py`.
### 🔗 Verified Lineage Tracking
- Lineage links are created by the new owner
- Parent plant's owner must **approve** the linkage
- Verified lineage is marked with a badge and shown in plant lineage tree
- Pending links are visible only to the creator
### 💰 Pricing Logic
- Only the current owner and admins can see pricing
- On transfer, original price is retained but hidden from the buyer
- Buyer must submit their own price for tracking resale data
- Admins see full price history; mods and others do not
### 🧪 Substrate + Fertilizer Tracking
- Track custom mixes by ingredient (e.g., “Fine Pumice”, “Large Bark”)
- Store cost per ingredient and auto-calculate total mix cost
- Recipes can be reused across plants
- Fertilizer schedules can be attached to logs and outcomes tracked
### 📦 Shipping Tracker
- When a plant is sold, sellers can add:
- Carrier, tracking number, est. delivery date
- Ownership updates post buyer confirmation
- Shipping logs are attached to the plant transfer log
### 📁 Plant Folders
- Organize plants into folders (e.g., “For Sale”, “2025 Spring Batch”)
- Each folder gets its own QR code:
`https://domain.com/{username}/folder/{id}|{slug}`
- Folders can be public, private, or unlisted
---
## 🏗 Installation
## 🧍‍♂️ Users, Roles, and Groups
### Prerequisites
### 👤 User Roles
- **User** default
- **Moderator** can manage flags, notes
- **Admin** full backend, plugin, pricing, banning control
- Roles are extensible via admin UI
- Python 3.11+
- MySQL server
- Virtualenv or Docker
### 🛡 Moderator Panel
- View and resolve reports
- Add private notes to users or plants (e.g., warnings, suspicion)
- Ban users
- Banned users' plants become read-only
- Cannot add new plants
- Buyers can request transfer via email approval from banned seller
### Setup
### 👥 Collaboration Groups
- Users can form groups to share:
- Logs
- Images
- Pricing (opt-in)
- Groups have role-based permissions (manager, editor, viewer)
- Useful for stores, teams, or shared collections
---
## 🏷️ Labeling System: QR + Barcode
### QR Code
- Generated on server after initial sync
- Unique to plant, never changes
- SVG and PNG available
### Barcode Fallback
- CODE-128 format
- If data too long, split into stacked barcodes
- Same encoded info: plant ID, owner ID, visibility, timestamp
- Printable as label from dashboard
---
## 🔐 Permissions Matrix
| Feature | Owner | Group Member | Moderator | Admin |
|--------------------------|-------|---------------|-----------|--------|
| View Logs | ✅ | ✅ (if shared) | ✅ | ✅ |
| Edit Logs | ✅ | 🔁* | 🚫 | ✅ |
| View Pricing | ✅ | ✅ (opt-in) | 🚫 | ✅ |
| Ban User / Flag Review | 🚫 | 🚫 | ✅ | ✅ |
| Approve Lineage | 🚫 | 🚫 | 🚫 | ✅ |
| Confirm Lineage | ✅ | 🚫 | 🚫 | ✅ |
🔁* if granted by group manager
---
## 🌍 Offline Sync (PWA)
- Full add/log/edit possible offline
- Sync queue uploads on connection
- QR/barcodes generated **after** server confirms sync
- Client-side validation before queue
---
## 🧠 Smart Tools
### ⭐️ User Reputation System
- Users rated after trades (accuracy, responsiveness, helpfulness)
- “Trusted Grower” tag auto-assigned above threshold
- Can be revoked via vote or admin action
### 🌿 Inter-Plant Comparison
- Timeline comparison for growth, size, or log outcomes
- Side-by-side charts and event overlays
---
## 🔧 Admin & Dev Tools
### 📤 Seed Data Generator
- Seeds with common aroids, herbs, and test users
- Covers full range of roles, plant types, and edge cases
### 🗂 Plugin System
- CLI & plugin discovery system
- Admin can toggle plugins
- Plugin types: CLI, UI Panel, API extension, webhook, scheduler
### 🗃 Data Export / Disaster Recovery
- Export: SQL dump, file archive, JSON profile
- Restore: Admin-initiated rollback or full upload restore
---
## 🛣 API System
### REST & GraphQL APIs
- REST: OpenAPI-documented endpoints
- GraphQL: Advanced multi-entity queries
- JWT-secured
- Follows role-based access rules
---
## 🌐 Internationalization
- Flask-Babel integration
- Language switcher in UI
- Community-managed translation interface (admin toggled)
---
## 📅 Future Enhancements
- 🧠 AI Journal Assistant (log suggestions, summarization)
- 📆 Calendar View for logs/reminders
- 🧰 Visual ERD Generator Tool
- 🛒 Live Auctions Plugin (for curated resale events)
---
## 🧾 License & Contribution
This project is part of **Nature In Pots** under **High Thyme Ventures**.
Please contact the repository owner for collaboration, plugin submission, or access requests.
```bash
make install # Install dependencies
make dev # Start Flask development server
make db # Initialize database
make seed # Seed database with test data