- Complete product and inventory management system - Media storage service with proper path conventions - Image handling with dynamic resizing - Database migrations for inventory tracking - Import tools for legacy data migration - Documentation improvements - InventoryItem, InventoryMovement, InventoryAlert models with hashid support - Purchase order tracking on inventory alerts - Inventory dashboard for sellers - Stock level monitoring and notifications - MediaStorageService enforcing consistent path conventions - Image controller with dynamic resizing capabilities - Migration tools for moving images to MinIO - Proper slug-based paths (not IDs or hashids) - ImportProductsFromRemote command - ImportAlohaSales, ImportThunderBudBulk commands - ExploreRemoteDatabase for schema inspection - Legacy data migration utilities - Product variations table - Remote customer mappings - Performance indexes for stats queries - Social media fields for brands - Module flags for businesses - New migrations for inventory, hashids, performance indexes - New services: MediaStorageService - New middleware: EnsureBusinessHasModule, EnsureUserHasCapability - Import commands for legacy data - Inventory models and controllers - Updated views for marketplace and seller areas - Documentation reorganization (archived old docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
9.3 KiB
Documentation Maintenance Strategy
Last Updated: 2025-11-18
Purpose
This guide explains how to keep documentation current as the codebase evolves.
Documentation Structure
/
├── SYSTEM_ARCHITECTURE.md ← Master guide (update when patterns change)
├── VERSIONING_AND_AUDITING.md ← Quicksave and auditing reference
├── CLAUDE.md ← Quick reference for common mistakes
├── CONTRIBUTING.md ← Git workflow
│
├── docs/
│ ├── supplements/ ← Deep-dive implementation guides
│ │ ├── analytics.md
│ │ ├── permissions.md
│ │ ├── departments.md
│ │ ├── processing.md
│ │ ├── batch-system.md
│ │ ├── precognition.md
│ │ ├── performance.md
│ │ └── horizon.md
│ │
│ ├── features/ ← Feature-specific documentation
│ │ ├── NOTIFICATIONS.md
│ │ ├── REAL_TIME.md
│ │ ├── PARENT_COMPANY_SUBDIVISIONS.md
│ │ └── BATCH_SYSTEM.md
│ │
│ ├── architecture/ ← Technical design docs
│ │ ├── URL_STRUCTURE.md
│ │ ├── DATABASE.md
│ │ ├── DATABASE_STRATEGY.md
│ │ ├── API.md
│ │ ├── MEDIA_STORAGE.md
│ │ └── MEDIA_STORAGE_QUICK_REFERENCE.md
│ │
│ ├── deployment/ ← DevOps and infrastructure
│ │ ├── CI_CD.md
│ │ └── KUBERNETES.md
│ │
│ ├── development/ ← Developer setup guides
│ │ └── (future: LOCAL_DEV.md, DOCKER.md, SETUP.md)
│ │
│ └── archive/ ← Old/deprecated docs (for reference only)
When to Update Documentation
✅ Update SYSTEM_ARCHITECTURE.md When:
-
New architectural pattern is introduced
- Example: Adding a new scoping trait, new middleware pattern
- Update: Relevant section in SYSTEM_ARCHITECTURE.md
-
Module system changes
- Example: Adding
has_new_moduleflag - Update: Section 2 "Permission & Module System"
- Example: Adding
-
Security pattern changes
- Example: New authorization check pattern
- Update: Section 5 "Security Patterns"
-
New critical technology added
- Example: Adding Meilisearch for search
- Update: "Technology Stack" section
-
Department system changes
- Example: New tier of department access
- Update: Section 3 "Department System"
-
Data model relationships change significantly
- Example: Major refactor of how orders relate to businesses
- Update: Section 11 "Data Models & Relationships"
✅ Update Supplement Docs When:
- analytics.md - Changes to tracking, campaign system, engagement scoring
- permissions.md - RBAC changes, new roles, impersonation updates
- departments.md - Department workflow changes, new capabilities
- processing.md - Processing operations, conversion types, yields
- batch-system.md - Batch management, inventory settings
- precognition.md - New form components, validation patterns
- performance.md - New caching strategies, indexing patterns
- horizon.md - Queue configuration, deployment changes
✅ Create New Feature Docs When:
- Building a new major feature (e.g., NOTIFICATIONS.md, REAL_TIME.md)
- Feature has its own UI, controllers, and workflows
- Put in
docs/features/ - Reference from SYSTEM_ARCHITECTURE.md Section 14
❌ DON'T Document:
- Bug fixes - Git commits track these
- Small UI tweaks - Not architectural
- Temporary workarounds - Will be removed
- Feature additions - Git commits describe features
How to Update Documentation
Step 1: Identify What Changed
Ask yourself:
- Is this a new pattern that developers need to follow?
- Does this change how the system works?
- Would a new developer need to know this?
If YES → Update docs If NO → Just commit to git
Step 2: Find the Right Doc
Use this decision tree:
Is it about HOW the system works (patterns, architecture)?
├─ YES → Update SYSTEM_ARCHITECTURE.md
└─ NO ↓
Is it a deep implementation detail for a specific module?
├─ YES → Update relevant supplement (docs/supplements/)
└─ NO ↓
Is it a new feature with its own workflows?
├─ YES → Create feature doc (docs/features/)
└─ NO ↓
Is it database design or URL routing?
├─ YES → Update architecture doc (docs/architecture/)
└─ NO ↓
Is it deployment/DevOps?
├─ YES → Update deployment doc (docs/deployment/)
└─ NO ↓
Don't document it - use git commit message instead
Step 3: Update the Doc
For SYSTEM_ARCHITECTURE.md:
- Update the relevant section
- Update "Last Updated" date at top
- Update "Last major update" at bottom if significant
For supplement docs:
- Update specific sections
- Add "Last Updated" date if doesn't exist
For new docs:
- Follow existing format
- Add to appropriate directory
- Reference from SYSTEM_ARCHITECTURE.md Section 14
Step 4: Update References
If you created a new doc or moved content:
- Update SYSTEM_ARCHITECTURE.md Section 14 references
- Update CLAUDE.md if it's a critical pattern
- Add to relevant README if exists
Documentation Review Cadence
Monthly Review (First of Month)
Check:
- Is SYSTEM_ARCHITECTURE.md still accurate?
- Are module flags up to date?
- Are technology stack listings current?
- Do code examples still work?
Action:
- Review recent PRs for architectural changes
- Update outdated sections
- Archive deprecated docs
After Major Features
When merging a major feature branch:
- Check if SYSTEM_ARCHITECTURE.md needs updates
- Consider if new supplement doc needed
- Update relevant existing docs
Before Onboarding New Developers
- Read SYSTEM_ARCHITECTURE.md top to bottom
- Fix any outdated information
- Update examples if patterns changed
- Ensure supplement docs are current
Common Maintenance Tasks
Adding a New Module Flag
-
Update SYSTEM_ARCHITECTURE.md:
- Section 2: Add to "PREMIUM MODULES" list
- Include description, controllers, see references
-
Update migration (in code)
-
Update Business model trait (in code)
-
Update blade directives (in code)
Changing a Core Pattern
Example: New way to scope departments
-
Update SYSTEM_ARCHITECTURE.md:
- Section 3: Update "Data Filtering Pattern"
- Section 11: Update "Critical Query Patterns"
-
Update supplement if relevant:
docs/supplements/departments.md
-
Add to "Common Mistakes to Avoid" if error-prone
Deprecating Old Patterns
-
Mark as deprecated in SYSTEM_ARCHITECTURE.md:
**⚠️ DEPRECATED:** Use new pattern instead -
Move full details to
docs/archive/ -
Update CLAUDE.md to reference new pattern
-
Add migration path in deprecation notice
Documentation Quality Checklist
Before considering docs "done":
- SYSTEM_ARCHITECTURE.md is 100% accurate to current codebase
- All module flags are documented
- Technology stack matches composer.json
- Code examples actually work (tested)
- Security patterns are clearly explained
- Common mistakes section is up to date
- Supplement docs match their modules
- CLAUDE.md points to SYSTEM_ARCHITECTURE.md
- Old docs are in archive/
- No duplicate documentation exists
Tools for Keeping Docs Current
Git Hooks (Future Enhancement)
Consider adding a pre-commit hook that reminds:
# If migration file changed
echo "⚠️ Migration changed - update docs/architecture/DATABASE.md if schema changed"
# If middleware changed
echo "⚠️ Middleware changed - check SYSTEM_ARCHITECTURE.md Section 5"
PR Template (Future Enhancement)
Add to PR template:
## Documentation Updates
- [ ] Updated SYSTEM_ARCHITECTURE.md (if architectural change)
- [ ] Updated relevant supplement docs
- [ ] Created feature doc (if new major feature)
- [ ] No documentation needed (just bug fix/small change)
Documentation Audit Script (Future Enhancement)
Create a script to check:
- Are all composer packages listed in Technology Stack?
- Are all module flags documented?
- Are all middleware documented?
- Are all custom traits documented?
Questions to Ask
When in doubt about documentation:
-
Would a new developer need to know this?
- YES → Document it
- NO → Skip it
-
Is this a pattern that will be repeated elsewhere?
- YES → Add to SYSTEM_ARCHITECTURE.md
- NO → Just use clear code comments
-
Does this change how the system fundamentally works?
- YES → Update architecture docs immediately
- NO → Consider if it needs docs at all
-
Will this pattern cause bugs if misunderstood?
- YES → Add to "Common Mistakes to Avoid"
- NO → May not need docs
Summary: The Golden Rule
Document the PATTERNS, not the FEATURES.
Git handles feature tracking. Docs handle architectural knowledge.
Keep SYSTEM_ARCHITECTURE.md as the single source of truth for HOW the system works.
Contacts
Questions about documentation structure?
- Review this guide first
- Check SYSTEM_ARCHITECTURE.md
- Ask in team chat if still unclear
This is a living document. Update when documentation practices evolve.