Update app.py
Browse files
app.py
CHANGED
@@ -1,33 +1,30 @@
|
|
1 |
-
# app.py
|
2 |
-
|
3 |
import streamlit as st
|
4 |
import os
|
5 |
from landing import show_landing
|
6 |
-
from dashboard.logs import show_logs
|
7 |
from agent_manager import AgentManager
|
|
|
8 |
from stripe_checkout import create_stripe_session
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
mode = st.query_params.get("mode", ["app"])[0]
|
14 |
|
15 |
# Sidebar navigation
|
16 |
-
st.sidebar.
|
17 |
-
|
18 |
"Go to",
|
19 |
-
["
|
20 |
-
index=
|
|
|
21 |
)
|
22 |
|
23 |
-
# Route
|
24 |
-
if
|
25 |
show_landing()
|
26 |
|
27 |
-
|
28 |
-
elif selection == "π Launch":
|
29 |
st.header("π Launch a New AI Business")
|
30 |
-
niche = st.text_input("Niche (e.g
|
31 |
business_type = st.selectbox("Business Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"])
|
32 |
if st.button("Generate & Deploy"):
|
33 |
manager = AgentManager(niche, business_type)
|
@@ -35,22 +32,12 @@ elif selection == "π Launch":
|
|
35 |
st.success("β
Business Launched!")
|
36 |
st.json(result)
|
37 |
|
38 |
-
|
39 |
-
elif selection == "π Logs":
|
40 |
show_logs()
|
41 |
|
42 |
-
|
43 |
-
elif selection == "βοΈ Settings":
|
44 |
st.header("βοΈ Settings & Billing")
|
45 |
if st.button("Create Stripe Checkout Session"):
|
46 |
url = create_stripe_session()
|
47 |
st.markdown(f"[Pay & Activate]({url})")
|
48 |
-
st.markdown(
|
49 |
-
"""
|
50 |
-
**Secrets in use**:
|
51 |
-
- `OPENAI_API_KEY`
|
52 |
-
- `GEMINI_API_KEY`
|
53 |
-
- `STRIPE_API_KEY`
|
54 |
-
- `API_KEY` (for protected API routes)
|
55 |
-
"""
|
56 |
-
)
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
from landing import show_landing
|
|
|
4 |
from agent_manager import AgentManager
|
5 |
+
from dashboard.logs import show_logs
|
6 |
from stripe_checkout import create_stripe_session
|
7 |
|
8 |
+
# Initialize session state for page navigation
|
9 |
+
if "page" not in st.session_state:
|
10 |
+
st.session_state.page = "Home"
|
|
|
11 |
|
12 |
# Sidebar navigation
|
13 |
+
st.sidebar.title("AutoExec AI")
|
14 |
+
st.session_state.page = st.sidebar.radio(
|
15 |
"Go to",
|
16 |
+
["Home", "Launch", "Logs", "Settings"],
|
17 |
+
index=["Home", "Launch", "Logs", "Settings"].index(st.session_state.page),
|
18 |
+
key="page",
|
19 |
)
|
20 |
|
21 |
+
# Route to the correct page
|
22 |
+
if st.session_state.page == "Home":
|
23 |
show_landing()
|
24 |
|
25 |
+
elif st.session_state.page == "Launch":
|
|
|
26 |
st.header("π Launch a New AI Business")
|
27 |
+
niche = st.text_input("Niche (e.g., fitness)")
|
28 |
business_type = st.selectbox("Business Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"])
|
29 |
if st.button("Generate & Deploy"):
|
30 |
manager = AgentManager(niche, business_type)
|
|
|
32 |
st.success("β
Business Launched!")
|
33 |
st.json(result)
|
34 |
|
35 |
+
elif st.session_state.page == "Logs":
|
|
|
36 |
show_logs()
|
37 |
|
38 |
+
elif st.session_state.page == "Settings":
|
|
|
39 |
st.header("βοΈ Settings & Billing")
|
40 |
if st.button("Create Stripe Checkout Session"):
|
41 |
url = create_stripe_session()
|
42 |
st.markdown(f"[Pay & Activate]({url})")
|
43 |
+
st.markdown("Manage API keys and subscriptions here.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|