File size: 2,154 Bytes
0ed3eb7
 
4a00b98
0ed3eb7
ac8355c
 
 
 
8a99355
4a00b98
faa7365
 
 
 
a8a5881
4a00b98
3ad592f
 
 
 
 
 
 
 
bad687a
0ed3eb7
bad687a
 
 
4a00b98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bad687a
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import sys
import gradio as gr

# Add the current working directory to Python's module search path
current_dir = os.path.dirname(os.path.abspath(__file__))
if current_dir not in sys.path:
    sys.path.insert(0, current_dir)

# Debugging paths
routes_dir = os.path.join(current_dir, "routes")
auth_file_path = os.path.join(routes_dir, "auth.py")
print("DEBUG: Does 'routes' directory exist? ", os.path.exists(routes_dir))
print("DEBUG: Does 'auth.py' exist in 'routes'? ", os.path.exists(auth_file_path))

# Import necessary modules
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}")
    sys.exit(1)

# Initialize necessary files
initialize_files()

def restaurant_interface():
    with gr.Blocks() as app:
        # Title or Header
        gr.Markdown("# Welcome to BH Restaurant")
        
        # Login/Sign-up Section
        with gr.Row():
            with gr.Column():
                gr.Textbox(label="Email", placeholder="Enter your email")
                gr.Textbox(label="Password", placeholder="Enter your password", type="password")
                gr.Button("Login")
            with gr.Column():
                gr.Markdown("### New Customer?")
                gr.Button("Sign Up")

        # Menu Section
        with gr.Row():
            gr.Markdown("## Menu")
            gr.Textbox(label="Search Menu", placeholder="Search for a dish")
        
        # Add Menu Items Dynamically
        with gr.Row():
            gr.Markdown("### Popular Items")
            gr.Button("Add Paneer Tikka")
            gr.Button("Add Chicken Biryani")
            gr.Button("Add Garlic Naan")

        # Orders Section
        with gr.Row():
            gr.Markdown("## Your Order")
            gr.Textbox(label="Order Summary", placeholder="Your selected items will appear here", lines=5)
            gr.Button("Place Order")

    return app

if __name__ == "__main__":
    app = restaurant_interface()
    app.launch()