Commit graph

45 commits

Author SHA1 Message Date
fullsizemalt
96c7a2bf75 fix: remove invalid posX, posY, notes from FacilityPosition seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
2025-12-12 21:43:10 -08:00
fullsizemalt
b0cd3bdcf9 feat: add sections with plant positions to demo facility layout
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
- 22 sections (tables/racks) across all rooms
- Each section has grid positions for plants
- Proper sizing in pixels for canvas rendering
- Veg, Flower, Mother, Dry, Cure rooms all have layout data
2025-12-12 21:41:33 -08:00
fullsizemalt
e02fdb0c45 feat: add facility structure to demo seed (property, buildings, floors, rooms)
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
2025-12-12 20:45:37 -08:00
fullsizemalt
5c7a4b83c3 feat: comprehensive demo seed + paperless integration spec
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
Demo Seed (npm run seed:demo):
- 5 demo staff members
- 8 grow rooms
- 7 batches across all stages
- 292+ touch points with activity history
- 30 days of walkthrough history (with reservoir/irrigation/health checks)
- 9 SOPs and documents
- 12 supply items
- 7 tasks
- IPM schedules for active batches
- Weight logs
- 3 announcements
- 14 days time punch history

Paperless Integration Spec:
- API integration design for document archival
- Sync workflow (manual + automatic)
- Tagging conventions
- Document types
- Implementation phases
2025-12-12 20:37:28 -08:00
fullsizemalt
af3775c9b4 fix: correct document field names in demo seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
2025-12-12 20:18:44 -08:00
fullsizemalt
f02f0dfe72 fix: correct walkthrough field names in demo seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
2025-12-12 20:15:26 -08:00
fullsizemalt
981a8eded4 fix: correct touch point field names and enum values in demo seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
2025-12-12 20:12:45 -08:00
fullsizemalt
f1f766a9c7 feat: separate demo seed from base seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
Base seed (npm run seed):
- Just roles + admin user for clean onboarding

Demo seed (npm run seed:demo):
- Complete 2025 operation data
- 5 demo staff members
- 7 batches across all stages
- Touch points history (50+ per batch)
- 30 days walkthrough history with reservoir/irrigation/health checks
- 11 SOPs and documents
- Supply inventory
- IPM schedules
- Weight logs
- Time punch history
- Announcements
2025-12-12 20:08:05 -08:00
fullsizemalt
eb5ebc610f feat: room cards with color-coded headers + room detail page
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
- Room cards now have colored header backgrounds per type (VEG=green, FLOWER=purple, DRY=amber, CURE=orange, etc.)
- Cards are clickable, linking to /rooms/:id
- New RoomDetailPage with gradient header, sensor metrics with sparklines, active batches list
- Backend: GET /rooms/:id endpoint returns room with batches
2025-12-12 19:33:07 -08:00
fullsizemalt
e7be23cce4 feat: add batch detail endpoint and fix drill-down navigation
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
Backend:
- Add getBatchById controller with touch points and IPM schedule
- Add GET /batches/:id route

