Jofax commited on
Commit
df0e2a7
·
verified ·
1 Parent(s): 5b20b7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -77
app.py CHANGED
@@ -1,87 +1,71 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
- # 1. Page Configuration (Must be first)
5
- st.set_page_config(
6
- page_title="Sajha Connect - Maldives 2026",
7
- page_icon="🇳🇵",
8
- layout="wide"
9
- )
10
 
11
- # 2. Custom Styling
12
- st.markdown("""
13
- <style>
14
- .main { background-color: #f0f2f6; }
15
- .stMetric { background-color: #ffffff; padding: 15px; border-radius: 10px; box-shadow: 2px 2px 5px rgba(0,0,0,0.1); }
16
- .emergency-box { padding: 20px; background-color: #ff4b4b; color: white; border-radius: 10px; }
17
- </style>
18
- """, unsafe_allow_html=True)
19
-
20
- # 3. Sidebar Navigation
21
- st.sidebar.image("https://flagcdn.com/w320/np.png", width=100)
22
- st.sidebar.title("Sajha Connect 🇳🇵")
23
- menu = st.sidebar.radio("Main Menu", [
24
- "🏠 Dashboard",
25
- "💰 Money Transfer (Remit)",
26
- "🚢 Transport (Ferry/Bus)",
27
- "⚖️ Labor Law & Visa",
28
- "📞 Emergency & Embassy"
29
- ])
30
-
31
- # 4. Content Logic
32
- if menu == "🏠 Dashboard":
33
- st.title("Namaste! Welcome to Sajha Connect 🇲🇻")
34
- st.info("Updated: February 21, 2026 | Serving 15,000+ Nepali Brothers & Sisters")
35
 
36
- col1, col2 = st.columns(2)
37
- with col1:
38
- st.metric(label="Current NPR Rate", value="9.41 NPR", delta="0.05")
39
- st.write("Current exchange rate for 1 MVR. (Feb 2026)")
40
- with col2:
41
- st.success("📢 **News:** MTCC has announced special bus timings for Ramadan 1446H.")
 
42
 
43
- elif menu == "💰 Money Transfer (Remit)":
44
- st.header("Money Transfer Hub")
45
- mvr_amount = st.number_input("Enter MVR Amount", min_value=1, value=1000)
46
- # 2026 Feb Rate: ~9.41
47
- npr_total = mvr_amount * 9.41
48
- st.subheader(f"Total: {npr_total:,.2f} Nepalese Rupees")
49
- st.write("---")
50
- st.write("**Top Vetted Remittance Partners in Male:**")
51
- st.info("1. Prabhu Money Transfer (Near Artificial Beach)\n2. IME Nepal (Orchid Magu)\n3. BML Remit")
 
 
 
 
52
 
53
- elif menu == "🚢 Transport (Ferry/Bus)":
54
- st.header("Male-Hulhumale Connectivity")
55
- st.subheader("🚌 Bus Routes (RTL)")
56
- st.write("- **Route R1/R2:** Male to Hulhumale Phase 1/2 (Starts 07:00 AM)")
57
- st.write("- **Hulhumale Internal:** 24/7 service (Paused 17:00-19:00 during Ramadan)")
58
-
59
- st.subheader("🚢 Ferry Schedule")
60
- st.table(pd.DataFrame({
61
- "Route": ["Male to Hulhumale", "Male to Vilingili", "Airport Ferry"],
62
- "Frequency": ["Every 15 mins", "Every 10 mins", "Every 15 mins"],
63
- "Fare": ["MVR 10", "MVR 5", "MVR 15"]
64
- }))
65
 
66
- elif menu == "⚖️ Labor Law & Visa":
67
- st.header("Legal Support 2026")
68
- st.warning("**New 2025/2026 Regulation:** Work permits for Waiters and Electricians are being localized. Check your permit status on the Xpat Portal.")
69
-
70
- with st.expander("Your Basic Rights"):
71
- st.write("- **Accommodation:** Employer must provide safe housing.")
72
- st.write("- **Passport:** You have the right to keep your own passport.")
73
- st.write("- **Missing Reports:** If your employer files a false 'missing' report, contact the Ministry of Homeland Security.")
 
 
 
 
 
 
 
 
74
 
