Download app.py from Menixis/Dashboard: direct link, hf CLI and curl.
- Browser
- Download file 7.14 kB
-
https://huggingface.co/spaces/Menixis/Dashboard/resolve/main/app.py
- Command line
-
hf download hf://spaces/Menixis/Dashboard/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Menixis/Dashboard/resolve/main/app.py
7.14 kB
| """ | |
| Procurement Automation — Single-page, dark, minimal. | |
| Click a process tab to see the automation tools for it. | |
| """ | |
| import streamlit as st | |
| st.set_page_config( | |
| page_title="Procurement Automation", | |
| page_icon="⚙️", | |
| layout="wide", | |
| initial_sidebar_state="collapsed", | |
| ) | |
| # ------------------------------------------------------------------ | |
| # Styling | |
| # ------------------------------------------------------------------ | |
| st.markdown( | |
| """ | |
| <style> | |
| /* Page */ | |
| .stApp { background: #0a0a0a; } | |
| .main .block-container { padding-top: 2.5rem; padding-bottom: 4rem; max-width: 1100px; } | |
| #MainMenu, footer, header { visibility: hidden; } | |
| /* Title */ | |
| .title { | |
| color: #fafafa; | |
| font-size: 1.6rem; | |
| font-weight: 600; | |
| letter-spacing: -0.01em; | |
| margin-bottom: 0.25rem; | |
| } | |
| .subtitle { | |
| color: #666; | |
| font-size: 0.9rem; | |
| margin-bottom: 2rem; | |
| } | |
| /* Tabs */ | |
| .stTabs [data-baseweb="tab-list"] { | |
| gap: 4px; | |
| background: transparent; | |
| border-bottom: 1px solid #1f1f1f; | |
| } | |
| .stTabs [data-baseweb="tab"] { | |
| background: transparent; | |
| padding: 10px 16px; | |
| color: #777; | |
| font-weight: 500; | |
| font-size: 0.92rem; | |
| border: none; | |
| border-bottom: 2px solid transparent; | |
| border-radius: 0; | |
| } | |
| .stTabs [aria-selected="true"] { | |
| background: transparent !important; | |
| color: #fafafa !important; | |
| border-bottom: 2px solid #3b82f6 !important; | |
| } | |
| .stTabs [data-baseweb="tab-highlight"] { display: none; } | |
| /* Metric line */ | |
| .metric-line { | |
| color: #888; | |
| font-size: 0.85rem; | |
| margin: 1.5rem 0 1.5rem; | |
| letter-spacing: 0.01em; | |
| } | |
| .metric-line .hl { color: #4ade80; font-weight: 600; } | |
| .metric-line .sep { color: #333; margin: 0 10px; } | |
| /* Tool grid */ | |
| .tool-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); | |
| gap: 10px; | |
| } | |
| .tool-card { | |
| background: #111; | |
| border: 1px solid #1f1f1f; | |
| border-radius: 8px; | |
| padding: 16px; | |
| transition: all 0.15s ease; | |
| cursor: default; | |
| } | |
| .tool-card:hover { | |
| border-color: #3b82f6; | |
| background: #141414; | |
| transform: translateY(-1px); | |
| } | |
| .tool-icon { font-size: 1.2rem; margin-bottom: 8px; } | |
| .tool-name { | |
| color: #fafafa; | |
| font-weight: 600; | |
| font-size: 0.95rem; | |
| margin-bottom: 4px; | |
| } | |
| .tool-desc { | |
| color: #777; | |
| font-size: 0.82rem; | |
| line-height: 1.5; | |
| margin-bottom: 12px; | |
| } | |
| .tool-meta { display: flex; gap: 6px; align-items: center; } | |
| .tool-tag { | |
| background: #1e293b; | |
| color: #93c5fd; | |
| font-size: 0.68rem; | |
| padding: 2px 7px; | |
| border-radius: 3px; | |
| font-weight: 500; | |
| letter-spacing: 0.02em; | |
| } | |
| .tool-phase { | |
| color: #555; | |
| font-size: 0.68rem; | |
| letter-spacing: 0.04em; | |
| } | |
| /* Footer legend */ | |
| .legend { | |
| color: #444; | |
| font-size: 0.72rem; | |
| margin-top: 2.5rem; | |
| padding-top: 1rem; | |
| border-top: 1px solid #1a1a1a; | |
| letter-spacing: 0.02em; | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| # ------------------------------------------------------------------ | |
| # Content | |
| # ------------------------------------------------------------------ | |
| PROCESSES = { | |
| "1.4 · TOR/PR Review": { | |
| "metric": "30 min → 5 min<span class='sep'>·</span><span class='hl'>−83%</span>", | |
| "tools": [ | |
| ("📄", "Document Parser", "Auto-extract scope, budget, deliverables from TOR/PR", "OCR", "P1"), | |
| ("✅", "Validation Engine", "Mandatory fields, budget, MESC, AVL match", "Rules", "P2"), | |
| ("🧠", "Spec Quality Scorer", "Flags ambiguous or incomplete specs", "LLM", "P3"), | |
| ("🔄", "Cross-system Verifier", "SAP MM ↔ DP ↔ SP one-click check", "API", "P2"), | |
| ("📊", "Risk Dashboard", "Auto-prioritizes; routine cases auto-pass", "ML", "P4"), | |
| ], | |
| }, | |
| "2.1.1 · RFQ to Vendors": { | |
| "metric": "60 min → 10 min<span class='sep'>·</span><span class='hl'>−83%</span>", | |
| "tools": [ | |
| ("🎯", "Vendor Recommender", "Ranks vendors by fit, AVL, past performance", "ML", "P3"), | |
| ("📝", "RFQ Generator", "Auto-draft from TOR with dynamic clauses", "Template", "P1"), | |
| ("📤", "Bulk Send & Track", "Send to all vendors, live status board", "Workflow", "P2"), | |
| ("🔔", "Auto-reminder", "T-3 / T-1 nudges, post-deadline escalation", "Workflow", "P2"), | |
| ("🛡️", "Policy Guard", "Blocks send if min-vendors rule not met", "Rules", "P1"), | |
| ], | |
| }, | |
| "2.2 · Quote Review": { | |
| "metric": "90 min → 15 min<span class='sep'>·</span><span class='hl'>−83%</span>", | |
| "tools": [ | |
| ("📑", "PDF Extractor", "Pulls prices, terms, lead time from any quote format", "OCR", "P1"), | |
| ("📊", "Bid Tabulation", "Side-by-side comparison & variance analysis", "Auto-report", "P1"), | |
| ("🔗", "TOR Compliance Matcher", "Line-by-line spec vs response check", "LLM", "P3"), | |
| ("⚠️", "Anomaly Detector", "Pricing outliers, identical bids, collusion signals", "ML", "P3"), | |
| ("📄", "Report Generator", "One-click bid evaluation PDF/Word", "Template", "P2"), | |
| ], | |
| }, | |
| "3.1 · VA / PO / LOI": { | |
| "metric": "75 min → 10 min<span class='sep'>·</span><span class='hl'>−87%</span>", | |
| "tools": [ | |
| ("🧭", "Doc-type Wizard", "VA vs PO vs LOI from policy rules", "Rules", "P1"), | |
| ("📚", "Clause Library", "Smart insertion by risk & procurement type", "Template", "P2"), | |
| ("⚡", "SAP Direct Create", "BAPI integration — no BSA re-entry", "API", "P2"), | |
| ("🚦", "Approval Router", "<5MB OC route · >5MB to นสญ.", "Workflow", "P2"), | |
| ("✍️", "E-signature", "DocuSign / Adobe Sign vendor flow", "Integration", "P2"), | |
| ], | |
| }, | |
| } | |
| # ------------------------------------------------------------------ | |
| # Render | |
| # ------------------------------------------------------------------ | |
| st.markdown('<div class="title">Procurement Automation</div>', unsafe_allow_html=True) | |
| st.markdown( | |
| '<div class="subtitle">Click a process to see its automation tools</div>', | |
| unsafe_allow_html=True, | |
| ) | |
| tabs = st.tabs(list(PROCESSES.keys())) | |
| for tab, (_, data) in zip(tabs, PROCESSES.items()): | |
| with tab: | |
| st.markdown( | |
| f'<div class="metric-line">{data["metric"]}</div>', | |
| unsafe_allow_html=True, | |
| ) | |
| cards = '<div class="tool-grid">' | |
| for icon, name, desc, tag, phase in data["tools"]: | |
| cards += ( | |
| f'<div class="tool-card">' | |
| f'<div class="tool-icon">{icon}</div>' | |
| f'<div class="tool-name">{name}</div>' | |
| f'<div class="tool-desc">{desc}</div>' | |
| f'<div class="tool-meta">' | |
| f'<span class="tool-tag">{tag}</span>' | |
| f'<span class="tool-phase">{phase}</span>' | |
| f'</div></div>' | |
| ) | |
| cards += "</div>" | |
| st.markdown(cards, unsafe_allow_html=True) | |
| st.markdown( | |
| '<div class="legend">P1: 0–3 mo · P2: 3–6 mo · ' | |
| "P3: 6–12 mo · P4: 12+ mo</div>", | |
| unsafe_allow_html=True, | |
| ) | |