import streamlit as st import os from landing import show_landing from agent_manager import AgentManager from dashboard.logs import show_logs from stripe_checkout import create_stripe_session # Initialize session state for page navigation if "page" not in st.session_state: st.session_state.page = "Home" # Sidebar navigation st.sidebar.title("AutoExec AI") st.session_state.page = st.sidebar.radio( "Go to", ["Home", "Launch", "Logs", "Settings"], index=["Home", "Launch", "Logs", "Settings"].index(st.session_state.page), key="page", ) # Route to the correct page if st.session_state.page == "Home": show_landing() elif st.session_state.page == "Launch": st.header("🚀 Launch a New AI Business") niche = st.text_input("Niche (e.g., fitness)") business_type = st.selectbox("Business Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"]) if st.button("Generate & Deploy"): manager = AgentManager(niche, business_type) result = manager.run_all() st.success("✅ Business Launched!") st.json(result) elif st.session_state.page == "Logs": show_logs() elif st.session_state.page == "Settings": st.header("⚙️ Settings & Billing") if st.button("Create Stripe Checkout Session"): url = create_stripe_session() st.markdown(f"[Pay & Activate]({url})") st.markdown("Manage API keys and subscriptions here.")