import os

# Use current project folder.
# Run this script from inside hotel-management-system.
root_project = "."

structure = {
    # Website routes
    "routes/website": [
        "websiteRoutes.js",
        "clientAuthRoutes.js",
        "clientAccountRoutes.js"
    ],

    # Website controllers
    "controllers/website": [
        "websiteController.js",
        "clientAuthController.js",
        "clientAccountController.js"
    ],

    # Client models only
    "models": [
        "Client.js",
        "Feedback.js",
        "Service.js",
        "FoodItem.js"
    ],

    # Website layouts
    "views/website/layouts": [
        "header.ejs",
        "navbar.ejs",
        "footer.ejs"
    ],

    # Public website pages
    "views/website/pages": [
        "home.ejs",
        "rooms.ejs",
        "room-details.ejs",
        "services.ejs",
        "food.ejs",
        "booking.ejs",
        "contact.ejs",
        "about.ejs",
        "success.ejs"
    ],

    # Client auth pages
    "views/website/auth": [
        "login.ejs",
        "register.ejs",
        "forgot-password.ejs"
    ],

    # Client account pages
    "views/website/account": [
        "dashboard.ejs",
        "bookings.ejs",
        "payments.ejs",
        "profile.ejs",
        "feedback.ejs",
        "history.ejs"
    ],

    # Website assets
    "public/website/css": [
        "website.css",
        "client-dashboard.css"
    ],

    "public/website/js": [
        "website.js",
        "client-dashboard.js"
    ],

    "public/website/images": [
        "hero.jpg",
        "room-1.jpg",
        "room-2.jpg",
        "room-3.jpg",
        "restaurant.jpg",
        "spa.jpg",
        "conference.jpg",
        "banner.jpg"
    ]
}

for folder, files in structure.items():
    folder_path = os.path.join(root_project, folder)
    os.makedirs(folder_path, exist_ok=True)

    for file in files:
        file_path = os.path.join(folder_path, file)

        if os.path.exists(file_path):
            print(f"Skipped existing: {file_path}")
            continue

        with open(file_path, "w", encoding="utf-8") as f:
            if file.endswith(".js"):
                f.write(f"// {file}\n")
            elif file.endswith(".ejs"):
                f.write(f"<!-- {file} -->\n")
            elif file.endswith(".css"):
                f.write("/* Website client styles */\n")
            else:
                f.write("")

print("✅ Full client website and guest portal structure created successfully!")