Frontend:
- Update Batch interface to include touchPoints
- BatchDetailPage now uses real touch points from API
- Better error handling on batch load failure
2025-12-12 19:04:16 -08:00
fullsizemalt
73958c5a5f fix(backend): add auth middleware to walkthrough routes
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 1s
2025-12-11 20:29:50 -08:00
fullsizemalt
56c8e8bb8b fix(schema): Add REVOKED to VisitorStatus enum
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-11 14:11:28 -08:00
fullsizemalt
668e213cd8 fix(visitor): Remove global auth from Kiosk routes
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Removed global onRequest jwtVerify hook
- Added explicit auth check to secure routes (revoke, report)
- Kiosk check-in/out and create visitor are now public
2025-12-11 13:59:43 -08:00
fullsizemalt
15e1a8b199 feat(visitor): Implement Digital Badge System
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added public /badges/:id route with BadgePage component
- Updated VisitorKiosk to display QR code upon check-in
- Backend now returns visitId in check-in response
- Added qrcode.react dependency
2025-12-11 13:51:47 -08:00
fullsizemalt
ed36645cc8 feat(api): Update section creation routes to support Tiers
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-11 13:23:32 -08:00
fullsizemalt
3a11590795 feat(layout): Add Tiers to FacilitySection and Position
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added 'tiers' to FacilitySection for multi-level racks
- Added 'tier' to FacilityPosition for Z-axis addressing
- Updated unique constraint for positions
2025-12-11 13:21:05 -08:00
fullsizemalt
1ef3dc0d80 fix(seed): Adjust Nutrient Management for 16-gal Test Stock
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Updated seed.js task to reflect 16-gallon test stock protocol (scaling factor 0.32)
- Updated Spec 006 with 16-gallon protocol details
- Updated validation targets (EC ~2.9 for Part A, ~1.69 for Part B/PZ)
2025-12-11 12:47:31 -08:00
fullsizemalt
3dad07de03 feat(seed): Add Nutrient Management protocols and Supplies
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added Front Row Ag 3-2-2 Mixing Task to seed.js
- Added Front Row Ag nutrients and Phoszyme to demo supplies
- Created spec 013 (Facility Monitoring)
- Updated spec 006 (Cultivation) with nutrient protocols
2025-12-11 12:40:03 -08:00
fullsizemalt
da93320ccf feat(layout): Add Ceiling Height and Tiers to Floor creation
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added ceilingHeight and defaultTiers to FacilityFloor model
- Updated API routes and frontend client
- Updated AddFloorModal with new fields and clearer labels
2025-12-11 12:23:49 -08:00
fullsizemalt
0c970cadb7 fix(seed): Remove invalid createdById from Task creation in seed.js
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-11 11:57:42 -08:00
fullsizemalt
76703aa500 fix(seed): Update seed.js SupplyCategory Enum values (NUTRIENTS -> OTHER)
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-11 11:54:34 -08:00
fullsizemalt
9188d12475 fix(seed): Update seed.js with correct Role Enum values (GROWER, STAFF)
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-11 11:51:00 -08:00
fullsizemalt
deadb04803 fix(backend): Add Batch-FacilityPlant relation and fix Prisma queries
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added bi-directional relation between Batch and FacilityPlant in schema.prisma
- Fixed logic in insights.routes.ts to use simplified plant count query
- Fixed duplicate property in messaging.routes.ts findMany filter
- Fixed null/undefined type mismatch in audit.routes.ts extractClientInfo
2025-12-11 11:43:54 -08:00
fullsizemalt
4663b0ac86 feat: Navigation refactor with RBAC, DevTools for quick user switching, enhanced seed data
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Refactored navigation with grouped sections (Operations, Cultivation, Analytics, etc.)
- Added RBAC-based navigation filtering by user role
- Created DevTools panel for quick user switching during testing
- Added collapsible sidebar sections on desktop
- Mobile: bottom nav bar (4 items + More) with slide-up sheet
- Enhanced seed data with [DEMO] prefix markers
- Added multiple demo users: Owner, Manager, Cultivator, Worker
- Fixed domain to runfoo.run
- Added Audit Log and SOP Library pages to navigation
- Created usePermissions hook and RoleBadge component
2025-12-11 11:07:22 -08:00
fullsizemalt
558e0ac1e2 feat: Full Spec Kit compliance implementation
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
Photo Management (per specs/photo-management.md):
- Sharp integration for 3-size compression (thumb/medium/full)
- WebP output with 80-90% quality
- Client-side compression with browser-image-compression
- PhotoUpload component with camera/drag-drop support
- Upload API with bulk support and stats endpoint

Testing:
- Backend: Jest tests for all major API endpoints
- Frontend: Vitest tests for utilities and API clients
- CI: Updated Forgejo workflow for test execution

Specs (100% coverage):
- visitor-management.md (Phase 8)
- messaging.md (Phase 9)
- audit-and-documents.md (Phase 10)
- accessibility-i18n.md (Phase 11)
- hardware-integration.md (Phase 12)
- advanced-features.md (Phase 13)

Documentation:
- OpenAPI 3.0 spec (docs/openapi.yaml)
- All endpoints documented with schemas
2025-12-11 09:53:32 -08:00
fullsizemalt
32fd739ccf feat: Complete Phases 8-13 implementation
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
Phase 8: Visitor Management
- Visitor/VisitorLog/AccessZone models
- Check-in/out with badge generation
- Zone occupancy tracking
- Kiosk and management pages

Phase 9: Messaging & Communication
- Announcements with priority levels
- Acknowledgement tracking
- Shift notes for team handoffs
- AnnouncementBanner component

Phase 10: Compliance & Audit Trail
- Immutable AuditLog model
- Document versioning and approval workflow
- Acknowledgement tracking for SOPs
- CSV export for audit logs

Phase 11: Accessibility & i18n
- WCAG 2.1 AA compliance utilities
- react-i18next with EN/ES translations
- User preferences context (theme, font size, etc)
- High contrast and reduced motion support

Phase 12: Hardware Integration
- QR code generation for batches/plants/visitors
- Printable label system
- Visitor badge printing

