Safwanahmad619 commited on
Commit
2718dd7
Β·
verified Β·
1 Parent(s): c070ef5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -0
app.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import plotly.express as px
3
+ import pandas as pd
4
+ import requests
5
+
6
+ # --- Page Config ---
7
+ st.set_page_config(page_title="ARMS Dashboard", page_icon="πŸš€", layout="wide")
8
+
9
+ # --- Sidebar Navigation ---
10
+ st.sidebar.title("🌌 ARMS Navigation")
11
+ section = st.sidebar.radio("Go to:", ["🏠 Home", "πŸ“Š Dashboard", "πŸ“ˆ Analytics", "πŸ›°οΈ NASA Feed"])
12
+
13
+ # --- Home Section ---
14
+ if section == "🏠 Home":
15
+ st.title("πŸš€ ARMS - Astronaut Resource Management System")
16
+ st.markdown("""
17
+ Welcome to the **ARMS Mission Dashboard** β€” your mission control hub for astronaut monitoring, analytics,
18
+ and space resource optimization.
19
+
20
+ πŸ”Ή Built with Streamlit
21
+ πŸ”Ή Powered by Hugging Face Spaces
22
+ πŸ”Ή Inspired by NASA data and futuristic analytics
23
+ """)
24
+ st.image("https://www.nasa.gov/sites/default/files/thumbnails/image/iss069e027047_lrg.jpg", use_container_width=True)
25
+
26
+ # --- Dashboard Section ---
27
+ elif section == "πŸ“Š Dashboard":
28
+ st.title("πŸ“Š Mission Health Dashboard")
29
+
30
+ # Sample Data
31
+ data = pd.DataFrame({
32
+ "Astronaut": ["Alice", "Bob", "Charlie", "Diana"],
33
+ "Heart Rate": [72, 85, 79, 90],
34
+ "Oxygen Level": [98, 96, 99, 97]
35
+ })
36
+
37
+ st.subheader("πŸ‘©β€πŸš€ Crew Vital Signs")
38
+ st.dataframe(data)
39
+
40
+ # Bar Chart
41
+ fig = px.bar(data, x="Astronaut", y="Heart Rate", color="Astronaut", title="Astronaut Heart Rates")
42
+ st.plotly_chart(fig, use_container_width=True)
43
+
44
+ # --- Analytics Section ---
45
+ elif section == "πŸ“ˆ Analytics":
46
+ st.title("πŸ“ˆ Mission Analytics")
47
+ st.markdown("Analyze mission progress and performance metrics below:")
48
+
49
+ analytics_data = pd.DataFrame({
50
+ "Metric": ["Fuel Efficiency", "Resource Utilization", "Mission Success"],
51
+ "Value": [87, 92, 95]
52
+ })
53
+
54
+ fig = px.pie(analytics_data, names="Metric", values="Value", title="Mission Analytics Overview")
55
+ st.plotly_chart(fig, use_container_width=True)
56
+
57
+ st.metric("Fuel Efficiency", "87%", "+2%")
58
+ st.metric("Resource Utilization", "92%", "+4%")
59
+
60
+ # --- NASA Feed Section ---
61
+ elif section == "πŸ›°οΈ NASA Feed":
62
+ st.title("πŸ›°οΈ NASA Daily Image Feed")
63
+
64
+ try:
65
+ response = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
66
+ st.image(response["url"], caption=response["title"], use_container_width=True)
67
+ st.write(response["explanation"])
68
+ except Exception as e:
69
+ st.error("Failed to load NASA feed. Please try again later.")