I've successfully reorganized your TutorBot project structure to improve clarity and maintainability. All shell scripts are now organized in a dedicated scripts/ folder, and Docker documentation is in a docker/ folder.
/home/stephen/projects/tutorbot/
βββ main.py # Core Flask application (delegates to modules)
βββ requirements.txt # Python dependencies
βββ docker-compose.yml # Docker configuration (stays in root)
βββ Dockerfile # Docker image (stays in root)
βββ .env # Environment variables
βββ env_example.txt # Environment template
βββ help.sh # Help script (stays in root for easy access)
βββ test_prefill_overview.py # Test prefill functionality
βββ show_prefill_overview.py # Show prefill overview
βββ modules/ # π MODULAR ARCHITECTURE
β βββ __init__.py
β βββ core/ # Core configuration
β β βββ __init__.py
β β βββ config.py # Centralized configuration
β βββ handlers/ # Business logic handlers
β β βββ __init__.py
β β βββ conversation.py # Message handling
β β βββ intake.py # Prefill and intake flows
β β βββ menu.py # Menu systems
β β βββ payment.py # Payment processing
β β βββ planning.py # Lesson planning
β β βββ contact.py # Contact management
β βββ utils/ # Utility functions
β β βββ __init__.py
β β βββ cw_api.py # Chatwoot API wrapper
β β βββ text_helpers.py # Text and messaging utilities
β β βββ language.py # Language detection
β β βββ mapping.py # Data mapping utilities
β β βββ menu_guard.py # Menu selection validation
β β βββ attribute_manager.py # Attribute management
β βββ routes/ # Flask route handlers
β β βββ __init__.py
β β βββ health.py # Health check endpoints
β β βββ webhook.py # Chatwoot webhook routes
β β βββ stripe.py # Stripe webhook routes
β βββ integrations/ # External service integrations
β βββ __init__.py
β βββ openai_service.py # OpenAI API integration
β βββ calendar_integration.py # Google Calendar API
βββ config/ # Configuration files
β βββ contact_attributes.yaml
β βββ conversation_attributes.yaml
β βββ labels_lean.yaml
β βββ automations.yaml
βββ scripts/ # π ALL SHELL SCRIPTS
β βββ README.md # Scripts documentation
β βββ dev.sh # Development shortcuts
β βββ wipe.sh # Quick contact wipe
β βββ wipe_all.sh # Quick data wipe
β βββ debug_toggle.sh # Main debug toggle script
β βββ debug_on.sh # Enable debug mode
β βββ debug_off.sh # Disable debug mode
β βββ debug_private.sh # Enable private debug mode
β βββ debug_console.sh # Enable console debug mode
β βββ debug_status.sh # Show debug status
β βββ confirm_toggle.sh # Main confirmation toggle script
β βββ confirm_on.sh # Enable confirmation mode
β βββ confirm_off.sh # Disable confirmation mode
β βββ confirm_status.sh # Show confirmation status
β βββ export_env.sh # Export environment variables (in dev/)
β βββ setup_attributes.py # Setup custom attributes
β βββ setup_labels.py # Setup labels
β βββ setup_all.py # Setup everything
β βββ setup_automation_rules.py
β βββ setup_chatwoot.py # Setup Chatwoot configuration
β βββ wipe_contacts.py # Manual contact wipe
β βββ wipe_all.py # Manual data wipe
β βββ cleanup_all.py # Clean up all data
β βββ validate_structure.py # Validate project structure
β βββ audit_attributes.py # Audit custom attributes
β βββ analyze_logs.py # Analyze log files
β βββ check_inboxes.py # Check inbox status
β βββ list_contact_languages.py
β βββ list_automation.py # List automation rules
β βββ test_real_message.py # Test with real message
β βββ test_real_conversation.py
β βββ test_bot.py # Test bot functionality
β βββ test_chatwoot_api.py # Test Chatwoot API
β βββ test_input_select.py # Test input selection
βββ docker/ # π DOCKER DOCUMENTATION
β βββ README.md # Docker setup and usage
βββ tests/ # Test suite
β βββ __init__.py
β βββ test_main.py # Main test suite
β βββ test_config.py # Test configuration
β βββ README.md # Test documentation
βββ docs/ # Documentation
β βββ README_chatwoot_setup.md
βββ run_tests.py # Test runner
βββ test_setup.py # Test environment setup
βββ TEST_SUITE_SUMMARY.md # Test suite summary
scripts/ folderscripts/README.mdmodules/handlers/ foldermodules/utils/ foldermodules/routes/ foldermodules/integrations/ foldermodules/core/config.pydocker/README.md# Old commands (still work with aliases)
debug
confirm
wipe
exportenv
# New organized commands
./scripts/debug_toggle.sh
./scripts/confirm_toggle.sh
./scripts/wipe.sh
./scripts/dev/export_env.sh
# Scripts documentation
cat scripts/README.md
# Docker documentation
cat docker/README.md
# Help system
./help.sh
dev.sh - Development environment managementwipe.sh - Quick contact wipewipe_all.sh - Quick data wipedebug_toggle.sh - Main debug toggle (multiple modes)debug_on.sh - Enable debug modedebug_off.sh - Disable debug modedebug_private.sh - Enable private debug modedebug_console.sh - Enable console debug modedebug_status.sh - Show debug statusconfirm_toggle.sh - Main confirmation toggleconfirm_on.sh - Enable confirmation modeconfirm_off.sh - Disable confirmation modeconfirm_status.sh - Show confirmation statusexport_env.sh - Export environment variables# Check debug status
./scripts/debug_toggle.sh status
# Enable debug mode
./scripts/debug_toggle.sh on
# Enable private debug mode
./scripts/debug_toggle.sh private
# Quick toggle
./scripts/debug_toggle.sh
# Check confirmation status
./scripts/confirm_toggle.sh status
# Enable confirmation mode
./scripts/confirm_toggle.sh on
# Quick toggle
./scripts/confirm_toggle.sh
# Wipe contacts
./scripts/wipe.sh
# Wipe all data
./scripts/wipe_all.sh
# Export environment variables
source ./scripts/dev/export_env.sh
# Or use the script directly
./scripts/dev/export_env.sh
docker-compose.yml must be in root for docker-compose commandsDockerfile is expected in root or build contextdocker/README.md contains comprehensive Docker documentationscripts/ folderscripts/The TutorBot project now has a clean, organized structure that makes it easy to:
The organization follows best practices for project structure while maintaining backward compatibility with existing aliases and workflows.
Your TutorBot project is now enterprise-ready with professional organization and comprehensive documentation! π―