-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathindex.html
More file actions
1397 lines (1302 loc) 路 67 KB
/
Copy pathindex.html
File metadata and controls
1397 lines (1302 loc) 路 67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Budget Management API is a production-ready microservices backend built with Node.js, Express, and TypeScript, supporting REST, GraphQL, gRPC, and WebSockets with MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.">
<meta name="keywords" content="Budget Management API, Node.js, Express, TypeScript, Microservices, REST, GraphQL, gRPC, WebSockets, MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, Elasticsearch, WebAuthn, Passkeys, Passwordless Authentication">
<meta name="title" content="Budget Management API - Comprehensive Documentation">
<meta name="author" content="Son Nguyen">
<meta name="creator" content="Son Nguyen">
<meta name="publisher" content="Son Nguyen">
<meta name="application-name" content="Budget Management API">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
<meta name="googlebot" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
<meta name="referrer" content="strict-origin-when-cross-origin">
<meta name="theme-color" content="#1a1a1a">
<meta name="color-scheme" content="dark light">
<title>Budget Management API - Comprehensive Documentation</title>
<link rel="canonical" href="https://hoangsonww.github.io/Budget-Management-Backend-API/">
<link rel="alternate" href="https://hoangsonww.github.io/Budget-Management-Backend-API/" hreflang="en">
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://hoangsonww.github.io/Budget-Management-Backend-API/sitemap.xml">
<link rel="stylesheet" href="info-site/styles.css">
<link rel="icon" href="views/favicon.ico" type="image/x-icon">
<link rel="me" href="https://sonnguyenhoang.com">
<link rel="me" href="https://github.com/hoangsonww">
<link rel="me" href="https://www.linkedin.com/in/hoangsonw">
<meta property="og:site_name" content="Budget Management API">
<meta property="og:title" content="Budget Management API - Comprehensive Documentation">
<meta property="og:description" content="Production-ready microservices backend with REST, GraphQL, gRPC, WebSockets, and a full data stack across MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://hoangsonww.github.io/Budget-Management-Backend-API/">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://hoangsonww.github.io/Budget-Management-Backend-API/images/logo.png">
<meta property="og:image:alt" content="Budget Management API logo">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Budget Management API - Comprehensive Documentation">
<meta name="twitter:description" content="Production-ready microservices backend with REST, GraphQL, gRPC, WebSockets, and a full data stack across MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.">
<meta name="twitter:image" content="https://hoangsonww.github.io/Budget-Management-Backend-API/images/logo.png">
<meta name="twitter:image:alt" content="Budget Management API logo">
<!-- Mermaid JS for rendering diagrams -->
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({
startOnLoad: true,
theme: 'dark',
themeVariables: {
primaryColor: '#4CAF50',
primaryTextColor: '#ffffff',
primaryBorderColor: '#2196F3',
lineColor: '#2196F3',
secondaryColor: '#FF9800',
tertiaryColor: '#673AB7',
background: '#1a1a1a',
mainBkg: '#1a1a1a',
secondBkg: '#252525',
tertiaryBkg: '#2e2e2e',
darkMode: true,
nodeBorder: '#4CAF50',
clusterBkg: '#252525',
clusterBorder: '#4CAF50',
titleColor: '#ffffff',
edgeLabelBackground: '#1a1a1a',
nodeTextColor: '#ffffff',
textColor: '#ffffff',
labelTextColor: '#ffffff',
loopTextColor: '#ffffff',
noteBkgColor: '#252525',
noteTextColor: '#ffffff'
},
flowchart: {
useMaxWidth: true,
htmlLabels: true,
curve: 'basis'
}
});
</script>
<!-- Font Awesome for Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Person",
"@id": "https://sonnguyenhoang.com/#person",
"name": "Son Nguyen",
"url": "https://sonnguyenhoang.com",
"sameAs": [
"https://github.com/hoangsonww",
"https://www.linkedin.com/in/hoangsonw"
]
},
{
"@type": "WebSite",
"@id": "https://hoangsonww.github.io/Budget-Management-Backend-API/#website",
"name": "Budget Management API",
"url": "https://hoangsonww.github.io/Budget-Management-Backend-API/",
"description": "Budget Management API is a production-ready microservices backend built with Node.js, Express, and TypeScript, supporting REST, GraphQL, gRPC, and WebSockets with MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.",
"publisher": {
"@id": "https://sonnguyenhoang.com/#person"
},
"inLanguage": "en"
},
{
"@type": "WebPage",
"@id": "https://hoangsonww.github.io/Budget-Management-Backend-API/#webpage",
"url": "https://hoangsonww.github.io/Budget-Management-Backend-API/",
"name": "Budget Management API - Comprehensive Documentation",
"isPartOf": {
"@id": "https://hoangsonww.github.io/Budget-Management-Backend-API/#website"
},
"about": {
"@id": "https://sonnguyenhoang.com/#person"
},
"description": "Production-ready microservices backend with REST, GraphQL, gRPC, WebSockets, and a full data stack across MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.",
"primaryImageOfPage": {
"@type": "ImageObject",
"url": "https://hoangsonww.github.io/Budget-Management-Backend-API/images/logo.png"
},
"inLanguage": "en",
"dateModified": "2026-05-23"
}
]
}
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar">
<div class="nav-container">
<div class="nav-brand">
<img src="images/logo.png" alt="Logo" class="nav-logo">
<span>Budget Management API</span>
</div>
<ul class="nav-menu">
<li><a href="#overview"><i class="fas fa-home"></i> Overview</a></li>
<li><a href="#architecture"><i class="fas fa-project-diagram"></i> Architecture</a></li>
<li><a href="#features"><i class="fas fa-star"></i> Features</a></li>
<li><a href="#setup"><i class="fas fa-cog"></i> Setup</a></li>
<li><a href="#api-docs"><i class="fas fa-book"></i> API Docs</a></li>
<li><a href="https://budget-manage-app.vercel.app" target="_blank" class="live-demo-btn">
<i class="fas fa-rocket"></i> Live Demo
</a></li>
</ul>
<button class="mobile-menu-toggle" aria-label="Toggle menu">
<i class="fas fa-bars"></i>
</button>
</div>
<!-- Scroll Progress Bar -->
<div class="scroll-progress-bar"></div>
</nav>
<!-- Hero Section -->
<header class="hero">
<div class="hero-content">
<div class="hero-badge">
<i class="fas fa-chart-line"></i>
<span>Microservices Architecture</span>
</div>
<h1 class="hero-title">Budget Management API</h1>
<p class="hero-subtitle">A Comprehensive, Production-Ready Backend Platform</p>
<p class="hero-description">
Full-featured microservices API built with Node.js, Express, TypeScript, supporting REST, GraphQL, gRPC,
and WebSockets. Integrated with MongoDB, PostgreSQL, Redis, RabbitMQ, Kafka, and Elasticsearch.
</p>
<div class="hero-actions">
<a href="https://budget-management-backend-api.onrender.com/docs" target="_blank" class="btn btn-primary">
<i class="fas fa-book-open"></i> Swagger Docs
</a>
<a href="https://github.com/hoangsonww/Budget-Management-Backend-API" target="_blank" class="btn btn-secondary">
<i class="fab fa-github"></i> View on GitHub
</a>
<a href="https://budget-manage-app.vercel.app" target="_blank" class="btn btn-accent">
<i class="fas fa-desktop"></i> Frontend Demo
</a>
</div>
<div class="status-marquee-wrapper" aria-label="Platform status highlights">
<div class="status-marquee">
<div class="status-track">
<span class="badge badge-success status-chip"><i class="fas fa-check-circle"></i> API Online</span>
<span class="badge badge-info status-chip"><i class="fas fa-database"></i> MongoDB Connected</span>
<span class="badge badge-warning status-chip"><i class="fas fa-memory"></i> Redis Active</span>
<span class="badge badge-danger status-chip"><i class="fas fa-stream"></i> Kafka Running</span>
<span class="badge badge-success status-chip"><i class="fas fa-envelope-open-text"></i> RabbitMQ Ready</span>
<span class="badge badge-info status-chip"><i class="fas fa-project-diagram"></i> GraphQL Enabled</span>
<span class="badge badge-warning status-chip"><i class="fas fa-bolt"></i> gRPC Gateway</span>
<span class="badge badge-danger status-chip"><i class="fas fa-wifi"></i> WebSocket Live</span>
<span class="badge badge-success status-chip"><i class="fas fa-shield-alt"></i> JWT Auth Secured</span>
<span class="badge badge-success status-chip"><i class="fas fa-fingerprint"></i> Passkeys Enabled</span>
<span class="badge badge-info status-chip"><i class="fab fa-docker"></i> Dockerized Services</span>
<span class="badge badge-warning status-chip"><i class="fas fa-cubes"></i> Kubernetes Ready</span>
<span class="badge badge-danger status-chip"><i class="fas fa-rocket"></i> CI/CD Automated</span>
<span class="badge badge-success status-chip"><i class="fas fa-search"></i> Elasticsearch Indexed</span>
<span class="badge badge-info status-chip"><i class="fas fa-tachometer-alt"></i> Rate Limiting On</span>
<span class="badge badge-warning status-chip"><i class="fas fa-layer-group"></i> Caching Layer Warm</span>
<span class="badge badge-danger status-chip"><i class="fas fa-heartbeat"></i> Health Checks Passing</span>
</div>
<div class="status-track" aria-hidden="true">
<span class="badge badge-success status-chip"><i class="fas fa-check-circle"></i> API Online</span>
<span class="badge badge-info status-chip"><i class="fas fa-database"></i> MongoDB Connected</span>
<span class="badge badge-warning status-chip"><i class="fas fa-memory"></i> Redis Active</span>
<span class="badge badge-danger status-chip"><i class="fas fa-stream"></i> Kafka Running</span>
<span class="badge badge-success status-chip"><i class="fas fa-envelope-open-text"></i> RabbitMQ Ready</span>
<span class="badge badge-info status-chip"><i class="fas fa-project-diagram"></i> GraphQL Enabled</span>
<span class="badge badge-warning status-chip"><i class="fas fa-bolt"></i> gRPC Gateway</span>
<span class="badge badge-danger status-chip"><i class="fas fa-wifi"></i> WebSocket Live</span>
<span class="badge badge-success status-chip"><i class="fas fa-shield-alt"></i> JWT Auth Secured</span>
<span class="badge badge-success status-chip"><i class="fas fa-fingerprint"></i> Passkeys Enabled</span>
<span class="badge badge-info status-chip"><i class="fab fa-docker"></i> Dockerized Services</span>
<span class="badge badge-warning status-chip"><i class="fas fa-cubes"></i> Kubernetes Ready</span>
<span class="badge badge-danger status-chip"><i class="fas fa-rocket"></i> CI/CD Automated</span>
<span class="badge badge-success status-chip"><i class="fas fa-search"></i> Elasticsearch Indexed</span>
<span class="badge badge-info status-chip"><i class="fas fa-tachometer-alt"></i> Rate Limiting On</span>
<span class="badge badge-warning status-chip"><i class="fas fa-layer-group"></i> Caching Layer Warm</span>
<span class="badge badge-danger status-chip"><i class="fas fa-heartbeat"></i> Health Checks Passing</span>
</div>
</div>
</div>
</div>
<div class="hero-visual">
<div class="floating-card">
<i class="fas fa-code"></i>
<span>REST API</span>
</div>
<div class="floating-card delay-1">
<svg viewBox="0 0 400 400" width="32" height="32">
<path fill="#E10098" d="M57.468 302.66l-14.376-8.3 160.15-277.38 14.376 8.3z"/>
<path fill="#E10098" d="M39.8 272.2h320.3v16.6H39.8z"/>
<path fill="#E10098" d="M206.348 374.026l-160.21-92.5 8.3-14.376 160.21 92.5zM345.522 132.947l-160.21-92.5 8.3-14.376 160.21 92.5z"/>
<path fill="#E10098" d="M54.482 132.883l-8.3-14.375 160.21-92.5 8.3 14.376z"/>
<path fill="#E10098" d="M342.568 302.663l-160.15-277.38 14.376-8.3 160.15 277.38zM52.5 107.5h16.6v185H52.5zM330.9 107.5h16.6v185h-16.6z"/>
<path fill="#E10098" d="M203.522 367l-7.25-12.558 139.34-80.45 7.25 12.557z"/>
<path fill="#E10098" d="M369.5 297.9c-9.6 16.7-31 22.4-47.7 12.8-16.7-9.6-22.4-31-12.8-47.7 9.6-16.7 31-22.4 47.7-12.8 16.8 9.7 22.5 31 12.8 47.7M90.9 137c-9.6 16.7-31 22.4-47.7 12.8-16.7-9.6-22.4-31-12.8-47.7 9.6-16.7 31-22.4 47.7-12.8 16.7 9.7 22.4 31 12.8 47.7M30.5 297.9c-9.6-16.7-3.9-38 12.8-47.7 16.7-9.6 38-3.9 47.7 12.8 9.6 16.7 3.9 38-12.8 47.7-16.8 9.6-38.1 3.9-47.7-12.8M309.1 137c-9.6-16.7-3.9-38 12.8-47.7 16.7-9.6 38-3.9 47.7 12.8 9.6 16.7 3.9 38-12.8 47.7-16.7 9.6-38.1 3.9-47.7-12.8M200 395.8c-19.3 0-34.9-15.6-34.9-34.9 0-19.3 15.6-34.9 34.9-34.9 19.3 0 34.9 15.6 34.9 34.9 0 19.2-15.6 34.9-34.9 34.9M200 74c-19.3 0-34.9-15.6-34.9-34.9 0-19.3 15.6-34.9 34.9-34.9 19.3 0 34.9 15.6 34.9 34.9 0 19.3-15.6 34.9-34.9 34.9"/>
</svg>
<span>GraphQL</span>
</div>
<div class="floating-card delay-2">
<i class="fas fa-bolt"></i>
<span>gRPC</span>
</div>
<div class="floating-card delay-3">
<i class="fas fa-wifi"></i>
<span>WebSocket</span>
</div>
</div>
</header>
<!-- Main Content -->
<main class="container">
<!-- Quick Stats Section -->
<section class="stats-section">
<div class="stat-card">
<i class="fas fa-server"></i>
<h3>9</h3>
<p>Microservices</p>
</div>
<div class="stat-card">
<i class="fas fa-database"></i>
<h3>7</h3>
<p>Databases</p>
</div>
<div class="stat-card">
<i class="fas fa-plug"></i>
<h3>40+</h3>
<p>API Endpoints</p>
</div>
<div class="stat-card">
<i class="fas fa-code-branch"></i>
<h3>4</h3>
<p>Protocols</p>
</div>
</section>
<!-- Overview Section -->
<section id="overview" class="section">
<h2 class="section-title">
<i class="fas fa-info-circle"></i>
Project Overview
</h2>
<div class="content-grid testing-grid">
<div class="content-card">
<h3><i class="fas fa-bullseye"></i> Purpose</h3>
<p>
The Budget Management API is a <strong>comprehensive backend platform</strong> designed to demonstrate
modern microservices architecture, showcasing integration of multiple technologies and best practices
in building scalable, production-ready applications.
</p>
</div>
<div class="content-card">
<h3><i class="fas fa-lightbulb"></i> Key Capabilities</h3>
<ul class="feature-list">
<li><i class="fas fa-check"></i> Budget & expense tracking</li>
<li><i class="fas fa-check"></i> User authentication & management</li>
<li><i class="fas fa-check"></i> Passwordless passkeys (WebAuthn)</li>
<li><i class="fas fa-check"></i> Real-time notifications</li>
<li><i class="fas fa-check"></i> Advanced search with Elasticsearch</li>
<li><i class="fas fa-check"></i> Asynchronous task processing</li>
<li><i class="fas fa-check"></i> Multi-protocol API support</li>
</ul>
</div>
<div class="content-card">
<h3><i class="fas fa-trophy"></i> Why This Project?</h3>
<p>
Perfect for developers looking to learn or reference modern backend development practices.
It demonstrates <strong>real-world implementation</strong> of microservices, message queuing,
caching strategies, container orchestration, and CI/CD pipelines.
</p>
</div>
</div>
</section>
<!-- Architecture Section -->
<section id="architecture" class="section">
<h2 class="section-title" style="margin-bottom: 0">
<i class="fas fa-sitemap"></i>
System Architecture
</h2>
<div class="architecture-intro" style="margin-bottom: 1rem; margin-top: 0">
<p>
The Budget Management API follows a <strong>microservices architecture</strong> pattern, allowing
independent development, deployment, and scaling of services. Each service handles a specific domain
and communicates through well-defined interfaces.
</p>
</div>
<!-- Microservices Diagram -->
<div class="diagram-container">
<h3><i class="fas fa-cubes"></i> Microservices Architecture</h3>
<div class="mermaid">
graph TB
Client[Client Applications]
APIGateway[API Gateway / NGINX]
subgraph Services[Microservices Layer]
Auth[Authentication Service]
Budget[Budget Service]
Expense[Expense Service]
Customer[Customer Service]
Order[Order Service]
Transaction[Transaction Service]
Search[Search Service]
Notification[Notification Service]
Task[Task Service]
end
subgraph Data[Data Layer]
MongoDB[(MongoDB)]
PostgreSQL[(PostgreSQL)]
MySQL[(MySQL)]
Redis[(Redis Cache)]
Elastic[(Elasticsearch)]
end
subgraph Messaging[Message Queue Layer]
RabbitMQ[RabbitMQ]
Kafka[Apache Kafka]
end
Client --> APIGateway
APIGateway --> Auth
APIGateway --> Budget
APIGateway --> Expense
APIGateway --> Customer
APIGateway --> Order
APIGateway --> Transaction
APIGateway --> Search
APIGateway --> Notification
Auth --> MongoDB
Budget --> MongoDB
Expense --> MongoDB
Customer --> MongoDB
Order --> MongoDB
Transaction --> PostgreSQL
Search --> Elastic
Budget --> Redis
Expense --> Redis
Task --> RabbitMQ
Notification --> Kafka
Order --> Kafka
style Client fill:#4CAF50,stroke:#4CAF50,color:#fff
style APIGateway fill:#2196F3,stroke:#2196F3,color:#fff
style Auth fill:#FF9800,stroke:#FF9800,color:#fff
style Budget fill:#FF9800,stroke:#FF9800,color:#fff
style Expense fill:#FF9800,stroke:#FF9800,color:#fff
style Customer fill:#FF9800,stroke:#FF9800,color:#fff
style Order fill:#FF9800,stroke:#FF9800,color:#fff
style Transaction fill:#FF9800,stroke:#FF9800,color:#fff
style Search fill:#FF9800,stroke:#FF9800,color:#fff
style Notification fill:#FF9800,stroke:#FF9800,color:#fff
style Task fill:#FF9800,stroke:#FF9800,color:#fff
style MongoDB fill:#9C27B0,stroke:#9C27B0,color:#fff
style PostgreSQL fill:#9C27B0,stroke:#9C27B0,color:#fff
style MySQL fill:#9C27B0,stroke:#9C27B0,color:#fff
style Redis fill:#9C27B0,stroke:#9C27B0,color:#fff
style Elastic fill:#9C27B0,stroke:#9C27B0,color:#fff
style RabbitMQ fill:#F44336,stroke:#F44336,color:#fff
style Kafka fill:#F44336,stroke:#F44336,color:#fff
</div>
</div>
<!-- Communication Flow -->
<div class="diagram-container">
<h3><i class="fas fa-exchange-alt"></i> Service Communication Flow</h3>
<div class="mermaid">
flowchart LR
FE[Frontend UI]
CLI[CLI Tool]
APIGW[API Gateway]
GRPC[gRPC Server]
CORE[Application Core]
Mongo[MongoDB]
Postgres[PostgreSQL]
Elastic[Elasticsearch]
Redis[Redis]
Queue[RabbitMQ/Kafka]
External[External Services]
FE -->|HTTP/GraphQL| APIGW
CLI -->|gRPC Calls| GRPC
APIGW <--> GRPC
APIGW -->|REST/WebSocket| CORE
GRPC --> CORE
CORE --> Mongo
CORE --> Postgres
CORE --> Elastic
CORE --> Redis
CORE --> Queue
Queue -->|Async Tasks| External
style FE fill:#4CAF50,stroke:#4CAF50,color:#fff
style CLI fill:#2196F3,stroke:#2196F3,color:#fff
style APIGW fill:#FF9800,stroke:#FF9800,color:#fff
style GRPC fill:#673AB7,stroke:#673AB7,color:#fff
style CORE fill:#9C27B0,stroke:#9C27B0,color:#fff
style Mongo fill:#47A248,stroke:#47A248,color:#fff
style Postgres fill:#336791,stroke:#336791,color:#fff
style Elastic fill:#005571,stroke:#005571,color:#fff
style Redis fill:#DC382D,stroke:#DC382D,color:#fff
style Queue fill:#FF6600,stroke:#FF6600,color:#fff
style External fill:#607D8B,stroke:#607D8B,color:#fff
</div>
</div>
<!-- Tech Stack -->
<div class="tech-stack">
<h3><i class="fas fa-layer-group"></i> Technology Stack</h3>
<div class="tech-grid">
<div class="tech-category">
<h4><i class="fas fa-server"></i> Backend</h4>
<div class="tech-badges">
<span class="tech-badge">Node.js</span>
<span class="tech-badge">Express.js</span>
<span class="tech-badge">TypeScript</span>
</div>
</div>
<div class="tech-category">
<h4><i class="fas fa-database"></i> Databases</h4>
<div class="tech-badges">
<span class="tech-badge">MongoDB</span>
<span class="tech-badge">PostgreSQL</span>
<span class="tech-badge">MySQL</span>
<span class="tech-badge">Redis</span>
<span class="tech-badge">Elasticsearch</span>
</div>
</div>
<div class="tech-category">
<h4><i class="fas fa-stream"></i> Messaging</h4>
<div class="tech-badges">
<span class="tech-badge">RabbitMQ</span>
<span class="tech-badge">Apache Kafka</span>
</div>
</div>
<div class="tech-category">
<h4><i class="fas fa-plug"></i> Protocols</h4>
<div class="tech-badges">
<span class="tech-badge">REST API</span>
<span class="tech-badge">GraphQL</span>
<span class="tech-badge">gRPC</span>
<span class="tech-badge">WebSocket</span>
</div>
</div>
<div class="tech-category">
<h4><i class="fas fa-tools"></i> DevOps</h4>
<div class="tech-badges">
<span class="tech-badge">Docker</span>
<span class="tech-badge">Kubernetes</span>
<span class="tech-badge">Jenkins</span>
<span class="tech-badge">GitHub Actions</span>
</div>
</div>
<div class="tech-category">
<h4><i class="fas fa-chart-line"></i> Monitoring</h4>
<div class="tech-badges">
<span class="tech-badge">Prometheus</span>
<span class="tech-badge">Grafana</span>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section id="features" class="section">
<h2 class="section-title">
<i class="fas fa-star"></i>
Core Features & Integrations
</h2>
<div class="features-grid">
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-lock"></i>
</div>
<h3>Authentication & Security</h3>
<p>JWT-based authentication, bcrypt password hashing, and passwordless passkeys (WebAuthn) for phishing-resistant sign-in, plus secure session management.</p>
<ul>
<li>User registration & login</li>
<li>Passwordless passkeys (WebAuthn)</li>
<li>Email verification</li>
<li>Password reset</li>
<li>Token-based auth</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-fingerprint"></i>
</div>
<h3>Passkeys (WebAuthn)</h3>
<p>Passwordless, phishing-resistant authentication built on the WebAuthn standard with <code>@simplewebauthn</code>, alongside the classic password flow.</p>
<ul>
<li>Passwordless sign-in</li>
<li>Touch ID / Face ID / security keys</li>
<li>Multiple passkeys per user</li>
<li>Manage, rename & revoke</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon graphql-icon">
<svg viewBox="0 0 400 400" width="32" height="32">
<path fill="#E10098" d="M57.468 302.66l-14.376-8.3 160.15-277.38 14.376 8.3z"/>
<path fill="#E10098" d="M39.8 272.2h320.3v16.6H39.8z"/>
<path fill="#E10098" d="M206.348 374.026l-160.21-92.5 8.3-14.376 160.21 92.5zM345.522 132.947l-160.21-92.5 8.3-14.376 160.21 92.5z"/>
<path fill="#E10098" d="M54.482 132.883l-8.3-14.375 160.21-92.5 8.3 14.376z"/>
<path fill="#E10098" d="M342.568 302.663l-160.15-277.38 14.376-8.3 160.15 277.38zM52.5 107.5h16.6v185H52.5zM330.9 107.5h16.6v185h-16.6z"/>
<path fill="#E10098" d="M203.522 367l-7.25-12.558 139.34-80.45 7.25 12.557z"/>
<path fill="#E10098" d="M369.5 297.9c-9.6 16.7-31 22.4-47.7 12.8-16.7-9.6-22.4-31-12.8-47.7 9.6-16.7 31-22.4 47.7-12.8 16.8 9.7 22.5 31 12.8 47.7M90.9 137c-9.6 16.7-31 22.4-47.7 12.8-16.7-9.6-22.4-31-12.8-47.7 9.6-16.7 31-22.4 47.7-12.8 16.7 9.7 22.4 31 12.8 47.7M30.5 297.9c-9.6-16.7-3.9-38 12.8-47.7 16.7-9.6 38-3.9 47.7 12.8 9.6 16.7 3.9 38-12.8 47.7-16.8 9.6-38.1 3.9-47.7-12.8M309.1 137c-9.6-16.7-3.9-38 12.8-47.7 16.7-9.6 38-3.9 47.7 12.8 9.6 16.7 3.9 38-12.8 47.7-16.7 9.6-38.1 3.9-47.7-12.8M200 395.8c-19.3 0-34.9-15.6-34.9-34.9 0-19.3 15.6-34.9 34.9-34.9 19.3 0 34.9 15.6 34.9 34.9 0 19.2-15.6 34.9-34.9 34.9M200 74c-19.3 0-34.9-15.6-34.9-34.9 0-19.3 15.6-34.9 34.9-34.9 19.3 0 34.9 15.6 34.9 34.9 0 19.3-15.6 34.9-34.9 34.9"/>
</svg>
</div>
<h3>GraphQL Support</h3>
<p>Flexible data queries with GraphQL, allowing clients to request exactly what they need.</p>
<ul>
<li>Query budgets & expenses</li>
<li>GraphiQL interface</li>
<li>Real-time subscriptions</li>
<li>Type-safe schema</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-bolt"></i>
</div>
<h3>gRPC Integration</h3>
<p>High-performance RPC framework for inter-service communication with protocol buffers.</p>
<ul>
<li>Low latency calls</li>
<li>Binary protocol</li>
<li>Strong typing</li>
<li>Bidirectional streaming</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-wifi"></i>
</div>
<h3>WebSocket Real-time</h3>
<p>Real-time bidirectional communication for live notifications and updates.</p>
<ul>
<li>Live notifications</li>
<li>Real-time updates</li>
<li>Chat support</li>
<li>Event broadcasting</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-search"></i>
</div>
<h3>Elasticsearch Search</h3>
<p>Advanced full-text search capabilities with filtering, aggregations, and analytics.</p>
<ul>
<li>Full-text search</li>
<li>Fuzzy matching</li>
<li>Aggregations</li>
<li>Real-time indexing</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-memory"></i>
</div>
<h3>Redis Caching</h3>
<p>In-memory caching for improved performance and reduced database load.</p>
<ul>
<li>Session management</li>
<li>Data caching</li>
<li>Rate limiting</li>
<li>Pub/Sub messaging</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-stream"></i>
</div>
<h3>Message Queuing</h3>
<p>Asynchronous task processing with RabbitMQ and Kafka for reliable message delivery.</p>
<ul>
<li>Task queuing</li>
<li>Event streaming</li>
<li>Guaranteed delivery</li>
<li>Load balancing</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fab fa-docker"></i>
</div>
<h3>Containerization</h3>
<p>Fully containerized with Docker and orchestrated with Kubernetes for scalability.</p>
<ul>
<li>Docker Compose</li>
<li>Kubernetes manifests</li>
<li>Auto-scaling</li>
<li>Health checks</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-code-branch"></i>
</div>
<h3>CI/CD Pipeline</h3>
<p>Automated testing and deployment with Jenkins and GitHub Actions.</p>
<ul>
<li>Automated tests</li>
<li>Blue-green deployment</li>
<li>Canary releases</li>
<li>Rollback support</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-tachometer-alt"></i>
</div>
<h3>Monitoring & Observability</h3>
<p>Production-grade monitoring with Prometheus metrics collection and Grafana dashboards for real-time insights.</p>
<ul>
<li>Prometheus metrics</li>
<li>Grafana dashboards</li>
<li>Health check endpoints</li>
<li>ELK stack logging</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-network-wired"></i>
</div>
<h3>NGINX Load Balancing</h3>
<p>Reverse proxy and load balancing with NGINX, including round-robin distribution and SSL termination.</p>
<ul>
<li>Reverse proxy</li>
<li>Round-robin routing</li>
<li>SSL termination</li>
<li>Static file serving</li>
</ul>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-language"></i>
</div>
<h3>Multi-Language Backends</h3>
<p>Alternative backend implementations in Spring Boot (Java) and .NET Core (C#) for cross-platform versatility.</p>
<ul>
<li>Spring Boot (Java)</li>
<li>.NET Core (C#)</li>
<li>Gradle build system</li>
<li>Shared API contracts</li>
</ul>
</div>
</div>
</section>
<!-- Project Structure -->
<section id="structure" class="section">
<h2 class="section-title">
<i class="fas fa-folder-tree"></i>
Project Structure
</h2>
<div class="diagram-container">
<h3><i class="fas fa-sitemap"></i> Directory Organization</h3>
<div class="mermaid">
graph TD
Root[Budget Management API]
Root --> CoreFiles[Core Files]
Root --> Services[Services Layer]
Root --> Controllers[Controllers]
Root --> Models[Data Models]
Root --> Infrastructure[Infrastructure]
Root --> Additional[Additional]
CoreFiles --> EntryPoint[index.js - Entry Point]
CoreFiles --> CLI[cli.js - CLI Tool]
CoreFiles --> GRPC[grpcServer.js - gRPC Server]
CoreFiles --> Docker[docker-compose.yml - Docker Config]
Services --> Auth[Authentication Service]
Services --> Budget[Budget Management]
Services --> Expense[Expense Tracking]
Services --> Search[Search & Analytics]
Services --> Notif[Notifications]
Services --> TaskQ[Task Queue]
Controllers --> AuthCtrl[authController]
Controllers --> BudgetCtrl[budgetController]
Controllers --> ExpenseCtrl[expenseController]
Controllers --> SearchCtrl[searchController]
Controllers --> TaskCtrl[taskController]
Models --> UserModel[User Schema]
Models --> BudgetModel[Budget Schema]
Models --> ExpenseModel[Expense Schema]
Models --> OrderModel[Order Schema]
Models --> TaskModel[Task Schema]
Infrastructure --> DockerInfra[Docker]
Infrastructure --> K8s[Kubernetes]
Infrastructure --> Nginx[NGINX]
Infrastructure --> Jenkins[Jenkins CI/CD]
Additional --> Spring[Spring Boot Backend]
Additional --> Dotnet[.NET Core Backend]
Additional --> Frontend[Frontend Demo]
Additional --> Tests[Testing Suite]
style Root fill:#4CAF50,stroke:#4CAF50,color:#fff
style CoreFiles fill:#2196F3,stroke:#2196F3,color:#fff
style Services fill:#FF9800,stroke:#FF9800,color:#fff
style Controllers fill:#9C27B0,stroke:#9C27B0,color:#fff
style Models fill:#673AB7,stroke:#673AB7,color:#fff
style Infrastructure fill:#F44336,stroke:#F44336,color:#fff
style Additional fill:#00BCD4,stroke:#00BCD4,color:#fff
style EntryPoint fill:#1976D2,stroke:#1976D2,color:#fff
style CLI fill:#1976D2,stroke:#1976D2,color:#fff
style GRPC fill:#1976D2,stroke:#1976D2,color:#fff
style Docker fill:#1976D2,stroke:#1976D2,color:#fff
</div>
</div>
<div class="content-card">
<h3><i class="fas fa-list"></i> Key Directories</h3>
<div class="directory-list">
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/controllers</strong>
<p class="dir-item-desc">API endpoint handlers and business logic</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/services</strong>
<p class="dir-item-desc">External service integrations (Redis, RabbitMQ, Elasticsearch)</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/models</strong>
<p class="dir-item-desc">MongoDB/Mongoose schemas for data models</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/routes</strong>
<p class="dir-item-desc">Express route definitions and API routing</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/middleware</strong>
<p class="dir-item-desc">Authentication, validation, and error handling</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/graphql</strong>
<p class="dir-item-desc">GraphQL schema and resolver definitions</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/proto</strong>
<p class="dir-item-desc">gRPC protocol buffer definitions</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/kubernetes</strong>
<p class="dir-item-desc">K8s deployment manifests and configs</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/frontend</strong>
<p class="dir-item-desc">React-based demo UI application</p>
</div>
</div>
<div class="dir-item">
<i class="fas fa-folder"></i>
<div class="dir-item-content">
<strong class="dir-item-title">/docs</strong>
<p class="dir-item-desc">Swagger/OpenAPI documentation</p>
</div>
</div>
</div>
</div>
</section>
<!-- Setup Instructions -->
<section id="setup" class="section">
<h2 class="section-title">
<i class="fas fa-rocket"></i>
Getting Started
</h2>
<div class="setup-flow">
<div class="setup-step">
<div class="step-number">1</div>
<div class="step-content">
<h3><i class="fab fa-git-alt"></i> Clone Repository</h3>
<pre><code>git clone https://github.com/hoangsonww/Budget-Management-Backend-API.git
cd Budget-Management-Backend-API</code></pre>
</div>
</div>
<div class="setup-step">
<div class="step-number">2</div>
<div class="step-content">
<h3><i class="fas fa-download"></i> Install Dependencies</h3>
<pre><code>npm install</code></pre>
</div>
</div>
<div class="setup-step">
<div class="step-number">3</div>
<div class="step-content">
<h3><i class="fas fa-cog"></i> Configure Environment</h3>
<pre><code>cp .env.example .env
# Edit .env with your configuration</code></pre>
<div class="env-example">
<h4>Required Environment Variables:</h4>
<ul>
<li><code>MONGO_DB_URI</code> - MongoDB connection string</li>
<li><code>REDIS_URL</code> - Redis connection URL</li>
<li><code>RABBITMQ_URL</code> - RabbitMQ connection string</li>
<li><code>KAFKA_BROKER</code> - Kafka broker address</li>
<li><code>JWT_SECRET</code> - Secret key for JWT tokens</li>
<li><code>ELASTIC_SEARCH_URL</code> - Elasticsearch endpoint</li>
<li><code>POSTGRES_URL</code> - PostgreSQL connection string</li>
</ul>
</div>
</div>
</div>
<div class="setup-step">
<div class="step-number">4</div>
<div class="step-content">
<h3><i class="fab fa-docker"></i> Start with Docker (Recommended)</h3>
<pre><code>docker-compose up --build</code></pre>
<p>This starts all services: API, MongoDB, Redis, RabbitMQ, Kafka, Elasticsearch</p>
</div>
</div>
<div class="setup-step">
<div class="step-number">5</div>
<div class="step-content">
<h3><i class="fas fa-play"></i> Or Start Locally</h3>
<pre><code>npm start
# API available at http://localhost:3000
# Swagger docs at http://localhost:3000/docs</code></pre>
</div>
</div>
</div>
<div class="setup-alternatives">
<h3><i class="fas fa-code"></i> Alternative Setups</h3>
<div class="content-grid">
<div class="content-card">
<h4><i class="fas fa-terminal"></i> CLI Usage</h4>
<pre><code>npm link
budget-manager --help
budget-manager seed
budget-manager list-budgets</code></pre>
</div>
<div class="content-card">
<h4><i class="fas fa-dharmachakra"></i> Kubernetes Deployment</h4>
<pre><code>kubectl apply -f kubernetes/
kubectl get pods
kubectl get services</code></pre>
</div>
<div class="content-card">
<h4><i class="fas fa-desktop"></i> Frontend Demo</h4>
<pre><code>cd frontend
npm install
npm start</code></pre>
</div>
</div>
</div>
</section>
<!-- API Documentation -->
<section id="api-docs" class="section">
<h2 class="section-title">
<i class="fas fa-book"></i>
API Documentation
</h2>
<div class="api-intro">
<p>
The Budget Management API provides <strong>40+ endpoints</strong> across multiple services.
Full interactive documentation is available via <a href="https://budget-management-backend-api.onrender.com/docs" target="_blank">Swagger UI</a>.
</p>
</div>
<div class="api-categories">
<div class="api-category">
<h3><i class="fas fa-user-shield"></i> Authentication</h3>
<div class="endpoint-list">
<div class="endpoint">
<span class="method post">POST</span>
<span class="path">/api/auth/register</span>
<span class="desc">Register new user</span>
</div>
<div class="endpoint">
<span class="method post">POST</span>
<span class="path">/api/auth/login</span>
<span class="desc">Login and get JWT token</span>
</div>
<div class="endpoint">
<span class="method post">POST</span>
<span class="path">/api/auth/verify-email</span>
<span class="desc">Verify email address</span>
</div>
<div class="endpoint">
<span class="method post">POST</span>
<span class="path">/api/auth/reset-password</span>
<span class="desc">Reset user password</span>
</div>
</div>
</div>
<div class="api-category">
<h3><i class="fas fa-fingerprint"></i> Passkeys (WebAuthn)</h3>
<div class="endpoint-list">
<div class="endpoint">
<span class="method post">POST</span>
<span class="path">/api/passkeys/login/options</span>
<span class="desc">Begin passwordless login</span>