00dc7f2bcb
- New page 06_dev_preview.py: interactive ML model showcase - All 12 models initialized from synthetic data with live charts - Live Auction Simulator: bandit + opponent model + budget optimizer - Tabbed UI: 6 tabs, one per phase - Resilient warehouse: returns typed empty DataFrames when no data - Dev Preview set as default landing page for demo mode - Live at http://localhost:8507
65 lines
1.9 KiB
Python
65 lines
1.9 KiB
Python
"""Fantabeto 26/27 Dashboard — Project Al-Cihred.
|
|
|
|
Multi-page Streamlit app. Run with: streamlit run dashboard/app.py
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Ensure project root is on path so 'dashboard' imports resolve
|
|
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
|
if str(PROJECT_ROOT) not in sys.path:
|
|
sys.path.insert(0, str(PROJECT_ROOT))
|
|
|
|
import streamlit as st
|
|
|
|
from dashboard.viz.components import inject_css
|
|
|
|
# Register the custom Plotly template
|
|
from dashboard.viz.template import stub_render # triggers template registration
|
|
|
|
PAGES = {
|
|
"🔬 Dev Preview": "dashboard.pages.06_dev_preview",
|
|
"⚽ Matchday": "dashboard.pages.01_matchday",
|
|
"👤 Players": "dashboard.pages.02_players",
|
|
"💰 Auction": "dashboard.pages.03_auction",
|
|
"📋 Lineup": "dashboard.pages.04_lineup",
|
|
"🧪 Model Lab": "dashboard.pages.05_lab",
|
|
}
|
|
|
|
|
|
def main():
|
|
st.set_page_config(
|
|
page_title="Fantabeto 26/27 — Project Al-Cihred",
|
|
page_icon="⚽",
|
|
layout="wide",
|
|
initial_sidebar_state="expanded",
|
|
)
|
|
inject_css()
|
|
|
|
st.sidebar.markdown("""
|
|
<div style="font-family:'Space Grotesk',sans-serif;font-size:22px;font-weight:700;color:#E5E7EB;margin-bottom:4px;">
|
|
⚽ FANTABETO
|
|
</div>
|
|
<div style="font-family:'Inter',sans-serif;font-size:11px;color:#9CA3AF;margin-bottom:16px;text-transform:uppercase;letter-spacing:1px;">
|
|
Project Al-Cihred · 26/27
|
|
</div>
|
|
""", unsafe_allow_html=True)
|
|
|
|
page = st.sidebar.radio("Navigation", list(PAGES.keys()), label_visibility="collapsed")
|
|
|
|
st.sidebar.divider()
|
|
st.sidebar.caption("Fantacalcio Bayesian Estimated Team's Outcome")
|
|
st.sidebar.caption("v2.0 · August 2026")
|
|
st.sidebar.caption("Data: Fantacalcio.it · FBref · api-football")
|
|
|
|
# Route to selected page
|
|
module_name = PAGES[page]
|
|
import importlib
|
|
mod = importlib.import_module(module_name)
|
|
mod.run()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|