Kuruva Laxmi commited on
Commit
76cd5d5
·
1 Parent(s): 67351a2

Replace tricky MongoDB Atlas with a zero-config in-memory database

Browse files
server/package-lock.json CHANGED
@@ -15,6 +15,7 @@
15
  "dotenv": "^17.3.1",
16
  "express": "^5.2.1",
17
  "jsonwebtoken": "^9.0.3",
 
18
  "mongoose": "^9.3.0",
19
  "multer": "^2.1.1",
20
  "socket.io": "^4.8.3"
@@ -90,12 +91,131 @@
90
  "node": ">= 0.6"
91
  }
92
  },
 
 
 
 
 
 
 
 
 
93
  "node_modules/append-field": {
94
  "version": "1.0.0",
95
  "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
96
  "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==",
97
  "license": "MIT"
98
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  "node_modules/base64id": {
100
  "version": "2.0.0",
101
  "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
@@ -147,6 +267,15 @@
147
  "node": ">=20.19.0"
148
  }
149
  },
 
 
 
 
 
 
 
 
 
150
  "node_modules/buffer-equal-constant-time": {
151
  "version": "1.0.1",
152
  "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
@@ -208,6 +337,18 @@
208
  "url": "https://github.com/sponsors/ljharb"
209
  }
210
  },
 
 
 
 
 
 
 
 
 
 
 
 
211
  "node_modules/cloudinary": {
212
  "version": "2.9.0",
213
  "resolved": "https://registry.npmjs.org/cloudinary/-/cloudinary-2.9.0.tgz",
@@ -220,6 +361,12 @@
220
  "node": ">=9"
221
  }
222
  },
 
 
 
 
 
 
223
  "node_modules/concat-stream": {
224
  "version": "2.0.0",
225
  "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
@@ -486,6 +633,15 @@
486
  "node": ">= 0.6"
487
  }
488
  },
 
 
 
 
 
 
 
 
 
489
  "node_modules/express": {
490
  "version": "5.2.1",
491
  "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
@@ -529,6 +685,12 @@
529
  "url": "https://opencollective.com/express"
530
  }
531
  },
 
 
 
 
 
 
532
  "node_modules/finalhandler": {
533
  "version": "2.1.1",
534
  "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
@@ -550,6 +712,56 @@
550
  "url": "https://opencollective.com/express"
551
  }
552
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  "node_modules/forwarded": {
554
  "version": "0.2.0",
555
  "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -670,6 +882,19 @@
670
  "url": "https://opencollective.com/express"
671
  }
672
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  "node_modules/iconv-lite": {
674
  "version": "0.7.2",
675
  "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
@@ -759,6 +984,18 @@
759
  "node": ">=18.0.0"
760
  }
761
  },
 
 
 
 
 
 
 
 
 
 
 
 
762
  "node_modules/lodash": {
763
  "version": "4.17.23",
764
  "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
@@ -807,6 +1044,30 @@
807
  "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
808
  "license": "MIT"
809
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
810
  "node_modules/math-intrinsics": {
811
  "version": "1.1.0",
812
  "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -927,6 +1188,43 @@
927
  "node": ">=20.19.0"
928
  }
929
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  "node_modules/mongoose": {
931
  "version": "9.3.0",
932
  "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-9.3.0.tgz",
@@ -1043,6 +1341,18 @@
1043
  "node": ">= 0.6"
1044
  }
1045
  },
 
 
 
 
 
 
 
 
 
 
 
 
1046
  "node_modules/object-assign": {
1047
  "version": "4.1.1",
1048
  "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -1085,6 +1395,42 @@
1085
  "wrappy": "1"
1086
  }
1087
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1088
  "node_modules/parseurl": {
1089
  "version": "1.3.3",
1090
  "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -1094,6 +1440,15 @@
1094
  "node": ">= 0.8"
1095
  }
1096
  },
 
 
 
 
 
 
 
 
 
