mgbam commited on
Commit
8bc254d
Β·
verified Β·
1 Parent(s): 0554619

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -9
app.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import streamlit as st
2
  import os
3
  from landing import show_landing
@@ -5,32 +7,50 @@ from dashboard.logs import show_logs
5
  from agent_manager import AgentManager
6
  from stripe_checkout import create_stripe_session
7
 
8
- # Determine mode from query param or button
9
- mode = st.experimental_get_query_params().get("mode", ["app"])[0]
 
 
10
 
11
- # Top-level navigation
12
- st.sidebar.title("AutoExec AI")
13
- selection = st.sidebar.radio("Go to", ["🏠 Home", "πŸš€ Launch", "πŸ“Š Logs", "βš™οΈ Settings"])
 
 
 
 
14
 
 
15
  if mode == "landing" or selection == "🏠 Home":
16
  show_landing()
17
 
 
18
  elif selection == "πŸš€ Launch":
19
  st.header("πŸš€ Launch a New AI Business")
20
- niche = st.text_input("Niche (e.g., fitness)")
21
- business_type = st.selectbox("Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"])
22
  if st.button("Generate & Deploy"):
23
  manager = AgentManager(niche, business_type)
24
  result = manager.run_all()
25
  st.success("βœ… Business Launched!")
26
- st.write(result)
27
 
 
28
  elif selection == "πŸ“Š Logs":
29
  show_logs()
30
 
 
31
  elif selection == "βš™οΈ Settings":
32
  st.header("βš™οΈ Settings & Billing")
33
  if st.button("Create Stripe Checkout Session"):
34
  url = create_stripe_session()
35
  st.markdown(f"[Pay & Activate]({url})")
36
- st.markdown("Manage your API keys and subscription here.")
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+
3
  import streamlit as st
4
  import os
5
  from landing import show_landing
 
7
  from agent_manager import AgentManager
8
  from stripe_checkout import create_stripe_session
9
 
10
+ st.set_page_config(page_title="AutoExec AI", layout="wide")
11
+
12
+ # Read any query params (e.g., ?mode=landing) using the new API
13
+ mode = st.query_params.get("mode", ["app"])[0]
14
 
15
+ # Sidebar navigation
16
+ st.sidebar.header("AutoExec AI")
17
+ selection = st.sidebar.radio(
18
+ "Go to",
19
+ ["🏠 Home", "πŸš€ Launch", "πŸ“Š Logs", "βš™οΈ Settings"],
20
+ index=0 if mode in ("app", "landing") else None
21
+ )
22
 
23
+ # Route: Landing or Home
24
  if mode == "landing" or selection == "🏠 Home":
25
  show_landing()
26
 
27
+ # Route: Launch
28
  elif selection == "πŸš€ Launch":
29
  st.header("πŸš€ Launch a New AI Business")
30
+ niche = st.text_input("Niche (e.g. fitness)")
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)
34
  result = manager.run_all()
35
  st.success("βœ… Business Launched!")
36
+ st.json(result)
37
 
38
+ # Route: Logs
39
  elif selection == "πŸ“Š Logs":
40
  show_logs()
41
 
42
+ # Route: Settings & Billing
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
+ )