AICEO / app.py
mgbam's picture
Update app.py
85ebef7 verified
raw
history blame
3.79 kB
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,
)