1097
  "node_modules/path-to-regexp": {
1098
  "version": "8.3.0",
1099
  "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
@@ -1104,6 +1459,24 @@
1104
  "url": "https://opencollective.com/express"
1105
  }
1106
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1107
  "node_modules/proxy-addr": {
1108
  "version": "2.0.7",
1109
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
@@ -1472,6 +1845,17 @@
1472
  "node": ">=10.0.0"
1473
  }
1474
  },
 
 
 
 
 
 
 
 
 
 
 
1475
  "node_modules/string_decoder": {
1476
  "version": "1.3.0",
1477
  "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
@@ -1481,6 +1865,36 @@
1481
  "safe-buffer": "~5.2.0"
1482
  }
1483
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1484
  "node_modules/toidentifier": {
1485
  "version": "1.0.1",
1486
  "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@@ -1502,6 +1916,12 @@
1502
  "node": ">=18"
1503
  }
1504
  },
 
 
 
 
 
 
1505
  "node_modules/type-is": {
1506
  "version": "2.0.1",
1507
  "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
@@ -1600,6 +2020,19 @@
1600
  "optional": true
1601
  }
1602
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1603
  }
1604
  }
1605
  }
 
15
  "dotenv": "^17.3.1",
16
  "express": "^5.2.1",
17
  "jsonwebtoken": "^9.0.3",
18
+ "mongodb-memory-server": "^11.0.1",
19
  "mongoose": "^9.3.0",
20
  "multer": "^2.1.1",
21
  "socket.io": "^4.8.3"
 
91
  "node": ">= 0.6"
92
  }
93
  },
94
+ "node_modules/agent-base": {
95
+ "version": "7.1.4",
96
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
97
+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
98
+ "license": "MIT",
99
+ "engines": {
100
+ "node": ">= 14"
101
+ }
102
+ },
103
  "node_modules/append-field": {
104
  "version": "1.0.0",
105
  "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
106
  "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==",
107
  "license": "MIT"
108
  },
