import streamlit as st import pandas as pd import time # Page configuration st.set_page_config(page_title="Ujenzibora", page_icon="🏗️", layout="wide") # Title and description st.title("🏗️ Ujenzibora - Building Materials Delivery") st.markdown(""" Welcome to Ujenzibora! Order building materials and manage your construction projects efficiently. """) # Sidebar for user input with st.sidebar: st.header("User Profile") user_name = st.text_input("Enter your name:") user_location = st.selectbox("Select your location:", ["Nairobi", "Mombasa", "Kisumu", "Nakuru", "Eldoret"]) st.divider() st.markdown("**Need help?** Contact support: support@ujenzibora.com") # Main content tab1, tab2, tab3 = st.tabs(["Order Materials", "Track Delivery", "Manage Inventory"]) # Tab 1: Order Materials with tab1: st.header("Order Building Materials") st.markdown("Select the materials you need and place your order.") # Material selection materials = { "Cement": 1000, # Price per unit "Steel Bars": 1500, "Timber": 800, "Sand": 500, "Bricks": 10, } col1, col2 = st.columns(2) with col1: selected_material = st.selectbox("Select Material", list(materials.keys())) with col2: quantity = st.number_input("Quantity", min_value=1, value=1) # Display price total_price = materials[selected_material] * quantity st.markdown(f"**Total Price:** KES {total_price}") # Place order button if st.button("Place Order", type="primary"): st.success(f"Order placed for {quantity} units of {selected_material}!") st.balloons() # Tab 2: Track Delivery with tab2: st.header("Track Your Delivery") st.markdown("Enter your order ID to track the status of your delivery.") order_id = st.text_input("Enter Order ID:") if order_id: with st.spinner("Tracking your order..."): time.sleep(2) st.success("Order found!") st.markdown("**Delivery Status:** In Transit") st.progress(70) # Simulate delivery progress # Tab 3: Manage Inventory with tab3: st.header("Manage Inventory") st.markdown("Upload and manage your inventory data.") # File uploader for inventory uploaded_file = st.file_uploader("Upload Inventory CSV", type=["csv"]) if uploaded_file: inventory_df = pd.read_csv(uploaded_file) st.markdown("**Inventory Data:**") edited_df = st.data_editor(inventory_df, num_rows="dynamic") st.download_button("Download Updated Inventory", edited_df.to_csv(index=False), file_name="updated_inventory.csv") # Chat feature for support st.divider() st.markdown("### Chat with Support") if prompt := st.chat_input("Ask a question or request support:"): st.chat_message("user").write(prompt) with st.chat_message("assistant"): with st.spinner("Thinking..."): time.sleep(1) st.write("Thank you for reaching out! Our support team will contact you shortly.") # Footer st.divider() st.markdown("© 2025 Ujenzibora. All rights reserved.")