import streamlit as st from admin_dashboard import AdminDashboard from banking_assistant import BankingAssistant from banking_model import BankingModelTrainer from ml_banking_model import MLBankingEngine class BankingSystem: def __init__(self): self.ml_engine = MLBankingEngine() self.model_trainer = BankingModelTrainer() self.assistant = BankingAssistant() self.admin = AdminDashboard() self.setup_page_config() self.initialize_session_state() def setup_page_config(self): st.set_page_config( page_title="سیستم بانکداری هوشمند", page_icon="🏦", layout="wide", initial_sidebar_state="expanded" ) def initialize_session_state(self): if 'theme' not in st.session_state: st.session_state.theme = 'light' if 'user_role' not in st.session_state: st.session_state.user_role = 'user' if 'authenticated' not in st.session_state: st.session_state.authenticated = False def render_login(self): st.markdown("""

🏦 سیستم بانکداری هوشمند

لطفا وارد شوید

""", unsafe_allow_html=True) col1, col2, col3 = st.columns([1,2,1]) with col2: username = st.text_input("نام کاربری") password = st.text_input("رمز عبور", type="password") if st.button("ورود"): if username == "admin" and password == "admin": st.session_state.user_role = 'admin' st.session_state.authenticated = True st.experimental_rerun() elif username and password: st.session_state.user_role = 'user' st.session_state.authenticated = True st.experimental_rerun() def render_header(self): st.markdown("""

🏦 سیستم بانکداری هوشمند

""", unsafe_allow_html=True) def main(self): if not st.session_state.authenticated: self.render_login() else: self.render_header() if st.session_state.user_role == 'admin': self.admin.render_dashboard() else: self.assistant.render_chat_interface() if __name__ == "__main__": system = BankingSystem() system.main()