109
+ "node_modules/async-mutex": {
110
+ "version": "0.5.0",
111
+ "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.5.0.tgz",
112
+ "integrity": "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==",
113
+ "license": "MIT",
114
+ "dependencies": {
115
+ "tslib": "^2.4.0"
116
+ }
117
+ },
118
+ "node_modules/b4a": {
119
+ "version": "1.8.0",
120
+ "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz",
121
+ "integrity": "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==",
122
+ "license": "Apache-2.0",
123
+ "peerDependencies": {
124
+ "react-native-b4a": "*"
125
+ },
126
+ "peerDependenciesMeta": {
127
+ "react-native-b4a": {
128
+ "optional": true
129
+ }
130
+ }
131
+ },
132
+ "node_modules/bare-events": {
133
+ "version": "2.8.2",
134
+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
135
+ "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
136
+ "license": "Apache-2.0",
137
+ "peerDependencies": {
138
+ "bare-abort-controller": "*"
139
+ },
140
+ "peerDependenciesMeta": {
141
+ "bare-abort-controller": {
142
+ "optional": true
143
+ }
144
+ }
145
+ },
146
+ "node_modules/bare-fs": {
147
+ "version": "4.5.6",
148
+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.6.tgz",
149
+ "integrity": "sha512-1QovqDrR80Pmt5HPAsMsXTCFcDYr+NSUKW6nd6WO5v0JBmnItc/irNRzm2KOQ5oZ69P37y+AMujNyNtG+1Rggw==",
150
+ "license": "Apache-2.0",
151
+ "dependencies": {
152
+ "bare-events": "^2.5.4",
153
+ "bare-path": "^3.0.0",
154
+ "bare-stream": "^2.6.4",
155
+ "bare-url": "^2.2.2",
156
+ "fast-fifo": "^1.3.2"
157
+ },
158
+ "engines": {
159
+ "bare": ">=1.16.0"
160
+ },
161
+ "peerDependencies": {
162
+ "bare-buffer": "*"
163
+ },
164
+ "peerDependenciesMeta": {
165
+ "bare-buffer": {
166
+ "optional": true
167
+ }
168
+ }
169
+ },
170
+ "node_modules/bare-os": {
171
+ "version": "3.8.0",
172
+ "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.8.0.tgz",
173
+ "integrity": "sha512-Dc9/SlwfxkXIGYhvMQNUtKaXCaGkZYGcd1vuNUUADVqzu4/vQfvnMkYYOUnt2VwQ2AqKr/8qAVFRtwETljgeFg==",
174
+ "license": "Apache-2.0",
175
+ "engines": {
176
+ "bare": ">=1.14.0"
177
+ }
178
+ },
179
+ "node_modules/bare-path": {
180
+ "version": "3.0.0",
181
+ "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
182
+ "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
183
+ "license": "Apache-2.0",
184
+ "dependencies": {
185
+ "bare-os": "^3.0.1"
186
+ }
187
+ },
188
+ "node_modules/bare-stream": {
189
+ "version": "2.10.0",
190
+ "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.10.0.tgz",
191
+ "integrity": "sha512-DOPZF/DDcDruKDA43cOw6e9Quq5daua7ygcAwJE/pKJsRWhgSSemi7qVNGE5kyDIxIeN1533G/zfbvWX7Wcb9w==",
192
+ "license": "Apache-2.0",
193
+ "dependencies": {
194
+ "streamx": "^2.25.0",
195
+ "teex": "^1.0.1"
196
+ },
197
+ "peerDependencies": {
198
+ "bare-buffer": "*",
199
+ "bare-events": "*"
200
+ },
201
+ "peerDependenciesMeta": {
202
+ "bare-buffer": {
203
+ "optional": true
204
+ },
205
+ "bare-events": {
206
+ "optional": true
207
+ }
208
+ }
209
+ },
210
+ "node_modules/bare-url": {
211
+ "version": "2.4.0",
212
+ "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.0.tgz",
213
+ "integrity": "sha512-NSTU5WN+fy/L0DDenfE8SXQna4voXuW0FHM7wH8i3/q9khUSchfPbPezO4zSFMnDGIf9YE+mt/RWhZgNRKRIXA==",
214
+ "license": "Apache-2.0",
215
+ "dependencies": {
216
+ "bare-path": "^3.0.0"
217
+ }
218
+ },
219
  "node_modules/base64id": {
220
  "version": "2.0.0",
221
  "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
 
267
  "node": ">=20.19.0"
268
  }
269
  },
270
+ "node_modules/buffer-crc32": {
271
+ "version": "0.2.13",
272
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
273
+ "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
274
+ "license": "MIT",
275
+ "engines": {
276
+ "node": "*"
277
+ }
278
+ },
279
  "node_modules/buffer-equal-constant-time": {
280
  "version": "1.0.1",
281
  "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
 
337
  "url": "https://github.com/sponsors/ljharb"
338
  }
339
  },
340
+ "node_modules/camelcase": {
341
+ "version": "6.3.0",
342
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
343
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
344
+ "license": "MIT",
345
+ "engines": {
346
+ "node": ">=10"
347
+ },
348
+ "funding": {
349
+ "url": "https://github.com/sponsors/sindresorhus"
350
+ }
351
+ },
352
  "node_modules/cloudinary": {
353
  "version": "2.9.0",
354
  "resolved": "https://registry.npmjs.org/cloudinary/-/cloudinary-2.9.0.tgz",
 
361
  "node": ">=9"
362
  }
363
  },
364
+ "node_modules/commondir": {
365
+ "version": "1.0.1",
366
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
367
+ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
368
+ "license": "MIT"
369
+ },
370
  "node_modules/concat-stream": {
371
  "version": "2.0.0",
372
  "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
 
633
  "node": ">= 0.6"
634
  }
635
  },
636
+ "node_modules/events-universal": {
637
+ "version": "1.0.1",
638
+ "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
639
+ "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
640
+ "license": "Apache-2.0",
641
+ "dependencies": {
642
+ "bare-events": "^2.7.0"
643
+ }
644
+ },
645
  "node_modules/express": {
646
  "version": "5.2.1",
647
  "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
 
685
  "url": "https://opencollective.com/express"
686
  }
