Skip to content

Latest commit

 

History

History
74 lines (63 loc) · 2.46 KB

File metadata and controls

74 lines (63 loc) · 2.46 KB

Migration Checklist

Pre-Migration

  • Backup original app.py to scripts/app.py.bak
  • Review current functionality
  • Document current structure

Structure Creation

  • Create app/ package directory
  • Create app/services/ directory
  • Create app/utils/ directory
  • Create tests/ directory structure

Module Creation

  • app/__init__.py - Application factory
  • app/models.py - Data models and constants
  • app/routes.py - Route handlers
  • app/services/database.py - Database operations
  • app/services/doh_service.py - DoH service management
  • app/services/monitoring.py - Background monitoring
  • app/services/network_service.py - Network utilities
  • app/services/provider_service.py - Provider CRUD
  • app/utils/decorators.py - Custom decorators
  • app/utils/logging.py - Logging utilities
  • app/utils/validators.py - Validation functions

Entry Points

  • Create run.py - New application entry point
  • Create setup.py - Package installation

Testing

  • Create test directory structure
  • Add example unit test
  • Verify Python syntax with py_compile

Documentation

  • Create ARCHITECTURE.md - Architecture documentation
  • Create REFACTORING.md - Refactoring summary
  • Update README.md - Reference new structure
  • Create this checklist

Installation Scripts

  • Update install.sh to use run.py
  • Verify service file generation

Verification

  • Check all Python files compile without errors
  • Verify directory structure is correct
  • Ensure backward compatibility
  • Review git status

Post-Migration (User Tasks)

  • Test the application with sudo python run.py
  • Verify all routes work correctly
  • Test provider add/edit/delete
  • Test service controls (start/stop/restart)
  • Test real-time monitoring
  • Run unit tests: python -m unittest discover tests/
  • (Optional) Install as package: pip install -e .
  • (Optional) Add more comprehensive tests

Rollback Plan (If Needed)

If something goes wrong:

  1. Restore from backup: cp scripts/app.py.bak app.py
  2. Delete new structure: rm -rf app/ run.py setup.py tests/
  3. Restore install.sh if needed

Success Criteria

  • ✅ All Python files compile without syntax errors
  • ✅ No breaking changes to functionality
  • ✅ Installation script updated
  • ✅ Documentation complete
  • ✅ Original code backed up
  • ✅ Standard structure implemented