12 KiB
12 KiB
Server Organization Plan
Overview
This document outlines the comprehensive plan to organize all applications on server 192.168.50.11 following your requirements for:
- Standard folder structure for all web apps
- Zero code breakage during reorganization
- Full restore capability if anything breaks
- Easy navigation for future edits
Current State Analysis
Applications Found
- IT Site Survey AI (Port 3003) - Running
- Client Onboarding (Port 5000) - Running (duplicated in 2 locations)
- Projects Manager (Port 3456) - Running
- IT Assessment AI - Not running
- Dark Web Monitor - Not running
- Shorts Analyzer - Not running (duplicated in 2 locations)
- IT Assessment Static Site - Not running
- Projects Manager Hosting Module - Not running
Issues Identified
- Scattered Applications: Spread across multiple directories
- Duplicate Applications: Same apps in different locations
- Inconsistent Structure: No standard organization
- Mixed Application Types: Flask apps, static sites, scripts
- No Backup Strategy: Risk of data loss during reorganization
Proposed Organization Structure
Standard Directory Layout
/home/jcbeasley/applications/
├── active/ # Currently running applications
│ ├── it-site-survey-ai/ # Port 3003
│ ├── client-onboarding/ # Port 5000
│ └── projects-manager/ # Port 3456
├── archived/ # Old/backup applications
│ ├── client-onboarding-old/ # Duplicate removed from /Projects/
│ ├── shorts-analyzer-old/ # Duplicate removed from /Projects/
│ └── [other archived apps]
├── development/ # Applications in development
│ ├── it-assessment-ai/ # Future development
│ ├── dark-web-monitor/ # Future development
│ ├── shorts-analyzer/ # Future development
│ └── it-assessment-static/ # Static site
└── templates/ # Standard templates
└── python-flask-app/ # Standard Flask app template
Individual Application Structure (Standard)
{application-name}/
├── README.md # Application documentation
├── app.py # Application entry point (Flask)
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── .env.example # Environment variable examples
├── .gitignore # Git ignore rules
├── Makefile # Common commands
├── src/ # Source code
│ ├── __init__.py
│ ├── models/ # Data models
│ ├── api/ # API endpoints
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
├── frontend/ # Frontend assets
│ ├── static/ # CSS, JS, images
│ └── templates/ # HTML templates
├── tests/ # Test files
├── docs/ # Documentation
├── scripts/ # Utility scripts
└── venv/ # Virtual environment (not committed)
Implementation Phases
Phase 1: Backup and Documentation (Day 1)
Goal: Create complete backup and documentation before any changes
Tasks:
- Run Backup Script: Create full server backup
- Document Running Processes: Record all process start commands
- Export Current Data: Export in-memory data from running apps
- Create Inventory: Finalize complete applications inventory
- Verify Backups: Test restore procedures
Deliverables:
/home/jcbeasley/backups/{timestamp}/- Complete backupCOMPLETE_APPLICATIONS_INVENTORY.md- Updated inventoryBACKUP_AND_RESTORE_PLAN.md- Finalized plan
Phase 2: Consolidation (Days 2-3)
Goal: Remove duplicates and consolidate applications
Tasks:
- Identify Duplicates:
- Client Onboarding (2 copies)
- Shorts Analyzer (2 copies)
- Determine Active Versions:
- Check which versions are actually running
- Verify functionality of each version
- Archive Duplicates:
- Move duplicates to
/home/jcbeasley/applications/archived/ - Document what was archived and why
- Move duplicates to
- Consolidate Configurations:
- Ensure only one version of each app exists
- Update process start scripts if needed
Deliverables:
- Cleaned up
/home/jcbeasley/Projects/directory - Cleaned up
/home/jcbeasley/.openclaw/workspace/Projects/directory - Archived duplicate applications
- Updated documentation
Phase 3: Directory Restructuring (Days 4-6)
Goal: Move all applications to standardized directory structure
Tasks:
- Create New Directory Structure:
/home/jcbeasley/applications/active//home/jcbeasley/applications/archived//home/jcbeasley/applications/development//home/jcbeasley/applications/templates/
- Move Running Applications:
- IT Site Survey AI →
/home/jcbeasley/applications/active/it-site-survey-ai/ - Client Onboarding →
/home/jcbeasley/applications/active/client-onboarding/ - Projects Manager →
/home/jcbeasley/applications/active/projects-manager/
- IT Site Survey AI →
- Move Non-Running Applications:
- IT Assessment AI →
/home/jcbeasley/applications/development/it-assessment-ai/ - Dark Web Monitor →
/home/jcbeasley/applications/development/dark-web-monitor/ - Shorts Analyzer →
/home/jcbeasley/applications/development/shorts-analyzer/ - IT Assessment Static →
/home/jcbeasley/applications/development/it-assessment-static/
- IT Assessment AI →
- Update Process Scripts:
- Modify start scripts to reflect new locations
- Update nohup commands and process management
- Test All Applications:
- Verify all applications still start correctly
- Verify all functionality remains intact
Deliverables:
/home/jcbeasley/applications/with all apps organized- Updated start scripts for all applications
- Verification that all apps still function correctly
Phase 4: Standardization (Days 7-10)
Goal: Apply standard structure to all applications
Tasks:
- Apply Standard Template:
- Restructure each application using standard directory layout
- Split monolithic files into modules (models, api, services, utils)
- Add proper configuration management
- Add Development Tools:
- Add Makefile for common commands
- Add testing framework (pytest)
- Add code quality tools (flake8, black)
- Create Documentation:
- Add README.md to each application
- Document API endpoints
- Create development setup guides
- Implement Testing:
- Add unit tests for core functionality
- Add integration tests for API endpoints
- Add test configuration files
Deliverables:
- All applications following standard structure
- Comprehensive test suites for each application
- Professional documentation for each application
- Development tools configured and working
Phase 5: Validation and Optimization (Days 11-12)
Goal: Ensure everything works perfectly and optimize
Tasks:
- Full Functionality Testing:
- Test all features of all applications
- Verify data integrity
- Check performance metrics
- Process Management Optimization:
- Implement proper process management (systemd or similar)
- Add monitoring and health checks
- Optimize startup procedures
- Security Review:
- Add authentication where needed
- Review access controls
- Implement proper error handling
- Performance Optimization:
- Optimize database queries (after PostgreSQL installation)
- Implement caching where appropriate
- Review resource usage
Deliverables:
- Fully validated and optimized applications
- Improved process management
- Enhanced security features
- Performance improvements
Risk Mitigation
Zero Code Breakage Strategy
- Complete Backups: Full server state before any changes
- Staged Implementation: One application at a time
- Parallel Testing: Test new structure alongside old
- Immediate Rollback: Ability to revert immediately if issues found
Restore Capability
- Multiple Backup Points:
- Full server backup before changes
- Individual application backups
- Configuration backups
- Data exports
- Automated Restore Scripts:
- Full server restore script
- Individual application restore scripts
- Process configuration restore
- Verification Procedures:
- Pre-change state verification
- Post-change state verification
- Data integrity checks
Easy Navigation
- Standard Directory Structure:
- Consistent layout across all applications
- Clear separation of concerns
- Intuitive naming conventions
- Comprehensive Documentation:
- README files for each application
- API documentation
- Development guides
- Development Tools:
- Makefile for common commands
- IDE configuration files
- Debugging utilities
Team Delegation
dev-architect Responsibilities
- Design standardized directory structure
- Create application templates
- Review restructuring approach for each application
- Ensure consistency across all applications
dev-backend Responsibilities
- Implement code modularization
- Set up database integration (PostgreSQL)
- Create API documentation
- Implement testing frameworks
dev-frontend Responsibilities
- Organize frontend assets
- Implement modern frontend build process
- Create component-based architecture
- Ensure responsive design
dev-qa Responsibilities
- Implement comprehensive test suites
- Set up continuous integration
- Create automated testing procedures
- Perform functionality validation
dev-devops Responsibilities
- Implement deployment automation
- Set up monitoring and logging
- Create backup and recovery procedures
- Optimize process management
Timeline
Week 1: Foundation
- Days 1-2: Backup and documentation
- Days 3-4: Consolidation and directory restructuring
- Days 5-7: Begin standardization of first application
Week 2: Standardization
- Days 8-10: Standardize remaining applications
- Days 11-12: Validation and optimization
- Days 13-14: Final testing and documentation
Week 3: Enhancement (Optional)
- Database migration implementation
- Security enhancements
- Performance optimization
- Advanced feature development
Success Metrics
Immediate Success (During Implementation)
- ✅ Zero application downtime during reorganization
- ✅ Zero data loss during migration
- ✅ All applications function identically after changes
- ✅ Full restore capability verified
Long-term Success (Post-Implementation)
- ✅ Easy navigation and editing of any application
- ✅ Consistent structure across all applications
- ✅ Professional development environment
- ✅ Improved maintainability and scalability
- ✅ Enhanced team collaboration efficiency
Next Steps
Immediate Actions (Today)
- Run Backup Script: Create complete server backup
- Finalize Inventory: Confirm all applications and their states
- Document Process Configurations: Record all start commands
- Create Organization Directory: Set up
/home/jcbeasley/applications/
Team Tasks to Add
- Server Consolidation - High Priority
- Directory Restructuring - High Priority
- Structure Standardization - High Priority
- Backup and Restore Implementation - Critical Priority
This comprehensive organization plan will transform the current scattered and inconsistent application structure into a professional, maintainable, and easily navigable system that meets all your requirements.