File size: 3,791 Bytes
80901e6 b7b397e 26ca950 b7b397e e19b30e 85ebef7 26ca950 e19b30e 85ebef7 7c66e2d 26ca950 85ebef7 8bc254d e19b30e 85ebef7 7c66e2d 85ebef7 7c66e2d 85ebef7 b7b397e 7c66e2d 85ebef7 b7b397e 7c66e2d 85ebef7 e19b30e b7b397e 7c66e2d 85ebef7 b7b397e 85ebef7 |
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
import streamlit as st
from landing import show_landing
from agent_manager import AgentManager
from dashboard.logs import show_logs
from stripe_checkout import create_stripe_session
# βββ Page Configuration βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
st.set_page_config(
page_title="AutoExec AI",
page_icon="π",
layout="wide",
initial_sidebar_state="expanded",
)
# βββ Sidebar Navigation βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if "page" not in st.session_state:
st.session_state.page = "Home"
PAGES = {
"Home": "π Home",
"Launch": "π Launch",
"Logs": "π Logs",
"Settings": "βοΈ Settings"
}
st.sidebar.title("AutoExec AI")
selection = st.sidebar.radio(
"Navigate to",
list(PAGES.values()),
index=list(PAGES.values()).index(PAGES[st.session_state.page]),
key="page_choice"
)
# Map back to internal page names
page = next(k for k, v in PAGES.items() if v == selection)
st.session_state.page = page
# βββ Main Content βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if page == "Home":
# Full-bleed hero section
st.markdown(
"""
<div style="text-align:center; margin: 2rem 0;">
<h1 style="font-size:3rem;">π AutoExec AI</h1>
<p style="font-size:1.25rem; color: #666;">
Your Autonomous AI Business Builder<br>
Launch, manage, and optimize digital businesses in one click.
</p>
</div>
""",
unsafe_allow_html=True,
)
show_landing()
elif page == "Launch":
st.subheader("π Launch a New AI Business")
with st.form("launch_form", clear_on_submit=False):
niche = st.text_input("π― Niche", placeholder="e.g., fitness")
business_type = st.selectbox(
"π¦ Business Type",
["Dropshipping", "Print-on-Demand", "Newsletter", "Course"],
)
launched = st.form_submit_button("Generate & Deploy")
if launched:
if not niche.strip():
st.error("Please enter a valid niche.")
else:
with st.spinner("π€ Running agents... this takes a few seconds"):
manager = AgentManager(niche.strip(), business_type)
result = manager.run_all()
st.success("β
Business Launched!")
st.json(result)
elif page == "Logs":
st.subheader("π Agent Memory Log Dashboard")
show_logs()
elif page == "Settings":
st.subheader("βοΈ Settings & Billing")
st.markdown(
"""
Manage your API keys, subscriptions, and integrations.
Ensure youβve set the following in **Settings β Secrets**:
- `API_KEY`
- `OPENAI_API_KEY`
- `GEMINI_API_KEY`
- `STRIPE_API_KEY`
"""
)
if st.button("π³ Create Stripe Checkout Session"):
url = create_stripe_session()
st.markdown(f"[Proceed to Payment]({url})", unsafe_allow_html=True)
# βββ Footer βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
st.markdown("---")
st.markdown(
"<p style='text-align:center; color:#888; font-size:0.9rem;'>"
"Powered by Streamlit β’ FastAPI β’ Celery β’ Redis β’ Hugging Face Spaces"
"</p>",
unsafe_allow_html=True,
)
|