File size: 1,660 Bytes
8bc254d
 
80901e6
b7b397e
 
e19b30e
b7b397e
 
e19b30e
8bc254d
 
 
 
e19b30e
8bc254d
 
 
 
 
 
 
e19b30e
8bc254d
b7b397e
 
 
8bc254d
b7b397e
 
8bc254d
 
b7b397e
 
 
 
8bc254d
b7b397e
8bc254d
b7b397e
e19b30e
b7b397e
8bc254d
b7b397e
 
 
 
 
8bc254d
 
 
 
 
 
 
 
 
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
# app.py

import streamlit as st
import os
from landing import show_landing
from dashboard.logs import show_logs
from agent_manager import AgentManager
from stripe_checkout import create_stripe_session

st.set_page_config(page_title="AutoExec AI", layout="wide")

# Read any query params (e.g., ?mode=landing) using the new API
mode = st.query_params.get("mode", ["app"])[0]

# Sidebar navigation
st.sidebar.header("AutoExec AI")
selection = st.sidebar.radio(
    "Go to",
    ["🏠 Home", "πŸš€ Launch", "πŸ“Š Logs", "βš™οΈ Settings"],
    index=0 if mode in ("app", "landing") else None
)

# Route: Landing or Home
if mode == "landing" or selection == "🏠 Home":
    show_landing()

# Route: Launch
elif selection == "πŸš€ 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)

# Route: Logs
elif selection == "πŸ“Š Logs":
    show_logs()

# Route: Settings & Billing
elif selection == "βš™οΈ Settings":
    st.header("βš™οΈ Settings & Billing")
    if st.button("Create Stripe Checkout Session"):
        url = create_stripe_session()
        st.markdown(f"[Pay & Activate]({url})")
    st.markdown(
        """
        **Secrets in use**:
        - `OPENAI_API_KEY`  
        - `GEMINI_API_KEY`  
        - `STRIPE_API_KEY`  
        - `API_KEY` (for protected API routes)
        """
    )