import os

def create_folders(base_dir):
    folders = [
        "data/raw",
        "data/processed",
        "data/external",
        "data/interim",
        "notebooks",
        "src/data",
        "src/features",
        "src/models",
        "src/api",
        "src/services",
        "src/services/background_tasks",
        "src/utils",
        "tests/test_services",
        "scripts",
        "models",
        "docs",
        "config"
    ]
    
    # Create all the folders
    for folder in folders:
        folder_path = os.path.join(base_dir, folder)
        os.makedirs(folder_path, exist_ok=True)
        print(f"Created folder: {folder_path}")

    # Create some essential files
    essential_files = [
        "requirements.txt",
        "environment.yml",
        ".gitignore",
        "README.md",
        "setup.py",
        "src/__init__.py",
        "src/data/__init__.py",
        "src/features/__init__.py",
        "src/models/__init__.py",
        "src/api/__init__.py",
        "src/services/__init__.py",
        "src/services/background_tasks/__init__.py",
        "src/utils/__init__.py",
        "tests/__init__.py",
        "tests/test_services/__init__.py"
    ]
    
    for file in essential_files:
        file_path = os.path.join(base_dir, file)
        if not os.path.exists(file_path):
            with open(file_path, 'w') as f:
                f.write("")  # Create an empty file
            print(f"Created file: {file_path}")

if __name__ == "__main__":
    project_root = "."  # Use the current directory as the project root
    create_folders(project_root)