687
  },
688
+ "node_modules/fast-fifo": {
689
+ "version": "1.3.2",
690
+ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
691
+ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
692
+ "license": "MIT"
693
+ },
694
  "node_modules/finalhandler": {
695
  "version": "2.1.1",
696
  "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
 
712
  "url": "https://opencollective.com/express"
713
  }
714
  },
715
+ "node_modules/find-cache-dir": {
716
+ "version": "3.3.2",
717
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
718
+ "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
719
+ "license": "MIT",
720
+ "dependencies": {
721
+ "commondir": "^1.0.1",
722
+ "make-dir": "^3.0.2",
723
+ "pkg-dir": "^4.1.0"
724
+ },
725
+ "engines": {
726
+ "node": ">=8"
727
+ },
728
+ "funding": {
729
+ "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
730
+ }
731
+ },
732
+ "node_modules/find-up": {
733
+ "version": "4.1.0",
734
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
735
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
736
+ "license": "MIT",
737
+ "dependencies": {
738
+ "locate-path": "^5.0.0",
739
+ "path-exists": "^4.0.0"
740
+ },
741
+ "engines": {
742
+ "node": ">=8"
743
+ }
744
+ },
745
+ "node_modules/follow-redirects": {
746
+ "version": "1.15.11",
747
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
748
+ "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
749
+ "funding": [
750
+ {
751
+ "type": "individual",
752
+ "url": "https://github.com/sponsors/RubenVerborgh"
753
+ }
754
+ ],
755
+ "license": "MIT",
756
+ "engines": {
757
+ "node": ">=4.0"
758
+ },
759
+ "peerDependenciesMeta": {
760
+ "debug": {
761
+ "optional": true
762
+ }
763
+ }
764
+ },
765
  "node_modules/forwarded": {
766
  "version": "0.2.0",
767
  "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
 
882
  "url": "https://opencollective.com/express"
883
  }
884
  },
885
+ "node_modules/https-proxy-agent": {
886
+ "version": "7.0.6",
887
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
888
+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
889
+ "license": "MIT",
890
+ "dependencies": {
891
+ "agent-base": "^7.1.2",
892
+ "debug": "4"
893
+ },
894
+ "engines": {
895
+ "node": ">= 14"
896
+ }
897
+ },
898
  "node_modules/iconv-lite": {
899
  "version": "0.7.2",
900
  "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
 
984
  "node": ">=18.0.0"
985
  }
986
  },
987
+ "node_modules/locate-path": {
988
+ "version": "5.0.0",
989
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
990
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
991
+ "license": "MIT",
992
+ "dependencies": {
993
+ "p-locate": "^4.1.0"
994
+ },
995
+ "engines": {
996
+ "node": ">=8"
997
+ }
998
+ },
999
  "node_modules/lodash": {
1000
  "version": "4.17.23",
1001
  "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
 
1044
  "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
1045
  "license": "MIT"
1046
  },
1047
+ "node_modules/make-dir": {
1048
+ "version": "3.1.0",
1049
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
1050
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
1051
+ "license": "MIT",
1052
+ "dependencies": {
1053
+ "semver": "^6.0.0"
1054
+ },
1055
+ "engines": {
1056
+ "node": ">=8"
1057
+ },
1058
+ "funding": {
1059
+ "url": "https://github.com/sponsors/sindresorhus"
1060
+ }
1061
+ },
1062
+ "node_modules/make-dir/node_modules/semver": {
1063
+ "version": "6.3.1",
1064
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
1065
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
1066
+ "license": "ISC",
1067
+ "bin": {
1068
+ "semver": "bin/semver.js"
1069
+ }
1070
+ },
1071
  "node_modules/math-intrinsics": {
1072
  "version": "1.1.0",
1073
  "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
 
1188
  "node": ">=20.19.0"
1189
  }
