"""
BnParte – Strategic BA Command Center (Light Theme with External HTML Files)
Built with ❤️ and ☀️ by Sai Varakala · Techno‑Agilist · Scrum Master @ TCS
© 2026 Sai Varakala · MIT License
"""
import gradio as gr
import random
from datetime import datetime
import os
# ============================================================================
# Read HTML files from disk (saved in the same Space)
# ============================================================================
def load_html_file(filename):
"""Read HTML content from file, return error message if not found"""
try:
with open(filename, 'r', encoding='utf-8') as f:
return f.read()
except FileNotFoundError:
return f"""
📄
File not found: {filename}
Please upload this file to your Space.
"""
except Exception as e:
return f"""
Error loading {filename}
{str(e)}
"""
# Load your HTML files (they should be in the same directory as app.py)
PROTOTYPE_HTML = load_html_file("BnParte-prototype.html")
TECH_DOCS_HTML = load_html_file("BnParte-v1-Technical_Documentation.html")
# ============================================================================
# Napoleon Quote Game Content (Same as before)
# ============================================================================
NAPOLEON_QUOTES = [
"Victory belongs to the most persevering.",
"Impossible is a word to be found only in the dictionary of fools.",
"Courage isn't having the strength to go on; it is going on when you don't have strength.",
"A leader is a dealer in hope.",
"The battlefield is a scene of constant chaos. The winner will be the one who controls that chaos.",
"Take time to deliberate, but when the time for action arrives, stop thinking and go in.",
"Glory is fleeting, but obscurity is forever.",
"There are only two forces that unite men — fear and interest.",
"The art of government is not to let men grow stale.",
"A throne is only a bench covered with velvet.",
"Religion is excellent stuff for keeping common people quiet."
]
HONEY_TIPS = [
"🐝 The queen bee never works alone – delegate and trust your team.",
"🍯 Every great campaign is built from small, daily actions. Just like honey from nectar.",
"⚔️ Napoleon's 'Corps d'armée' was a honeycomb of self-sufficient units. Structure your requirements similarly.",
"👑 One Queen, one vision. Keep your strategic goal aligned across every cell of the hive.",
"📡 Bee Stings are fast and decisive. Use alerts to catch risks early.",
"🌻 The golden bee on Napoleon's coronation robe symbolized resurrection and industry – your projects can rise again."
]
EAGLE_QUOTES = [
"🦅 The eagle does not catch flies. Focus on the strategic, not the trivial.",
"🦅 Napoleon's eagle looked down from every flag – your dashboard should give you that high-altitude view.",
"🦅 An eagle never fears the storm – it uses it to rise higher."
]
def get_random_quote():
return (random.choice(NAPOLEON_QUOTES), random.choice(HONEY_TIPS), random.choice(EAGLE_QUOTES))
def update_display():
quote, honey, eagle = get_random_quote()
timestamp = datetime.now().strftime("%H:%M:%S")
return f"""
🐝⚜️🦅
BnParte · Imperial Intelligence
“{quote}”
🍯 HoneyTip: {honey}
{eagle}
⚔️ Last update: {timestamp}
🚧 Full RAG-powered BA Dashboard under construction – new tokens & Gist being prepared.
"""
# ============================================================================
# Gradio App with Multiple Tabs
# ============================================================================
# Custom light theme
light_theme = gr.themes.Soft(
primary_hue="amber",
secondary_hue="stone",
neutral_hue="gray",
font=gr.themes.GoogleFont("Inter"),
).set(
body_background_fill="*neutral_50",
block_background_fill="white",
)
with gr.Blocks(title="BnParte – BA Command Center", theme=light_theme) as demo:
gr.HTML("""
⚔️ BnParte ⚔️
Napoleon-inspired Strategic Command Center
""")
# Create tabs
with gr.Tabs():
# Tab 1: Interactive Teaser (Napoleon Quotes Game)
with gr.TabItem("🐝 Interactive Teaser"):
quote_display = gr.HTML(value=update_display())
refresh_btn = gr.Button("🐝 New Napoleonic Insight", variant="primary", size="lg")
refresh_btn.click(fn=update_display, outputs=quote_display)
gr.Markdown("""
---
### 🚧 What's being built?
- **RAG-powered knowledge base** – ingest documents, transcripts, chats
- **Hive Mind dashboard** – AI extracts risks, decisions, action items
- **Daily chatter feed** – one-liners from team and leadership
- **Bee Stings alerts** & **HoneyTips** contextual suggestions
- **Kanban + Timeline** integrated with vector search
> Full version coming soon with ChromaDB + Groq + GitHub Gist sync.
""")
# Tab 2: Prototype Mockup (Your HTML wireframe)
with gr.TabItem("📊 Prototype Dashboard"):
gr.HTML(PROTOTYPE_HTML)
# Tab 3: Technical Documentation
with gr.TabItem("📘 Technical Documentation"):
gr.HTML(TECH_DOCS_HTML)
# Footer
gr.HTML("""
Built with ❤️ and ☀️ by Sai Varakala · Techno‑Agilist · Scrum Master @ TCS
© 2026 · MIT License · Inspired by Napoleon's golden bee and the eagle of victory.
""")
if __name__ == "__main__":
demo.launch()