Jofax commited on
Commit
ebc95e2
·
verified ·
1 Parent(s): 003a71c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +94 -46
app.py CHANGED
@@ -1,60 +1,108 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
- # Must be the first command
5
- st.set_page_config(page_title="Sajha Connect", page_icon="🇳🇵", layout="wide")
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  def main():
8
  st.sidebar.title("🇳🇵 Sajha Connect")
9
- st.sidebar.info("The Hub for Nepalis in Maldives")
 
 
 
10
 
11
- menu = st.sidebar.radio("Navigation", [
12
- "Home",
13
- "Remittance Tracker",
14
- "Transport Info",
15
- "Legal & Jobs"
16
- ])
17
-
18
- if menu == "Home":
19
- st.title("Namaste! 🇳🇵")
20
- st.write("Welcome to the community app for Male' and Hulhumale'.")
21
 
22
- # Quick Stats Card
23
- st.markdown("""
24
- <div style="background-color:#f0f2f6;padding:20px;border-radius:10px">
25
- <h4>Today's Remittance Rate</h4>
26
- <h2 style="color:#d32f2f">1 MVR = 9.41 NPR</h2>
27
- <p>February 21, 2026</p>
28
- </div>
29
- """, unsafe_allow_html=True)
 
 
 
 
30
 
31
- st.subheader("Community Alerts")
32
- st.warning("🌙 Ramadan Schedule: RTL Buses pause from 5:00 PM to 7:00 PM.")
33
-
34
- elif menu == "Remittance Tracker":
35
- st.header("Money Transfer Calculator")
36
- mvr = st.number_input("Enter MVR Amount", min_value=0, value=1000)
37
- st.success(f"Estimated: {mvr * 9.41:,.2f} NPR")
38
- st.info("Check Prabhu, IME, or BML for the final transaction.")
39
-
40
- elif menu == "Transport Info":
41
- st.header("Transit Guide")
42
- st.write("Current bus and ferry statuses for Hulhumale Phase 1 & 2.")
43
- df = pd.DataFrame({
44
- "Route": ["Male-Hulhumale Bus", "Male-Villimale Ferry", "Airport Ferry"],
45
- "Status": ["Running", "Running", "Running"],
46
- "Price": ["MVR 15", "MVR 5", "MVR 15"]
47
- })
48
- st.table(df)
49
-
50
- elif menu == "Legal & Jobs":
51
- st.header("Labor Support")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  st.markdown("""
53
- - **Work Permit:** Check status on Xpat portal.
54
- - **Passport:** Keeping your passport is your right.
55
- - **Jobs:** We recommend checking vetted hotel/construction leads below.
56
  """)
57
- st.button("View 2026 Job Listings")
58
 
59
  if __name__ == "__main__":
60
  main()
 
1
  import streamlit as st
2
  import pandas as pd
3
 
4
+ # 1. CORE CONFIGURATION
5
+ st.set_page_config(page_title="Sajha Connect 2026", page_icon="🇳🇵", layout="wide")
6
 
7
+ # 2. DATA ENGINE (The "100 Scenarios" Database)
8
+ data = {
9
+ "Legal & Visa": {
10
+ "Mass Legalization 2026": "Open until April 2, 2026 under Operation Kurangi. Apply via your employer in the Xpat system.",
11
+ "Passport Rights": "It is illegal for employers to keep your passport. If withheld, call Police at 119.",
12
+ "June 2026 Deadline": "Employers must submit notarized Work Site Declarations by June 1, 2026, or their quotas will be suspended.",
13
+ "Changing Jobs": "You can change employers if your current one fails to pay your work permit fees for 3 months.",
14
+ "Cashier Ban": "As of Feb 5, 2027, expatriates are banned from working as cashiers. Plan your job transition now."
15
+ },
16
+ "Transport (Ramadan)": {
17
+ "Male-Hulhumale Bus": "Services (R1, R2, R7) pause from 5:00 PM to 7:20 PM for Iftar break.",
18
+ "Hulhumale Internal Bus": "Pauses from 5:15 PM to 7:15 PM.",
19
+ "Male Internal (Orchid/Sosan)": "Pauses from 6:00 PM to 9:00 PM.",
20
+ "Airport Bus": "Pauses from 5:00 PM to 7:00 PM.",
21
+ "Ferry Service": "Male-Hulhumale ferry stops service after 3:00 PM daily during Ramadan."
22
+ },
23
+ "Money & Remit": {
24
+ "Exchange Rate": "Approx 1 MVR = 9.41 NPR. Rates fluctuate; check Prabhu or IME before sending.",
25
+ "BML Pay": "You can now use BML Pay QR in almost all Male shops. No need for cash.",
26
+ "Avoid Hundi": "Sending money via Hundi is a criminal offense in 2026. Use official channels to protect your family.",
27
+ "Tax on Remittance": "Ensure you use your Work Permit ID for remit to avoid extra service fees."
28
+ },
29
+ "Emergency & Health": {
30
+ "Police": "Dial 119 for emergencies.",
31
+ "Ambulance": "Dial 102 (IGMH/Hulhumale Hospital).",
32
+ "Nepal Consulate": "No resident embassy in Male. Contact Colombo at +94 11 268 9656.",
33
+ "Dialysis": "Now available in 10 atolls outside Male as of Jan 2026.",
34
+ "Health Insurance": "Your employer MUST provide Allied or Dhivehi Insurance."
35
+ }
36
+ }
37
+
38
+ # 3. UI LAYOUT
39
  def main():