1190
  },
1191
+ "node_modules/mongodb-memory-server": {
1192
+ "version": "11.0.1",
1193
+ "resolved": "https://registry.npmjs.org/mongodb-memory-server/-/mongodb-memory-server-11.0.1.tgz",
1194
+ "integrity": "sha512-nUlKovSJZBh7q5hPsewFRam9H66D08Ne18nyknkNalfXMPtK1Og3kOcuqQhcX88x/pghSZPIJHrLbxNFW3OWiw==",
1195
+ "hasInstallScript": true,
1196
+ "license": "MIT",
1197
+ "dependencies": {
1198
+ "mongodb-memory-server-core": "11.0.1",
1199
+ "tslib": "^2.8.1"
1200
+ },
1201
+ "engines": {
1202
+ "node": ">=20.19.0"
1203
+ }
1204
+ },
1205
+ "node_modules/mongodb-memory-server-core": {
1206
+ "version": "11.0.1",
1207
+ "resolved": "https://registry.npmjs.org/mongodb-memory-server-core/-/mongodb-memory-server-core-11.0.1.tgz",
1208
+ "integrity": "sha512-IcIb2S9Xf7Lmz43Z1ZujMqNg7PU5Q7yn+4wOnu7l6pfeGPkEmlqzV1hIbroVx8s4vXhPB1oMGC1u8clW7aj3Xw==",
1209
+ "license": "MIT",
1210
+ "dependencies": {
1211
+ "async-mutex": "^0.5.0",
1212
+ "camelcase": "^6.3.0",
1213
+ "debug": "^4.4.3",
1214
+ "find-cache-dir": "^3.3.2",
1215
+ "follow-redirects": "^1.15.11",
1216
+ "https-proxy-agent": "^7.0.6",
1217
+ "mongodb": "^7.0.0",
1218
+ "new-find-package-json": "^2.0.0",
1219
+ "semver": "^7.7.3",
1220
+ "tar-stream": "^3.1.7",
1221
+ "tslib": "^2.8.1",
1222
+ "yauzl": "^3.2.0"
1223
+ },
1224
+ "engines": {
1225
+ "node": ">=20.19.0"
1226
+ }
1227
+ },
1228
  "node_modules/mongoose": {
1229
  "version": "9.3.0",
1230
  "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-9.3.0.tgz",
 
1341
  "node": ">= 0.6"
1342
  }
1343
  },
1344
+ "node_modules/new-find-package-json": {
1345
+ "version": "2.0.0",
1346
+ "resolved": "https://registry.npmjs.org/new-find-package-json/-/new-find-package-json-2.0.0.tgz",
1347
+ "integrity": "sha512-lDcBsjBSMlj3LXH2v/FW3txlh2pYTjmbOXPYJD93HI5EwuLzI11tdHSIpUMmfq/IOsldj4Ps8M8flhm+pCK4Ew==",
1348
+ "license": "MIT",
1349
+ "dependencies": {
1350
+ "debug": "^4.3.4"
1351
+ },
1352
+ "engines": {
1353
+ "node": ">=12.22.0"
1354
+ }
1355
+ },
1356
  "node_modules/object-assign": {
1357
  "version": "4.1.1",
1358
  "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
 
1395
  "wrappy": "1"
1396
  }
1397
  },
1398
+ "node_modules/p-limit": {
1399
+ "version": "2.3.0",
1400
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
1401
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
1402
+ "license": "MIT",
1403
+ "dependencies": {
1404
+ "p-try": "^2.0.0"
1405
+ },
1406
+ "engines": {
1407
+ "node": ">=6"
1408
+ },
1409
+ "funding": {
1410
+ "url": "https://github.com/sponsors/sindresorhus"
1411
+ }
1412
+ },
1413
+ "node_modules/p-locate": {
1414
+ "version": "4.1.0",
1415
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
1416
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
1417
+ "license": "MIT",
1418
+ "dependencies": {
1419
+ "p-limit": "^2.2.0"
1420
+ },
1421
+ "engines": {
1422
+ "node": ">=8"
1423
+ }
1424
+ },
1425
+ "node_modules/p-try": {
1426
+ "version": "2.2.0",
1427
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
1428
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
1429
+ "license": "MIT",
1430
+ "engines": {
1431
+ "node": ">=6"
1432
+ }
1433
+ },
1434
  "node_modules/parseurl": {
1435
  "version": "1.3.3",
1436
  "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
 
1440
  "node": ">= 0.8"
1441
  }