75
- elif menu == "📞 Emergency & Embassy":
76
- st.markdown('<div class="emergency-box"><h3>🚨 EMERGENCY NUMBERS</h3><p>Police: 119 | Ambulance: 102</p></div>', unsafe_allow_html=True)
77
- st.write("---")
78
- st.subheader("🇳🇵 Nepal Embassy Contact")
79
- st.write("**Note:** Nepal does not have a resident embassy in Male. The accredited mission is in Colombo.")
80
- st.write("- **Embassy of Nepal, Colombo:** +94 11-268-9656")
81
- st.write("- **Email:** eoncolombo@mofa.gov.np")
82
- st.write("- **Hulhumale Community Leader Support:** [Vetted Contact List]")
 
83
 
84
- # Footer - Monetization Placeholder
85
- st.sidebar.markdown("---")
86
- st.sidebar.write("💰 **Sponsored Ad**")
87
- st.sidebar.button("Send Gift to Nepal via Foodmandu")
 
1
  import streamlit as st
2
  import pandas as pd
3
 
4
+ # Initial configuration
5
+ st.set_page_config(page_title="Sajha Connect Maldives", page_icon="🇳🇵")
 
 
 
 
6
 
7
+ def main():
8
+ # Sidebar for Navigation
9
+ st.sidebar.title("🇳🇵 Sajha Connect")
10
+ st.sidebar.markdown("Connecting the Nepali Community in 🇲🇻")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ choice = st.sidebar.radio("Navigate to:", [
13
+ "Dashboard",
14
+ "Remittance (Money)",
15
+ "Bus & Ferry",
16
+ "Legal & Visa",
17
+ "Emergency"
18
+ ])
19
 
20
+ # 1. Dashboard
21
+ if choice == "Dashboard":
22
+ st.title("Sajha Connect Dashboard")
23
+ st.info("Welcome to the 2026 Hub for Nepalis in Male' and Hulhumale'.")
24
+
25
+ col1, col2 = st.columns(2)
26
+ with col1:
27
+ st.metric("Exchange Rate", "1 MVR = 9.41 NPR")
28
+ with col2:
29
+ st.metric("Active Jobs", "12 New Today")
30
+
31
+ st.markdown("### 🔔 Important Announcements")
32
+ st.warning("Ramadan transit hours are now in effect. Bus services pause between 5 PM and 7 PM.")
33
 
34
+ # 2. Remittance
35
+ elif choice == "Remittance (Money)":
36
+ st.header("Money Transfer (Remit)")
37
+ mvr = st.number_input("Enter Maldivian Rufiyaa (MVR)", min_value=0, value=1000)
38
+ npr = mvr * 9.41
39
+ st.success(f"You will receive approx: {npr:,.2f} Nepalese Rupees")
40
+ st.markdown("---")
41
+ st.write("📍 **Recommended Centers:** Prabhu Money Transfer, IME, and BML.")
 
 
 
 
42
 
43
+ # 3. Bus & Ferry
44
+ elif choice == "Bus & Ferry":
45
+ st.header("Transit & Transportation")
46
+ st.write("Current RTL Bus Schedules for Male-Hulhumale:")
47
+ df = pd.DataFrame({
48
+ "Route": ["R1 (Phase 1)", "R2 (Phase 2)", "R7 (Bridge)", "Ferry"],
49
+ "Status": ["Running", "Running", "Limited", "Running"],
50
+ "Price": ["MVR 15", "MVR 15", "MVR 10", "MVR 10"]
51
+ })
52
+ st.table(df)
53
+
54
+ # 4. Legal & Visa
55
+ elif choice == "Legal & Visa":
56
+ st.header("Legal Help & Work Permits")
57
+ st.write("Ensure your employer has paid the 'Quota Fee' in the Xpat portal.")
58
+ st.error("Report issues: If your passport is withheld, contact the Labor Relations Authority (LRA).")
59
 
60
+ # 5. Emergency
61
+ elif choice == "Emergency":
62
+ st.header("🆘 Emergency Contacts")
63
+ st.markdown("""
64
+ - **Police:** 119
65
+ - **Ambulance:** 102
66
+ - **Fire:** 118
67
+ - **Nepal Consular Help:** +94 11 268 9656 (via Colombo)
68
+ """)
69
 
70
+ if __name__ == "__main__":
71
+ main()