|
import os |
|
import sys |
|
|
|
|
|
current_dir = os.path.dirname(os.path.abspath(__file__)) |
|
if current_dir not in sys.path: |
|
sys.path.insert(0, current_dir) |
|
|
|
|
|
print("DEBUG: sys.path =", sys.path) |
|
|
|
|
|
print("DEBUG: Does 'routes' directory exist? ", os.path.exists(os.path.join(current_dir, "routes"))) |
|
print("DEBUG: Does 'auth.py' exist in 'routes'? ", os.path.exists(os.path.join(current_dir, "routes", "auth.py"))) |
|
|
|
|
|
try: |
|
from routes.auth import login, sign_up |
|
from routes.menu import load_menu |
|
from routes.orders import add_to_order, view_order, place_order |
|
from utils.file_initializer import initialize_files |
|
except ModuleNotFoundError as e: |
|
print(f"ERROR: {e}") |
|
print("DEBUG: ModuleNotFoundError occurred. Check the paths and file structure.") |
|
sys.exit(1) |
|
|
|
|
|
initialize_files() |
|
|
|
def restaurant_interface(): |
|
from gradio import Blocks |
|
with Blocks() as app: |
|
app.load_page("templates/index.html") |
|
return app |
|
|
|
if __name__ == "__main__": |
|
app = restaurant_interface() |
|
app.launch() |
|
|