1442
  },
1443
+ "node_modules/path-exists": {
1444
+ "version": "4.0.0",
1445
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
1446
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
1447
+ "license": "MIT",
1448
+ "engines": {
1449
+ "node": ">=8"
1450
+ }
1451
+ },
1452
  "node_modules/path-to-regexp": {
1453
  "version": "8.3.0",
1454
  "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
 
1459
  "url": "https://opencollective.com/express"
1460
  }
1461
  },
1462
+ "node_modules/pend": {
1463
+ "version": "1.2.0",
1464
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
1465
+ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==",
1466
+ "license": "MIT"
1467
+ },
1468
+ "node_modules/pkg-dir": {
1469
+ "version": "4.2.0",
1470
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
1471
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
1472
+ "license": "MIT",
1473
+ "dependencies": {
1474
+ "find-up": "^4.0.0"
1475
+ },
1476
+ "engines": {
1477
+ "node": ">=8"
1478
+ }
1479
+ },
1480
  "node_modules/proxy-addr": {
1481
  "version": "2.0.7",
1482
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
 
1845
  "node": ">=10.0.0"
1846
  }
1847
  },
1848
+ "node_modules/streamx": {
1849
+ "version": "2.25.0",
1850
+ "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.25.0.tgz",
1851
+ "integrity": "sha512-0nQuG6jf1w+wddNEEXCF4nTg3LtufWINB5eFEN+5TNZW7KWJp6x87+JFL43vaAUPyCfH1wID+mNVyW6OHtFamg==",
1852
+ "license": "MIT",
1853
+ "dependencies": {
1854
+ "events-universal": "^1.0.0",
1855
+ "fast-fifo": "^1.3.2",
1856
+ "text-decoder": "^1.1.0"
1857
+ }
1858
+ },
1859
  "node_modules/string_decoder": {
1860
  "version": "1.3.0",
1861
  "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
 
1865
  "safe-buffer": "~5.2.0"
1866
  }
1867
  },
1868
+ "node_modules/tar-stream": {
1869
+ "version": "3.1.8",
1870
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.8.tgz",
1871
+ "integrity": "sha512-U6QpVRyCGHva435KoNWy9PRoi2IFYCgtEhq9nmrPPpbRacPs9IH4aJ3gbrFC8dPcXvdSZ4XXfXT5Fshbp2MtlQ==",
1872
+ "license": "MIT",
1873
+ "dependencies": {
1874
+ "b4a": "^1.6.4",
1875
+ "bare-fs": "^4.5.5",
1876
+ "fast-fifo": "^1.2.0",
1877
+ "streamx": "^2.15.0"
1878
+ }
1879
+ },
1880
+ "node_modules/teex": {
1881
+ "version": "1.0.1",
1882
+ "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
1883
+ "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==",
1884
+ "license": "MIT",
1885
+ "dependencies": {
1886
+ "streamx": "^2.12.5"
1887
+ }
1888
+ },
1889
+ "node_modules/text-decoder": {
1890
+ "version": "1.2.7",
1891
+ "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
1892
+ "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==",
1893
+ "license": "Apache-2.0",
1894
+ "dependencies": {
1895
+ "b4a": "^1.6.4"
1896
+ }
1897
+ },
1898
  "node_modules/toidentifier": {
1899
  "version": "1.0.1",
1900
  "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
 
1916
  "node": ">=18"
1917
  }
1918
  },