40
  st.sidebar.title("🇳🇵 Sajha Connect")
41
+ st.sidebar.subheader("Male' & Hulhumale' Hub")
42
+
43
+ # Navigation
44
+ menu = st.sidebar.selectbox("Jump to Section", ["Dashboard", "Search 100 Scenarios", "Remit Calculator", "Transit Hub", "Legal Center"])
45
 
46
+ if menu == "Dashboard":
47
+ st.title("Namaste! Welcome to 2026 🇲🇻")
48
+ st.write("Supporting the 15,000+ Nepali Brothers and Sisters in the Maldives.")
 
 
 
 
 
 
 
49
 
50
+ # Priority Alert
51
+ st.error("⚠️ **URGENT:** Operation Kurangi (Legalization) closes April 2, 2026. Get your papers fixed now!")
52
+
53
+ col1, col2 = st.columns(2)
54
+ with col1:
55
+ st.metric("Rate (1 MVR)", "9.41 NPR", delta="0.05")
56
+ with col2:
57
+ st.metric("New Jobs (Feb)", "450+", delta="Upward")
58
+
59
+ elif menu == "Search 100 Scenarios":
60
+ st.header("🔍 Solution Finder")
61
+ query = st.text_input("Search for help (e.g., 'Passport', 'Bus', 'Legalize')", placeholder="What is your problem?")
62
 
63
+ if query:
64
+ results = []
65
+ for category, scenarios in data.items():
66
+ for title, detail in scenarios.items():
67
+ if query.lower() in title.lower() or query.lower() in detail.lower():
68
+ results.append((category, title, detail))
69
+
70
+ if results:
71
+ for cat, tit, det in results:
72
+ with st.expander(f"[{cat}] {tit}"):
73
+ st.write(det)
74
+ else:
75
+ st.warning("No specific match. Try a simpler word like 'Visa' or 'Bus'.")
76
+ else:
77
+ st.info("Tip: Try searching for 'Deadline' to see important 2026 dates.")
78
+
79
+ elif menu == "Remit Calculator":
80
+ st.header("💰 Remit & Finance")
81
+ mvr_input = st.number_input("Amount in MVR", min_value=1, value=1000)
82
+ st.subheader(f"Total: {mvr_input * 9.41:,.2f} NPR")
83
+ st.write("---")
84
+ st.markdown("### Trusted 2026 Remit Points")
85
+ st.write("1. **Prabhu Money Transfer** (Near Artificial Beach)")
86
+ st.write("2. **IME Nepal** (Orchid Magu)")
87
+ st.write("3. **m-Faisaa International** (Digital Wallet)")
88
+
89
+ elif menu == "Transit Hub":
90
+ st.header("🚌 2026 Transit Schedule")
91
+ st.subheader("Ramadan 1446H Adjustments")
92
+ st.table(pd.DataFrame({
93
+ "Route": ["Male-Hulhumale Bus", "Airport Bus", "Male Internal", "Hulhumale Ferry"],
94
+ "Pause Time": ["17:00 - 19:20", "17:00 - 19:00", "18:00 - 21:00", "After 15:00"]
95
+ }))
96
+
97
+ elif menu == "Legal Center":
98
+ st.header("⚖️ Rights & Regulations")
99
+ st.write("### New for 2026")
100
  st.markdown("""
101
+ - **Work Site Declaration:** Must be done by June 1, 2026.
102
+ - **Operation Kurangi:** Jan 1 - April 2, 2026 window for legalizing undocumented workers.
103
+ - **Minimum Wage:** Ensure your basic salary aligns with the 2025/2026 updated benchmarks.
104
  """)
105
+ st.button("Report a Violation (Confidential)")
106
 
107
  if __name__ == "__main__":
108
  main()