Phase 13: Advanced Features
- Environmental monitoring (sensors, readings, alerts)
- Financial tracking (transactions, P&L reports)
- AI/ML insights (yield predictions, anomaly detection)
2025-12-11 00:26:25 -08:00
fullsizemalt
e240ec7911 feat(phase2): Implement Phase 2 - Plant Touch Points & IPM
Added PlantTouchPoint and IPMSchedule models. Implemented touch-points and IPM controllers/routes. Updated frontend with Dashboard feed and IPM widgets.
2025-12-09 21:22:47 -08:00
fullsizemalt
f95b626724 feat: Shopping List UI + Roadmap Update
📦 Shopping List Feature (Phase 3A)
- Full SupplyItem model with Vendor & ProductUrl
- Shopping List / Inventory toggle
- Add Item Modal (Category, Thresholds, Vendor info)
- 'Order Now' external link logic
- 'Mark Ordered' tracking
- Quantity +/- adjustments

📅 Roadmap Update:
- Defined Unified Master Calendar (Phase 4)
- Added granular toggles (Emp Schedules, Taxes, Compliance, Plant Cycle, etc.)

🚀 Status:
- Backend deployed (Schema synced)
- Frontend deploying...
2025-12-09 15:26:35 -08:00
fullsizemalt
22574359ba feat: Shopping List Backend API Complete
📦 Supply Items Backend (Phase 3A)

 Controller (supplies.controller.ts):
- getSupplyItems() - List all items
- getShoppingList() - Items below threshold
- getSupplyItem() - Single item detail
- createSupplyItem() - Add new item
- updateSupplyItem() - Edit item
- deleteSupplyItem() - Remove item
- markAsOrdered() - Track last ordered date
- adjustQuantity() - Add/subtract stock

 Routes (supplies.routes.ts):
- GET /api/supplies
- GET /api/supplies/shopping-list
- GET /api/supplies/:id
- POST /api/supplies
- PATCH /api/supplies/:id
- DELETE /api/supplies/:id
- POST /api/supplies/:id/order
- POST /api/supplies/:id/adjust

 Server Integration:
- Registered supplies routes

Next: Frontend UI + Migration
2025-12-09 15:11:41 -08:00
fullsizemalt
d42331075d feat: Phase 2 Start - Shopping List Database Schema
🚀 PROCEEDING WITH ROADMAP PARITY

 Seed Data Updated:
- Removed all test users
- Kept only 777 Wolfpack team (Travis, Jen, King)
- Preserved walkthrough data

📦 Shopping List Feature (Phase 3A):
- Added SupplyItem model
- Added SupplyCategory enum (FILTER, CLEANING, PPE, OFFICE, BATHROOM, KITCHEN, MAINTENANCE, OTHER)
- Fields: name, category, quantity, minThreshold, unit, location, lastOrdered, notes

Next Steps:
1. Run migration
2. Create backend API
3. Create frontend UI
4. Deploy

Priority: Shopping List → Touch Points → Task Lists
2025-12-09 15:09:12 -08:00
fullsizemalt
e538227458 feat: Daily Walkthrough Backend API Complete
 Backend API Implementation (Phase 1.5)

📁 Files Created:
- backend/src/controllers/walkthrough.controller.ts
- backend/src/routes/walkthrough.routes.ts

🔌 API Endpoints:
- POST   /api/walkthroughs - Start new walkthrough
- GET    /api/walkthroughs - List walkthroughs (with filters)
- GET    /api/walkthroughs/:id - Get walkthrough detail
- POST   /api/walkthroughs/:id/complete - Mark complete
- POST   /api/walkthroughs/:id/reservoir-checks - Add reservoir check
- POST   /api/walkthroughs/:id/irrigation-checks - Add irrigation check
- POST   /api/walkthroughs/:id/plant-health-checks - Add plant health check

 Features:
- Full CRUD for walkthroughs
- Nested check creation
- User authentication required
- Query filters (status, date range, user)
- Includes related data (user, all checks)
- Error handling
- TypeScript types

🔐 Security:
- Requires authentication (userId from JWT)
- User attribution on creation
- Proper error responses

📊 Response Format:
- Includes user details (name, email, role)
- Includes all checks (reservoir, irrigation, plant health)
- Ordered by date (desc)

⏭️ Next: Frontend UI (4-5 hours)

Build:  Successful
2025-12-09 14:10:14 -08:00
fullsizemalt
7d42ecbfad feat: Daily Walkthrough Database Schema
🔴 Phase 1.5: Daily Operations for 777 Wolfpack

 Database Schema Complete:
- DailyWalkthrough model (parent walkthrough session)
- ReservoirCheck model (tank levels, veg/flower)
- IrrigationCheck model (drippers, water flow, nutrients, 4 zones)
- PlantHealthCheck model (pests, water/food access, photos)

