mirror of
https://github.com/andwati/predictive_analysis.git
synced 2026-10-18 08:42:52 +00:00
144 lines
5.9 KiB
Python
144 lines
5.9 KiB
Python
#!/usr/bin/env python
|
|
"""
|
|
Quick Start Guide for Architecture Diagrams
|
|
Demonstrates the complete workflow from setup to diagram generation
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
def print_header(title):
|
|
"""Print a formatted header"""
|
|
print("\n" + "=" * 60)
|
|
print(f"🎯 {title}")
|
|
print("=" * 60)
|
|
|
|
def print_step(step_num, description):
|
|
"""Print a formatted step"""
|
|
print(f"\n📋 Step {step_num}: {description}")
|
|
print("-" * 40)
|
|
|
|
def run_with_confirmation(command, description):
|
|
"""Run a command with user confirmation"""
|
|
print(f"\n🔄 Ready to: {description}")
|
|
print(f"Command: {command}")
|
|
|
|
response = input("Proceed? (y/N): ").lower().strip()
|
|
if response in ['y', 'yes']:
|
|
try:
|
|
result = subprocess.run(command, shell=True, cwd=".")
|
|
if result.returncode == 0:
|
|
print("✅ Success!")
|
|
return True
|
|
else:
|
|
print("❌ Command failed")
|
|
return False
|
|
except Exception as e:
|
|
print(f"❌ Error: {e}")
|
|
return False
|
|
else:
|
|
print("⏭️ Skipped")
|
|
return False
|
|
|
|
def main():
|
|
"""Main demonstration function"""
|
|
|
|
print_header("Student Success Prediction - Architecture Diagrams")
|
|
print("This guide will walk you through setting up and generating")
|
|
print("comprehensive architecture diagrams for the entire system.")
|
|
|
|
# Step 1: Environment Check
|
|
print_step(1, "Environment Check")
|
|
print(f"Python Version: {sys.version}")
|
|
print(f"Current Directory: {os.getcwd()}")
|
|
print(f"Diagrams Directory Exists: {Path('diagrams').exists()}")
|
|
|
|
# Step 2: Setup Dependencies
|
|
print_step(2, "Setup Dependencies")
|
|
print("This will install the required Python packages and check Graphviz.")
|
|
|
|
if run_with_confirmation("python diagrams/setup.py", "Run setup script"):
|
|
print("✅ Dependencies are ready!")
|
|
else:
|
|
print("⚠️ You may need to install dependencies manually:")
|
|
print(" pip install diagrams>=0.23.4 graphviz>=0.20.1")
|
|
|
|
# Step 3: Generate Overview
|
|
print_step(3, "Generate System Overview")
|
|
print("Create a high-level overview of the entire system.")
|
|
|
|
if run_with_confirmation("cd diagrams && python 00_system_overview.py",
|
|
"Generate system overview diagram"):
|
|
if Path("diagrams/00_system_overview.png").exists():
|
|
print("🖼️ System overview generated successfully!")
|
|
print(" File: diagrams/00_system_overview.png")
|
|
|
|
# Step 4: Generate All Diagrams
|
|
print_step(4, "Generate All Architecture Diagrams")
|
|
print("This will create all 9 comprehensive architecture diagrams.")
|
|
|
|
if run_with_confirmation("python diagrams/generate_all_diagrams.py",
|
|
"Generate all diagrams"):
|
|
|
|
# List generated files
|
|
diagrams_dir = Path("diagrams")
|
|
png_files = list(diagrams_dir.glob("*.png"))
|
|
|
|
if png_files:
|
|
print(f"\n🎉 Successfully generated {len(png_files)} diagrams:")
|
|
for png_file in sorted(png_files):
|
|
print(f" 📊 {png_file.name}")
|
|
else:
|
|
print("⚠️ No diagram files found. Check for errors above.")
|
|
|
|
# Step 5: Integration Guide
|
|
print_step(5, "Integration and Usage")
|
|
print("\n📚 How to use these diagrams:")
|
|
print(" • Documentation: Include in README.md, wikis, or docs")
|
|
print(" • Presentations: High-resolution PNG files for slides")
|
|
print(" • Code Reviews: Reference architecture during reviews")
|
|
print(" • Onboarding: Help new team members understand the system")
|
|
print(" • Planning: Use for system evolution and scaling decisions")
|
|
|
|
print("\n🔧 Customization:")
|
|
print(" • Edit .py files in diagrams/ directory to modify diagrams")
|
|
print(" • Change colors, layouts, and components as needed")
|
|
print(" • Add new diagrams following the existing patterns")
|
|
|
|
print("\n📁 File Structure:")
|
|
print(" diagrams/")
|
|
print(" ├── 00_system_overview.png # High-level system view")
|
|
print(" ├── 01_data_flow_architecture.png # Complete data pipeline")
|
|
print(" ├── 02_eda_process_flow.png # EDA workflow")
|
|
print(" ├── 03_ml_pipeline_architecture.png # ML development process")
|
|
print(" ├── 04_application_architecture.png # Streamlit app structure")
|
|
print(" ├── 05_deployment_architecture.png # Deployment options")
|
|
print(" ├── 06_feature_engineering_pipeline.png # Feature processing")
|
|
print(" ├── 07_user_journey_flow.png # User interaction flows")
|
|
print(" └── 08_security_architecture.png # Security and auth")
|
|
|
|
# Final Summary
|
|
print_header("Summary and Next Steps")
|
|
print("✅ Architecture diagrams provide comprehensive system documentation")
|
|
print("✅ Visual representation helps with understanding and communication")
|
|
print("✅ Easy to maintain and update as the system evolves")
|
|
|
|
print("\n🚀 Recommended Next Steps:")
|
|
print("1. Review generated diagrams and verify accuracy")
|
|
print("2. Include key diagrams in project documentation")
|
|
print("3. Share with team members and stakeholders")
|
|
print("4. Update diagrams when making system changes")
|
|
print("5. Use diagrams for technical discussions and planning")
|
|
|
|
print("\n📖 For detailed information, see:")
|
|
print(" • diagrams/README.md - Complete usage guide")
|
|
print(" • Individual .py files - Diagram source code")
|
|
print(" • Generated .png files - Final diagram images")
|
|
|
|
print("\n🎯 The architecture diagrams are now ready to support your")
|
|
print(" project documentation, presentations, and team collaboration!")
|
|
|
|
if __name__ == "__main__":
|
|
main() |