Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,75 +4,226 @@ import gradio as gr
|
|
| 4 |
|
| 5 |
CUSTOM_CSS = """
|
| 6 |
body {
|
| 7 |
-
background:
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
.gradio-container {
|
| 11 |
-
max-width:
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
|
| 15 |
-
.hero {
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
background: linear-gradient(135deg, #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
color: white;
|
| 20 |
-
box-shadow: 0 12px 30px rgba(19, 59, 44, 0.18);
|
| 21 |
-
margin-bottom: 12px;
|
| 22 |
}
|
| 23 |
|
| 24 |
-
.
|
| 25 |
-
|
| 26 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
-
.hero
|
| 30 |
-
|
| 31 |
-
font-size: 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
line-height: 1.6;
|
| 33 |
-
|
| 34 |
}
|
| 35 |
|
| 36 |
-
.
|
| 37 |
-
|
| 38 |
-
gap: 10px;
|
| 39 |
-
flex-wrap: wrap;
|
| 40 |
-
margin-top: 14px;
|
| 41 |
}
|
| 42 |
|
| 43 |
-
.
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 49 |
}
|
| 50 |
|
| 51 |
-
.
|
| 52 |
-
background:
|
| 53 |
-
border: 1px solid #
|
| 54 |
border-radius: 18px;
|
| 55 |
-
padding:
|
| 56 |
-
box-shadow: 0 10px 24px rgba(60, 50, 30, 0.07);
|
| 57 |
}
|
| 58 |
|
| 59 |
-
.
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
| 63 |
}
|
| 64 |
|
| 65 |
-
.
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
background: #f3f8f5;
|
| 69 |
-
border: 1px solid #d7e6dd;
|
| 70 |
-
color: #264635;
|
| 71 |
-
font-size: 0.94rem;
|
| 72 |
}
|
| 73 |
|
| 74 |
textarea {
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
"""
|
| 78 |
|
|
@@ -426,62 +577,118 @@ def generate_documents(notes):
|
|
| 426 |
|
| 427 |
with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
|
| 428 |
gr.HTML("""
|
| 429 |
-
<div class="hero">
|
| 430 |
-
<
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
<
|
| 437 |
-
<div class="
|
| 438 |
-
|
| 439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
</div>
|
| 441 |
</div>
|
| 442 |
""")
|
| 443 |
|
| 444 |
-
with gr.Row():
|
| 445 |
with gr.Column(scale=5):
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 470 |
|
| 471 |
with gr.Column(scale=7):
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
|
| 486 |
generate_btn.click(
|
| 487 |
fn=generate_documents,
|
|
|
|
| 4 |
|
| 5 |
CUSTOM_CSS = """
|
| 6 |
body {
|
| 7 |
+
background:
|
| 8 |
+
radial-gradient(circle at top left, rgba(230, 244, 234, 0.9), transparent 28%),
|
| 9 |
+
radial-gradient(circle at bottom right, rgba(255, 232, 214, 0.85), transparent 30%),
|
| 10 |
+
linear-gradient(180deg, #f6f8f4 0%, #eef3ee 100%);
|
| 11 |
}
|
| 12 |
|
| 13 |
.gradio-container {
|
| 14 |
+
max-width: 1280px !important;
|
| 15 |
+
padding-top: 24px !important;
|
| 16 |
+
padding-bottom: 36px !important;
|
| 17 |
+
font-family: "Segoe UI", "Helvetica Neue", sans-serif !important;
|
| 18 |
}
|
| 19 |
|
| 20 |
+
.hero-shell {
|
| 21 |
+
border-radius: 28px;
|
| 22 |
+
overflow: hidden;
|
| 23 |
+
background: linear-gradient(135deg, #103b2d 0%, #1e5c47 55%, #f1c46b 140%);
|
| 24 |
+
box-shadow: 0 24px 60px rgba(18, 54, 41, 0.16);
|
| 25 |
+
margin-bottom: 22px;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.hero-inner {
|
| 29 |
+
padding: 38px 36px 30px 36px;
|
| 30 |
color: white;
|
|
|
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
+
.eyebrow {
|
| 34 |
+
display: inline-block;
|
| 35 |
+
font-size: 0.82rem;
|
| 36 |
+
font-weight: 700;
|
| 37 |
+
letter-spacing: 0.08em;
|
| 38 |
+
text-transform: uppercase;
|
| 39 |
+
padding: 8px 12px;
|
| 40 |
+
border-radius: 999px;
|
| 41 |
+
background: rgba(255, 255, 255, 0.14);
|
| 42 |
+
margin-bottom: 18px;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.hero-title {
|
| 46 |
+
font-size: 3rem;
|
| 47 |
+
line-height: 1.05;
|
| 48 |
+
font-weight: 800;
|
| 49 |
+
margin: 0 0 14px 0;
|
| 50 |
+
letter-spacing: -0.03em;
|
| 51 |
}
|
| 52 |
|
| 53 |
+
.hero-subtitle {
|
| 54 |
+
max-width: 860px;
|
| 55 |
+
font-size: 1.08rem;
|
| 56 |
+
line-height: 1.75;
|
| 57 |
+
color: rgba(255, 255, 255, 0.92);
|
| 58 |
+
margin-bottom: 22px;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.hero-grid {
|
| 62 |
+
display: grid;
|
| 63 |
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
| 64 |
+
gap: 12px;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.hero-stat {
|
| 68 |
+
background: rgba(255, 255, 255, 0.12);
|
| 69 |
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
| 70 |
+
border-radius: 18px;
|
| 71 |
+
padding: 14px 16px;
|
| 72 |
+
backdrop-filter: blur(6px);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.hero-stat strong {
|
| 76 |
+
display: block;
|
| 77 |
+
font-size: 1rem;
|
| 78 |
+
margin-bottom: 4px;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.hero-stat span {
|
| 82 |
+
font-size: 0.9rem;
|
| 83 |
+
color: rgba(255, 255, 255, 0.85);
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.panel {
|
| 87 |
+
background: rgba(255, 255, 255, 0.84);
|
| 88 |
+
border: 1px solid rgba(27, 71, 54, 0.08);
|
| 89 |
+
border-radius: 24px;
|
| 90 |
+
box-shadow: 0 14px 40px rgba(40, 61, 51, 0.08);
|
| 91 |
+
overflow: hidden;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.panel-head {
|
| 95 |
+
padding: 22px 24px 10px 24px;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.panel-title {
|
| 99 |
+
font-size: 1.35rem;
|
| 100 |
+
font-weight: 800;
|
| 101 |
+
color: #153f31;
|
| 102 |
+
margin: 0 0 6px 0;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.panel-copy {
|
| 106 |
+
color: #52645d;
|
| 107 |
+
font-size: 0.98rem;
|
| 108 |
line-height: 1.6;
|
| 109 |
+
margin: 0;
|
| 110 |
}
|
| 111 |
|
| 112 |
+
.panel-body {
|
| 113 |
+
padding: 0 24px 24px 24px;
|
|
|
|
|
|
|
|
|
|
| 114 |
}
|
| 115 |
|
| 116 |
+
.metric-strip {
|
| 117 |
+
display: grid;
|
| 118 |
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
| 119 |
+
gap: 12px;
|
| 120 |
+
margin-bottom: 18px;
|
|
|
|
| 121 |
}
|
| 122 |
|
| 123 |
+
.metric-card {
|
| 124 |
+
background: linear-gradient(180deg, #ffffff 0%, #f6fbf7 100%);
|
| 125 |
+
border: 1px solid #dde9e0;
|
| 126 |
border-radius: 18px;
|
| 127 |
+
padding: 16px;
|
|
|
|
| 128 |
}
|
| 129 |
|
| 130 |
+
.metric-card strong {
|
| 131 |
+
display: block;
|
| 132 |
+
color: #1a4d3c;
|
| 133 |
+
font-size: 1.25rem;
|
| 134 |
+
margin-bottom: 4px;
|
| 135 |
}
|
| 136 |
|
| 137 |
+
.metric-card span {
|
| 138 |
+
color: #61746c;
|
| 139 |
+
font-size: 0.92rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
}
|
| 141 |
|
| 142 |
textarea {
|
| 143 |
+
background: #fcfdfb !important;
|
| 144 |
+
border: 1px solid #dbe7de !important;
|
| 145 |
+
border-radius: 18px !important;
|
| 146 |
+
font-size: 1rem !important;
|
| 147 |
+
color: #20332b !important;
|
| 148 |
+
box-shadow: none !important;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
textarea:focus {
|
| 152 |
+
border: 1px solid #2a7a5c !important;
|
| 153 |
+
box-shadow: 0 0 0 3px rgba(42, 122, 92, 0.12) !important;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
button.primary {
|
| 157 |
+
background: linear-gradient(135deg, #16543f 0%, #247458 100%) !important;
|
| 158 |
+
color: white !important;
|
| 159 |
+
border: none !important;
|
| 160 |
+
border-radius: 16px !important;
|
| 161 |
+
min-height: 48px !important;
|
| 162 |
+
font-weight: 700 !important;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
button.secondary {
|
| 166 |
+
background: white !important;
|
| 167 |
+
color: #1b4c3c !important;
|
| 168 |
+
border: 1px solid #d4e2d8 !important;
|
| 169 |
+
border-radius: 16px !important;
|
| 170 |
+
min-height: 48px !important;
|
| 171 |
+
font-weight: 700 !important;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.tabs {
|
| 175 |
+
border: none !important;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.tab-nav {
|
| 179 |
+
gap: 8px !important;
|
| 180 |
+
padding: 0 24px !important;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.tab-nav button {
|
| 184 |
+
border-radius: 999px !important;
|
| 185 |
+
border: 1px solid #d7e3da !important;
|
| 186 |
+
background: white !important;
|
| 187 |
+
color: #355347 !important;
|
| 188 |
+
font-weight: 700 !important;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
.tab-nav button.selected {
|
| 192 |
+
background: linear-gradient(135deg, #e8f5ed 0%, #f7fbf8 100%) !important;
|
| 193 |
+
color: #174735 !important;
|
| 194 |
+
border-color: #b7d8c3 !important;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
.prose, .prose * {
|
| 198 |
+
color: #1d2f28 !important;
|
| 199 |
+
line-height: 1.7 !important;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
.prose h1, .prose h2, .prose h3 {
|
| 203 |
+
color: #163f31 !important;
|
| 204 |
+
font-weight: 800 !important;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.footer-banner {
|
| 208 |
+
margin-top: 18px;
|
| 209 |
+
background: linear-gradient(135deg, #fffdf8 0%, #eef7f1 100%);
|
| 210 |
+
border: 1px solid #d9e6dd;
|
| 211 |
+
border-radius: 22px;
|
| 212 |
+
padding: 18px 22px;
|
| 213 |
+
color: #355247;
|
| 214 |
+
font-size: 0.96rem;
|
| 215 |
+
line-height: 1.6;
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
@media (max-width: 900px) {
|
| 219 |
+
.hero-title {
|
| 220 |
+
font-size: 2.2rem;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
.hero-grid,
|
| 224 |
+
.metric-strip {
|
| 225 |
+
grid-template-columns: 1fr;
|
| 226 |
+
}
|
| 227 |
}
|
| 228 |
"""
|
| 229 |
|
|
|
|
| 577 |
|
| 578 |
with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
|
| 579 |
gr.HTML("""
|
| 580 |
+
<div class="hero-shell">
|
| 581 |
+
<div class="hero-inner">
|
| 582 |
+
<div class="eyebrow">Business Analyst Portfolio Project</div>
|
| 583 |
+
<h1 class="hero-title">Agentic BA</h1>
|
| 584 |
+
<p class="hero-subtitle">
|
| 585 |
+
Transform rough stakeholder notes into a structured Business Requirements Document,
|
| 586 |
+
polished BDD-style user stories, and a recruiter-friendly before-vs-after showcase.
|
| 587 |
+
</p>
|
| 588 |
+
<div class="hero-grid">
|
| 589 |
+
<div class="hero-stat">
|
| 590 |
+
<strong>Structured Output</strong>
|
| 591 |
+
<span>Turns raw notes into clean BA deliverables</span>
|
| 592 |
+
</div>
|
| 593 |
+
<div class="hero-stat">
|
| 594 |
+
<strong>100% Free</strong>
|
| 595 |
+
<span>No paid APIs or subscriptions required</span>
|
| 596 |
+
</div>
|
| 597 |
+
<div class="hero-stat">
|
| 598 |
+
<strong>Public Demo</strong>
|
| 599 |
+
<span>Easy to share with recruiters and hiring teams</span>
|
| 600 |
+
</div>
|
| 601 |
+
<div class="hero-stat">
|
| 602 |
+
<strong>Portfolio Ready</strong>
|
| 603 |
+
<span>Shows BA thinking and workflow automation</span>
|
| 604 |
+
</div>
|
| 605 |
+
</div>
|
| 606 |
</div>
|
| 607 |
</div>
|
| 608 |
""")
|
| 609 |
|
| 610 |
+
with gr.Row(equal_height=True):
|
| 611 |
with gr.Column(scale=5):
|
| 612 |
+
gr.HTML("""
|
| 613 |
+
<div class="panel">
|
| 614 |
+
<div class="panel-head">
|
| 615 |
+
<h2 class="panel-title">Input Workspace</h2>
|
| 616 |
+
<p class="panel-copy">
|
| 617 |
+
Paste stakeholder notes, interview summaries, or rough business observations.
|
| 618 |
+
The app will turn them into cleaner BA documentation.
|
| 619 |
+
</p>
|
| 620 |
+
</div>
|
| 621 |
+
<div class="panel-body">
|
| 622 |
+
""")
|
| 623 |
+
|
| 624 |
+
gr.HTML("""
|
| 625 |
+
<div class="metric-strip">
|
| 626 |
+
<div class="metric-card">
|
| 627 |
+
<strong>BRD</strong>
|
| 628 |
+
<span>Formal structure from messy notes</span>
|
| 629 |
+
</div>
|
| 630 |
+
<div class="metric-card">
|
| 631 |
+
<strong>BDD Stories</strong>
|
| 632 |
+
<span>User-focused requirements output</span>
|
| 633 |
+
</div>
|
| 634 |
+
<div class="metric-card">
|
| 635 |
+
<strong>Before/After</strong>
|
| 636 |
+
<span>Clear showcase for LinkedIn and interviews</span>
|
| 637 |
+
</div>
|
| 638 |
+
</div>
|
| 639 |
+
""")
|
| 640 |
+
|
| 641 |
+
notes_input = gr.Textbox(
|
| 642 |
+
lines=16,
|
| 643 |
+
label="Raw Stakeholder Notes",
|
| 644 |
+
placeholder="Example: Customers are abandoning carts before payment. Stakeholders want easier checkout, UPI, cards, wallets, guest checkout, mobile-friendly flow, and fewer support issues."
|
| 645 |
+
)
|
| 646 |
+
|
| 647 |
+
with gr.Row():
|
| 648 |
+
generate_btn = gr.Button("Generate BA Documents", variant="primary")
|
| 649 |
+
clear_btn = gr.Button("Reset", variant="secondary")
|
| 650 |
+
|
| 651 |
+
gr.Examples(
|
| 652 |
+
examples=[
|
| 653 |
+
["Customers are abandoning carts before payment. They want easier checkout, UPI, cards, wallets, mobile-friendly pages, guest checkout, and fewer support issues."],
|
| 654 |
+
["Hospital reception staff say patient registration is slow. They want OTP verification, fewer manual steps, tablet support, and a simple dashboard for receptionists."],
|
| 655 |
+
["Users find login confusing. Stakeholders want optional sign-in where possible, a simpler user flow, faster completion, and fewer helpdesk calls."]
|
| 656 |
+
],
|
| 657 |
+
inputs=notes_input,
|
| 658 |
+
label="Try Sample Inputs"
|
| 659 |
+
)
|
| 660 |
+
|
| 661 |
+
gr.HTML("</div></div>")
|
| 662 |
|
| 663 |
with gr.Column(scale=7):
|
| 664 |
+
gr.HTML("""
|
| 665 |
+
<div class="panel">
|
| 666 |
+
<div class="panel-head">
|
| 667 |
+
<h2 class="panel-title">Recruiter View</h2>
|
| 668 |
+
<p class="panel-copy">
|
| 669 |
+
Review the same notes as a business-ready output. This layout is designed to show
|
| 670 |
+
documentation thinking, structure, and portfolio value quickly.
|
| 671 |
+
</p>
|
| 672 |
+
</div>
|
| 673 |
+
""")
|
| 674 |
+
|
| 675 |
+
with gr.Tabs():
|
| 676 |
+
with gr.Tab("Business Requirements Document"):
|
| 677 |
+
brd_output = gr.Markdown()
|
| 678 |
+
with gr.Tab("BDD User Stories"):
|
| 679 |
+
stories_output = gr.Markdown()
|
| 680 |
+
with gr.Tab("Before vs After"):
|
| 681 |
+
before_after_output = gr.Markdown()
|
| 682 |
+
|
| 683 |
+
gr.HTML("</div>")
|
| 684 |
+
|
| 685 |
+
gr.HTML("""
|
| 686 |
+
<div class="footer-banner">
|
| 687 |
+
<strong>Why this project stands out:</strong> Agentic BA shows how unstructured business input
|
| 688 |
+
can be converted into formal project documentation through workflow automation. It is built to
|
| 689 |
+
be easy to demo, easy to explain, and easy to share on LinkedIn or in job applications.
|
| 690 |
+
</div>
|
| 691 |
+
""")
|
| 692 |
|
| 693 |
generate_btn.click(
|
| 694 |
fn=generate_documents,
|