1919
+ "node_modules/tslib": {
1920
+ "version": "2.8.1",
1921
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
1922
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
1923
+ "license": "0BSD"
1924
+ },
1925
  "node_modules/type-is": {
1926
  "version": "2.0.1",
1927
  "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
 
2020
  "optional": true
2021
  }
2022
  }
2023
+ },
2024
+ "node_modules/yauzl": {
2025
+ "version": "3.2.1",
2026
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.2.1.tgz",
2027
+ "integrity": "sha512-k1isifdbpNSFEHFJ1ZY4YDewv0IH9FR61lDetaRMD3j2ae3bIXGV+7c+LHCqtQGofSd8PIyV4X6+dHMAnSr60A==",
2028
+ "license": "MIT",
2029
+ "dependencies": {
2030
+ "buffer-crc32": "~0.2.3",
2031
+ "pend": "~1.2.0"
2032
+ },
2033
+ "engines": {
2034
+ "node": ">=12"
2035
+ }
2036
  }
2037
  }
2038
  }
server/package.json CHANGED
@@ -18,6 +18,7 @@
18
  "dotenv": "^17.3.1",
19
  "express": "^5.2.1",
20
  "jsonwebtoken": "^9.0.3",
 
21
  "mongoose": "^9.3.0",
22
  "multer": "^2.1.1",
23
  "socket.io": "^4.8.3"
 
18
  "dotenv": "^17.3.1",
19
  "express": "^5.2.1",
20
  "jsonwebtoken": "^9.0.3",
21
+ "mongodb-memory-server": "^11.0.1",
22
  "mongoose": "^9.3.0",
23
  "multer": "^2.1.1",
24
  "socket.io": "^4.8.3"
server/src/index.js CHANGED
@@ -113,15 +113,36 @@ app.use('/api/loyalty', loyaltyRoutes);
113
  app.use('/api/trips', tripPlanRoutes);
114
  app.use('/api/deals', dealRoutes);
115
 
116
- // Basic Route
117
- app.get('/', (req, res) => {
118
- res.send('SnapLocal Pro API is running with Real-time support...');
119
- });
120
-
121
  // Database Connection
122
- mongoose.connect(process.env.MONGODB_URI)
123
- .then(() => console.log('MongoDB connected'))
124
- .catch(err => console.error('MongoDB connection error:', err));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  const PORT = process.env.PORT || 5000;
127
  server.listen(PORT, () => {
 
113
  app.use('/api/trips', tripPlanRoutes);
114
  app.use('/api/deals', dealRoutes);
115
 
 
 
 
 
 
116
  // Database Connection
117
+ const connectDB = async () => {
118
+ try {
119
+ let uri = process.env.MONGODB_URI;
120
+ if (!uri || uri === "undefined") {
121
+ console.log('No MONGODB_URI found. Starting In-Memory MongoDB Server for demo purposes...');
122
+ const { MongoMemoryServer } = require('mongodb-memory-server');
123
+ const mongoServer = await MongoMemoryServer.create();
124
+ uri = mongoServer.getUri();
125
+ console.log('In-Memory MongoDB started successfully!');
126
+ }
127
+ await mongoose.connect(uri);
128
+ console.log('MongoDB connected successfully');
129
+ } catch (err) {
130
+ console.error('MongoDB connection error:', err);
131
+ }
132
+ };
133
+ connectDB();
134
+
135
+ // Serve Static Frontend (for Full-Stack Deployment)
136
+ const path = require('path');
137
+ const clientDistPath = path.join(__dirname, '../../client/dist');
138
+ app.use(express.static(clientDistPath));
139
+
140
+ app.get('*', (req, res, next) => {
141
+ if (req.path.startsWith('/api')) return next();
142
+ res.sendFile(path.join(clientDistPath, 'index.html'), (err) => {
143
+ if (err) res.send('SnapLocal Pro API is running with Real-time support... (Frontend not built yet)');
144
+ });
145
+ });
146
 
147
  const PORT = process.env.PORT || 5000;
148
  server.listen(PORT, () => {