📊 New Enums:
- WalkthroughStatus (IN_PROGRESS, COMPLETED, INCOMPLETE)
- TankType (VEG, FLOWER)
- TankStatus (OK, LOW, CRITICAL)
- HealthStatus (GOOD, FAIR, NEEDS_ATTENTION)
- AccessStatus (OK, ISSUES)

🔗 Relationships:
- User → DailyWalkthrough (one-to-many)
- DailyWalkthrough → ReservoirCheck (one-to-many, cascade delete)
- DailyWalkthrough → IrrigationCheck (one-to-many, cascade delete)
- DailyWalkthrough → PlantHealthCheck (one-to-many, cascade delete)

📝 Features:
- Photo URLs for all check types
- JSON storage for failed dripper IDs
- Cascade delete (cleanup on walkthrough deletion)
- Timestamps for audit trail
- Status tracking (in progress → completed)

⏭️ Next: Migration + Backend API endpoints

Migration Command (run on deployment):
npx prisma migrate dev --name add_daily_walkthrough
2025-12-09 14:06:16 -08:00
fullsizemalt
9dc0586d67 feat: Sprint 2 Phase 1 - Auth Core Complete
 Implemented:
- Password hashing with bcrypt (salt rounds = 10)
- JWT token generation (access 15m, refresh 7d)
- Updated login endpoint to return access + refresh tokens
- Added refresh and logout endpoints
- Updated seed script with hashed passwords
- Added test users for all roles (OWNER, MANAGER, GROWER, STAFF)

📝 Files Added/Modified:
- backend/src/utils/password.ts (NEW)
- backend/src/utils/jwt.ts (NEW)
- backend/src/controllers/auth.controller.ts (UPDATED)
- backend/src/routes/auth.routes.ts (UPDATED)
- backend/prisma/seed.js (UPDATED - now hashes passwords)
- CREDENTIALS.md (UPDATED - all test users documented)

🔐 Test Users:
- admin@runfoo.run (OWNER)
- manager@runfoo.run (MANAGER)
- grower@runfoo.run (GROWER)
- staff@runfoo.run (STAFF)
All passwords: password123

⏭️ Next: Auth middleware + RBAC
2025-12-09 13:52:54 -08:00
fullsizemalt
54d2d2f387 fix: Add prisma seed config to package.json 2025-12-09 13:46:59 -08:00
fullsizemalt
a9ffd1d5ca fix: Correct email domain from .com to .run
- Updated seed script: admin@runfoo.comadmin@runfoo.run
- Updated all documentation to reflect correct email
- Need to re-seed database on deployment
2025-12-09 13:46:25 -08:00
fullsizemalt
5890732667 fix: Align health check path with Nginx proxy 2025-12-09 11:56:04 -08:00
fullsizemalt
fa89e6feb6 fix: Add JS seed script for prod 2025-12-09 11:37:26 -08:00
fullsizemalt
4bf18d0757 fix: Build & Runtime Fixes (TS Lax, Vite Types, Backend OpenSSL)
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 11:18:04 -08:00
fullsizemalt
0e4a73f7f0 fix: Use npm install in Dockerfile to regenerate lockfile
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 11:00:51 -08:00
fullsizemalt
d06bf0defa fix: Switch to @fastify/jwt for proper types
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 10:57:54 -08:00
fullsizemalt
6b724386ba feat: Phase 1 Complete (Backend + Frontend)
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 09:24:00 -08:00
fullsizemalt
a4ea600843 chore: Add .gitignore and update dependencies
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Added root .gitignore to exclude node_modules
- Updated backend and frontend package-lock.json
- Updated STATUS.md
- Added deployment helper scripts
2025-12-09 00:30:27 -08:00
fullsizemalt
9c5ffec28d fix: Add missing project files for backend/frontend build
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 00:23:28 -08:00
fullsizemalt
e32d2e4ed3 fix: Add docker config and update domain to 777wolfpack.runfoo.run
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
2025-12-09 00:14:43 -08:00
fullsizemalt
da7729d6e4 Initial commit: Spec Kit foundation complete
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
- Constitution and project spec (spec.yml)
- 7 comprehensive feature specs (tasks, batches, labor, compliance, inventory, integrations, comms)
- Phase 1 implementation plan (6-week roadmap)
- Week 1 task breakdown (15 concrete tasks)
- Architecture and compliance documentation
- Backend and frontend setup guides
- Deployment guide for nexus-vector
- CI/CD workflows (Forgejo Actions)
- Quick start guide for developers

Project is ready for implementation with:
- Automated testing on every push
- Automatic deployment to nexus-vector on push to main
- Database migrations handled automatically
- Health checks and monitoring

Stack: TypeScript, Fastify, React, Vite, PostgreSQL, Prisma, Docker
2025-12-08 23:54:12 -08:00