bandenamaj commited on
Commit
3f323a0
·
verified ·
1 Parent(s): c9f790c

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +297 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Bill Processing System Design
3
- emoji: 🐢
4
- colorFrom: red
5
- colorTo: blue
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: bill-processing-system-design
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,297 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Bill Processing System Design</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ .diagram-container {
12
+ background-color: #f8fafc;
13
+ border-radius: 0.5rem;
14
+ padding: 1.5rem;
15
+ margin-bottom: 2rem;
16
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
17
+ overflow-x: auto;
18
+ }
19
+ .tab-content {
20
+ display: none;
21
+ }
22
+ .tab-content.active {
23
+ display: block;
24
+ }
25
+ .nav-tabs .active {
26
+ border-bottom: 3px solid #3b82f6;
27
+ color: #3b82f6;
28
+ font-weight: 600;
29
+ }
30
+ .code-block {
31
+ background-color: #1e293b;
32
+ color: #f8fafc;
33
+ padding: 1rem;
34
+ border-radius: 0.375rem;
35
+ font-family: monospace;
36
+ overflow-x: auto;
37
+ }
38
+ .component-card {
39
+ transition: all 0.3s ease;
40
+ }
41
+ .component-card:hover {
42
+ transform: translateY(-2px);
43
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
44
+ }
45
+ [data-tooltip] {
46
+ position: relative;
47
+ cursor: pointer;
48
+ }
49
+ [data-tooltip]:hover::before {
50
+ content: attr(data-tooltip);
51
+ position: absolute;
52
+ bottom: 100%;
53
+ left: 50%;
54
+ transform: translateX(-50%);
55
+ background-color: #1e293b;
56
+ color: white;
57
+ padding: 0.5rem 1rem;
58
+ border-radius: 0.375rem;
59
+ white-space: nowrap;
60
+ font-size: 0.875rem;
61
+ margin-bottom: 0.5rem;
62
+ z-index: 10;
63
+ }
64
+ .mermaid-error {
65
+ color: #ef4444;
66
+ background-color: #fee2e2;
67
+ padding: 1rem;
68
+ border-radius: 0.375rem;
69
+ font-family: monospace;
70
+ }
71
+ </style>
72
+ </head>
73
+ <body class="bg-gray-50">
74
+ <div class="container mx-auto px-4 py-8 max-w-7xl">
75
+ <!-- Header -->
76
+ <header class="mb-12 text-center">
77
+ <h1 class="text-4xl font-bold text-gray-800 mb-2">Bill Processing System</h1>
78
+ <p class="text-xl text-gray-600">Congress.gov to Topic Lake Integration Platform</p>
79
+ <div class="mt-4 flex justify-center space-x-4">
80
+ <span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">Python 3.8+</span>
81
+ <span class="px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm font-medium">Async/Await</span>
82
+ <span class="px-3 py-1 bg-purple-100 text-purple-800 rounded-full text-sm font-medium">GenAI</span>
83
+ <span class="px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full text-sm font-medium">Cloud Storage</span>
84
+ </div>
85
+ </header>
86
+
87
+ <!-- Navigation Tabs -->
88
+ <div class="mb-8 border-b border-gray-200">
89
+ <nav class="flex space-x-8" id="navTabs">
90
+ <button class="nav-tab py-4 px-1 font-medium text-gray-500 hover:text-gray-700 active" data-tab="overview">Overview</button>
91
+ <button class="nav-tab py-4 px-1 font-medium text-gray-500 hover:text-gray-700" data-tab="architecture">Architecture</button>
92
+ <button class="nav-tab py-4 px-1 font-medium text-gray-500 hover:text-gray-700" data-tab="components">Components</button>
93
+ <button class="nav-tab py-4 px-1 font-medium text-gray-500 hover:text-gray-700" data-tab="workflow">Workflow</button>
94
+ <button class="nav-tab py-4 px-1 font-medium text-gray-500 hover:text-gray-700" data-tab="requirements">Requirements</button>
95
+ </nav>
96
+ </div>
97
+
98
+ <!-- Components Tab -->
99
+ <div id="components" class="tab-content">
100
+ <h2 class="text-2xl font-bold text-gray-800 mb-6">System Components</h2>
101
+
102
+ <div class="mb-8">
103
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Data Models</h3>
104
+ <div class="diagram-container">
105
+ <div class="mermaid">
106
+ classDiagram
107
+ class PageStats {
108
+ +int page_number
109
+ +bool success
110
+ +float processing_time_seconds
111
+ +int input_tokens
112
+ +int output_tokens
113
+ +int total_tokens
114
+ +float cost
115
+ }
116
+
117
+ class PDFInfo {
118
+ +str type
119
+ +int index
120
+ +str filename
121
+ +str processing_date
122
+ }
123
+
124
+ class BillMetadata {
125
+ +int congress
126
+ +str bill_type
127
+ +int bill_number
128
+ +str title
129
+ +dict sponsor_details
130
+ +list cosponsor_details
131
+ +dict latest_action
132
+ +str origin_chamber
133
+ }
134
+
135
+ PDFInfo "1" *-- "1" PageStats : contains
136
+ BillMetadata "1" *-- "1" PDFInfo : contains
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
142
+ <div>
143
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Document Creation</h3>
144
+ <div class="diagram-container">
145
+ <div class="mermaid">
146
+ flowchart TB
147
+ A[Bill Number Input] --> B[Fetch Latest Action]
148
+ B --> C{Has Document?}
149
+ C -->|Yes| D[Create Document]
150
+ C -->|No| E[Error: No Document]
151
+
152
+ D --> F[Set Customer Name]
153
+ F --> G[Add Metadata]
154
+
155
+ subgraph Metadata Structure
156
+ H[Bill Number]
157
+ I[Sponsor Details]
158
+ J[Co-Sponsor Details]
159
+ K[Latest Action]
160
+ L[Origin Chamber]
161
+ M[Congress Number]
162
+ end
163
+
164
+ G --> H
165
+ G --> I
166
+ G --> J
167
+ G --> K
168
+ G --> L
169
+ G --> M
170
+ </div>
171
+ </div>
172
+ </div>
173
+ <div>
174
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Atom Generation</h3>
175
+ <div class="diagram-container">
176
+ <div class="mermaid">
177
+ flowchart TB
178
+ A[Document] --> B[Extract Pages]
179
+ B --> C[Create Atoms]
180
+
181
+ subgraph Atom Metadata
182
+ D[Sort Number]
183
+ E[Page Number]
184
+ F[Title Format]
185
+ end
186
+
187
+ C --> D
188
+ C --> E
189
+ C --> F
190
+
191
+ D --> G["100 + (page_num - 1) * 10"]
192
+ E --> H["Page {number}"]
193
+ F --> I["Page {number}: {content_title}"]
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+
199
+ <div class="mb-8">
200
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Updated Data Model</h3>
201
+ <div class="diagram-container">
202
+ <div class="mermaid">
203
+ classDiagram
204
+ class DocumentMetadata {
205
+ +int bill_number
206
+ +dict sponsor_details
207
+ +list cosponsor_details
208
+ +dict latest_action
209
+ +str origin_chamber
210
+ +int congress_number
211
+ +str customer_name
212
+ }
213
+
214
+ class AtomMetadata {
215
+ +int sort_number
216
+ +int page_number
217
+ +str title
218
+ +str content
219
+ +dict extra_attributes
220
+ }
221
+
222
+ DocumentMetadata "1" *-- "1..*" AtomMetadata : contains
223
+ </div>
224
+ </div>
225
+ </div>
226
+ </div>
227
+
228
+ <!-- Footer -->
229
+ <footer class="mt-12 pt-8 border-t border-gray-200 text-center text-gray-500 text-sm">
230
+ <p>Bill Processing System Design Document</p>
231
+ <p class="mt-2">© 2023 Government Technology Solutions. All rights reserved.</p>
232
+ </footer>
233
+ </div>
234
+
235
+ <script>
236
+ // Initialize Mermaid
237
+ mermaid.initialize({
238
+ startOnLoad: true,
239
+ theme: 'default',
240
+ flowchart: {
241
+ useMaxWidth: false,
242
+ htmlLabels: true,
243
+ curve: 'basis'
244
+ },
245
+ securityLevel: 'loose'
246
+ });
247
+
248
+ // Wait for DOM to be fully loaded
249
+ document.addEventListener('DOMContentLoaded', function() {
250
+ // Initialize tabs
251
+ const tabs = document.querySelectorAll('.nav-tab');
252
+ const tabContents = document.querySelectorAll('.tab-content');
253
+
254
+ if (tabs && tabContents) {
255
+ tabs.forEach(tab => {
256
+ tab.addEventListener('click', function() {
257
+ // Remove active class from all tabs and contents
258
+ tabs.forEach(t => {
259
+ if (t.classList) t.classList.remove('active');
260
+ });
261
+ tabContents.forEach(content => {
262
+ if (content.classList) content.classList.remove('active');
263
+ });
264
+
265
+ // Add active class to clicked tab and corresponding content
266
+ if (this.classList) this.classList.add('active');
267
+ const tabId = this.getAttribute('data-tab');
268
+ const contentElement = document.getElementById(tabId);
269
+ if (contentElement && contentElement.classList) {
270
+ contentElement.classList.add('active');
271
+ }
272
+ });
273
+ });
274
+
275
+ // Show components tab by default if it exists
276
+ const componentsTab = document.getElementById('components');
277
+ if (componentsTab && componentsTab.classList) {
278
+ componentsTab.classList.add('active');
279
+ }
280
+ }
281
+
282
+ // Error handling for Mermaid diagrams
283
+ try {
284
+ mermaid.init();
285
+ } catch (e) {
286
+ console.error('Mermaid rendering error:', e);
287
+ const mermaidElements = document.querySelectorAll('.mermaid');
288
+ if (mermaidElements) {
289
+ mermaidElements.forEach(el => {
290
+ el.innerHTML = `<div class="mermaid-error">Diagram rendering error: ${e.message}</div>`;
291
+ });
292
+ }
293
+ }
294
+ });
295
+ </script>
296
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=bandenamaj/bill-processing-system-design" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
297
+ </html>