""" app.py — DOBI (Digital Organisational Brain & Insight) ==================================================================== WHAT THIS FILE IS: the main entry point. Hugging Face runs this file to start the app. Everything the user sees begins here. WHAT IT DOES: sets up the page, the sidebar (logo, navigation) and the four screens — Ask, Library, What's missing, and Admin — and hands off to the matching view in pages_ui.py. There is NO login: anyone with the link can ask questions and browse. The Admin screen asks for a password before it shows any add/edit/delete tools (see pages_ui.view_admin). HOW IT FITS: pages_ui.py (screens) · search.py (answers, via pages_ui) · supabase_client.py (database connection). The look comes from .streamlit/config.toml (Think City colours, light theme). FOR WHOEVER TAKES OVER: admin write access is protected by a single password stored as the ADMIN_PASSWORD Space secret. auth.py is unused. ==================================================================== """ import os import streamlit as st from pages_ui import view_search, view_library, view_gaps, view_admin _ICON = os.path.join(os.path.dirname(__file__), "dobi-icon.png") st.set_page_config( page_title="DOBI", page_icon=_ICON if os.path.exists(_ICON) else "🧺", layout="wide", # room for the sources rail; widths capped in CSS initial_sidebar_state="expanded", ) # ---- Look and feel (Think City palette; one bold element: the facade band) ---- st.markdown( """ """, unsafe_allow_html=True, ) # ---- Sidebar: identity, then navigation ---- with st.sidebar: if os.path.exists(_ICON): st.image(_ICON, width=56) st.markdown("**DOBI** \nThink City's knowledge library") st.divider() pages = { "": [ st.Page(view_search, title="Ask", icon=":material/search:", url_path="ask", default=True), st.Page(view_library, title="Library", icon=":material/menu_book:", url_path="library"), st.Page(view_gaps, title="What's missing", icon=":material/help_outline:", url_path="missing"), ], "Manage": [ st.Page(view_admin, title="Admin", icon=":material/lock:", url_path="admin"), ], } st.navigation(pages, position="sidebar").run()