Demonstration bridge between ATproto and GraphQL. Generate schema types and interface with the ATmosphere via GraphQL queries. Includes a TypeScript server with IDE.
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial commit

Tim Ryan fbc8b558

+2212
+14
.env.example
··· 1 + # Mothball GraphQL Server Configuration 2 + # Copy this file to .env and modify as needed 3 + 4 + # Server host (default: 0.0.0.0 for all interfaces) 5 + HOST=0.0.0.0 6 + 7 + # Server port (default: 8080) 8 + PORT=8080 9 + 10 + # Database connection string (if using database) 11 + # DATABASE_URL=postgres://user:password@localhost:5432/mothball 12 + 13 + # Logging level (debug, info, warn, error) 14 + # RUST_LOG=info
+52
.gitignore
··· 1 + # Rust 2 + # Generated by Cargo 3 + /target/ 4 + 5 + # IDE 6 + .idea/ 7 + *.iml 8 + *.swp 9 + *.swo 10 + 11 + # Environment 12 + .env 13 + .env.local 14 + .env.development.local 15 + .env.test.local 16 + .env.production.local 17 + 18 + # Logs 19 + logs/ 20 + *.log 21 + 22 + # OS generated files 23 + dcider.db 24 + .DS_Store 25 + .DS_Store? 26 + ._* 27 + .Spotlight-V100 28 + .Trashes 29 + .TemporaryItems 30 + .VolumeIcon.icns 31 + .Com.apple.timemachine.supported 32 + 33 + # macOS metadata 34 + ._* 35 + .DS_Store 36 + .DS_Store? 37 + .Spotlight-V100 38 + .TemporaryItems 39 + .Trashes 40 + .VolumeIcon.icns 41 + .Com.apple.timemachine.supported 42 + 43 + # Visual Studio Code 44 + .vscode/ 45 + !.vscode/settings.json 46 + !.vscode/tasks.json 47 + !.vscode/launch.json 48 + !.vscode/extensions.json 49 + !.vscode/workspace.vscode-control 50 + 51 + # Other editors 52 + . history
+6
.rules
··· 1 + # Mothball (Backend) 2 + 3 + This repo is for Mothball, an app for selling items locally. 4 + 5 + - The repo is written in Rust. 6 + - The primary frameworks are `axum` for powering the web server, `juniper` for powering the GraphQL engine.
+1486
Cargo.lock
··· 1 + # This file is automatically @generated by Cargo. 2 + # It is not intended for manual editing. 3 + version = 4 4 + 5 + [[package]] 6 + name = "android_system_properties" 7 + version = "0.1.5" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 10 + dependencies = [ 11 + "libc", 12 + ] 13 + 14 + [[package]] 15 + name = "arcstr" 16 + version = "1.2.0" 17 + source = "registry+https://github.com/rust-lang/crates.io-index" 18 + checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d" 19 + 20 + [[package]] 21 + name = "async-trait" 22 + version = "0.1.89" 23 + source = "registry+https://github.com/rust-lang/crates.io-index" 24 + checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" 25 + dependencies = [ 26 + "proc-macro2", 27 + "quote", 28 + "syn", 29 + ] 30 + 31 + [[package]] 32 + name = "atomic-waker" 33 + version = "1.1.2" 34 + source = "registry+https://github.com/rust-lang/crates.io-index" 35 + checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 36 + 37 + [[package]] 38 + name = "auto_enums" 39 + version = "0.8.7" 40 + source = "registry+https://github.com/rust-lang/crates.io-index" 41 + checksum = "9c170965892137a3a9aeb000b4524aa3cc022a310e709d848b6e1cdce4ab4781" 42 + dependencies = [ 43 + "derive_utils", 44 + "proc-macro2", 45 + "quote", 46 + "syn", 47 + ] 48 + 49 + [[package]] 50 + name = "autocfg" 51 + version = "1.5.0" 52 + source = "registry+https://github.com/rust-lang/crates.io-index" 53 + checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 54 + 55 + [[package]] 56 + name = "axum" 57 + version = "0.8.7" 58 + source = "registry+https://github.com/rust-lang/crates.io-index" 59 + checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" 60 + dependencies = [ 61 + "axum-core", 62 + "bytes", 63 + "form_urlencoded", 64 + "futures-util", 65 + "http", 66 + "http-body", 67 + "http-body-util", 68 + "hyper", 69 + "hyper-util", 70 + "itoa", 71 + "matchit", 72 + "memchr", 73 + "mime", 74 + "percent-encoding", 75 + "pin-project-lite", 76 + "serde_core", 77 + "serde_json", 78 + "serde_path_to_error", 79 + "serde_urlencoded", 80 + "sync_wrapper", 81 + "tokio", 82 + "tower", 83 + "tower-layer", 84 + "tower-service", 85 + "tracing", 86 + ] 87 + 88 + [[package]] 89 + name = "axum-core" 90 + version = "0.5.5" 91 + source = "registry+https://github.com/rust-lang/crates.io-index" 92 + checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22" 93 + dependencies = [ 94 + "bytes", 95 + "futures-core", 96 + "http", 97 + "http-body", 98 + "http-body-util", 99 + "mime", 100 + "pin-project-lite", 101 + "sync_wrapper", 102 + "tower-layer", 103 + "tower-service", 104 + "tracing", 105 + ] 106 + 107 + [[package]] 108 + name = "bitflags" 109 + version = "2.10.0" 110 + source = "registry+https://github.com/rust-lang/crates.io-index" 111 + checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 112 + 113 + [[package]] 114 + name = "bumpalo" 115 + version = "3.19.1" 116 + source = "registry+https://github.com/rust-lang/crates.io-index" 117 + checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" 118 + 119 + [[package]] 120 + name = "bytes" 121 + version = "1.11.0" 122 + source = "registry+https://github.com/rust-lang/crates.io-index" 123 + checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" 124 + 125 + [[package]] 126 + name = "castaway" 127 + version = "0.2.4" 128 + source = "registry+https://github.com/rust-lang/crates.io-index" 129 + checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" 130 + dependencies = [ 131 + "rustversion", 132 + ] 133 + 134 + [[package]] 135 + name = "cc" 136 + version = "1.2.49" 137 + source = "registry+https://github.com/rust-lang/crates.io-index" 138 + checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" 139 + dependencies = [ 140 + "find-msvc-tools", 141 + "shlex", 142 + ] 143 + 144 + [[package]] 145 + name = "cfg-if" 146 + version = "1.0.4" 147 + source = "registry+https://github.com/rust-lang/crates.io-index" 148 + checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 149 + 150 + [[package]] 151 + name = "chrono" 152 + version = "0.4.42" 153 + source = "registry+https://github.com/rust-lang/crates.io-index" 154 + checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" 155 + dependencies = [ 156 + "iana-time-zone", 157 + "js-sys", 158 + "num-traits", 159 + "wasm-bindgen", 160 + "windows-link", 161 + ] 162 + 163 + [[package]] 164 + name = "compact_str" 165 + version = "0.9.0" 166 + source = "registry+https://github.com/rust-lang/crates.io-index" 167 + checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" 168 + dependencies = [ 169 + "castaway", 170 + "cfg-if", 171 + "itoa", 172 + "rustversion", 173 + "ryu", 174 + "static_assertions", 175 + ] 176 + 177 + [[package]] 178 + name = "convert_case" 179 + version = "0.10.0" 180 + source = "registry+https://github.com/rust-lang/crates.io-index" 181 + checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" 182 + dependencies = [ 183 + "unicode-segmentation", 184 + ] 185 + 186 + [[package]] 187 + name = "core-foundation-sys" 188 + version = "0.8.7" 189 + source = "registry+https://github.com/rust-lang/crates.io-index" 190 + checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 191 + 192 + [[package]] 193 + name = "derive_more" 194 + version = "2.1.0" 195 + source = "registry+https://github.com/rust-lang/crates.io-index" 196 + checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" 197 + dependencies = [ 198 + "derive_more-impl", 199 + ] 200 + 201 + [[package]] 202 + name = "derive_more-impl" 203 + version = "2.1.0" 204 + source = "registry+https://github.com/rust-lang/crates.io-index" 205 + checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" 206 + dependencies = [ 207 + "convert_case", 208 + "proc-macro2", 209 + "quote", 210 + "rustc_version", 211 + "syn", 212 + "unicode-xid", 213 + ] 214 + 215 + [[package]] 216 + name = "derive_utils" 217 + version = "0.15.0" 218 + source = "registry+https://github.com/rust-lang/crates.io-index" 219 + checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" 220 + dependencies = [ 221 + "proc-macro2", 222 + "quote", 223 + "syn", 224 + ] 225 + 226 + [[package]] 227 + name = "displaydoc" 228 + version = "0.2.5" 229 + source = "registry+https://github.com/rust-lang/crates.io-index" 230 + checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 231 + dependencies = [ 232 + "proc-macro2", 233 + "quote", 234 + "syn", 235 + ] 236 + 237 + [[package]] 238 + name = "dotenv" 239 + version = "0.15.0" 240 + source = "registry+https://github.com/rust-lang/crates.io-index" 241 + checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 242 + 243 + [[package]] 244 + name = "either" 245 + version = "1.15.0" 246 + source = "registry+https://github.com/rust-lang/crates.io-index" 247 + checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 248 + 249 + [[package]] 250 + name = "equivalent" 251 + version = "1.0.2" 252 + source = "registry+https://github.com/rust-lang/crates.io-index" 253 + checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 254 + 255 + [[package]] 256 + name = "find-msvc-tools" 257 + version = "0.1.5" 258 + source = "registry+https://github.com/rust-lang/crates.io-index" 259 + checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" 260 + 261 + [[package]] 262 + name = "fnv" 263 + version = "1.0.7" 264 + source = "registry+https://github.com/rust-lang/crates.io-index" 265 + checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 266 + 267 + [[package]] 268 + name = "form_urlencoded" 269 + version = "1.2.2" 270 + source = "registry+https://github.com/rust-lang/crates.io-index" 271 + checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 272 + dependencies = [ 273 + "percent-encoding", 274 + ] 275 + 276 + [[package]] 277 + name = "futures" 278 + version = "0.3.31" 279 + source = "registry+https://github.com/rust-lang/crates.io-index" 280 + checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" 281 + dependencies = [ 282 + "futures-channel", 283 + "futures-core", 284 + "futures-executor", 285 + "futures-io", 286 + "futures-sink", 287 + "futures-task", 288 + "futures-util", 289 + ] 290 + 291 + [[package]] 292 + name = "futures-channel" 293 + version = "0.3.31" 294 + source = "registry+https://github.com/rust-lang/crates.io-index" 295 + checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 296 + dependencies = [ 297 + "futures-core", 298 + "futures-sink", 299 + ] 300 + 301 + [[package]] 302 + name = "futures-core" 303 + version = "0.3.31" 304 + source = "registry+https://github.com/rust-lang/crates.io-index" 305 + checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 306 + 307 + [[package]] 308 + name = "futures-executor" 309 + version = "0.3.31" 310 + source = "registry+https://github.com/rust-lang/crates.io-index" 311 + checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" 312 + dependencies = [ 313 + "futures-core", 314 + "futures-task", 315 + "futures-util", 316 + ] 317 + 318 + [[package]] 319 + name = "futures-io" 320 + version = "0.3.31" 321 + source = "registry+https://github.com/rust-lang/crates.io-index" 322 + checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 323 + 324 + [[package]] 325 + name = "futures-macro" 326 + version = "0.3.31" 327 + source = "registry+https://github.com/rust-lang/crates.io-index" 328 + checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" 329 + dependencies = [ 330 + "proc-macro2", 331 + "quote", 332 + "syn", 333 + ] 334 + 335 + [[package]] 336 + name = "futures-sink" 337 + version = "0.3.31" 338 + source = "registry+https://github.com/rust-lang/crates.io-index" 339 + checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 340 + 341 + [[package]] 342 + name = "futures-task" 343 + version = "0.3.31" 344 + source = "registry+https://github.com/rust-lang/crates.io-index" 345 + checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 346 + 347 + [[package]] 348 + name = "futures-util" 349 + version = "0.3.31" 350 + source = "registry+https://github.com/rust-lang/crates.io-index" 351 + checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 352 + dependencies = [ 353 + "futures-channel", 354 + "futures-core", 355 + "futures-io", 356 + "futures-macro", 357 + "futures-sink", 358 + "futures-task", 359 + "memchr", 360 + "pin-project-lite", 361 + "pin-utils", 362 + "slab", 363 + ] 364 + 365 + [[package]] 366 + name = "getrandom" 367 + version = "0.3.4" 368 + source = "registry+https://github.com/rust-lang/crates.io-index" 369 + checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 370 + dependencies = [ 371 + "cfg-if", 372 + "libc", 373 + "r-efi", 374 + "wasip2", 375 + ] 376 + 377 + [[package]] 378 + name = "hashbrown" 379 + version = "0.16.1" 380 + source = "registry+https://github.com/rust-lang/crates.io-index" 381 + checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" 382 + 383 + [[package]] 384 + name = "http" 385 + version = "1.4.0" 386 + source = "registry+https://github.com/rust-lang/crates.io-index" 387 + checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" 388 + dependencies = [ 389 + "bytes", 390 + "itoa", 391 + ] 392 + 393 + [[package]] 394 + name = "http-body" 395 + version = "1.0.1" 396 + source = "registry+https://github.com/rust-lang/crates.io-index" 397 + checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 398 + dependencies = [ 399 + "bytes", 400 + "http", 401 + ] 402 + 403 + [[package]] 404 + name = "http-body-util" 405 + version = "0.1.3" 406 + source = "registry+https://github.com/rust-lang/crates.io-index" 407 + checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" 408 + dependencies = [ 409 + "bytes", 410 + "futures-core", 411 + "http", 412 + "http-body", 413 + "pin-project-lite", 414 + ] 415 + 416 + [[package]] 417 + name = "httparse" 418 + version = "1.10.1" 419 + source = "registry+https://github.com/rust-lang/crates.io-index" 420 + checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 421 + 422 + [[package]] 423 + name = "httpdate" 424 + version = "1.0.3" 425 + source = "registry+https://github.com/rust-lang/crates.io-index" 426 + checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 427 + 428 + [[package]] 429 + name = "hyper" 430 + version = "1.8.1" 431 + source = "registry+https://github.com/rust-lang/crates.io-index" 432 + checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" 433 + dependencies = [ 434 + "atomic-waker", 435 + "bytes", 436 + "futures-channel", 437 + "futures-core", 438 + "http", 439 + "http-body", 440 + "httparse", 441 + "httpdate", 442 + "itoa", 443 + "pin-project-lite", 444 + "pin-utils", 445 + "smallvec", 446 + "tokio", 447 + ] 448 + 449 + [[package]] 450 + name = "hyper-util" 451 + version = "0.1.19" 452 + source = "registry+https://github.com/rust-lang/crates.io-index" 453 + checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" 454 + dependencies = [ 455 + "bytes", 456 + "futures-core", 457 + "http", 458 + "http-body", 459 + "hyper", 460 + "pin-project-lite", 461 + "tokio", 462 + "tower-service", 463 + ] 464 + 465 + [[package]] 466 + name = "iana-time-zone" 467 + version = "0.1.64" 468 + source = "registry+https://github.com/rust-lang/crates.io-index" 469 + checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" 470 + dependencies = [ 471 + "android_system_properties", 472 + "core-foundation-sys", 473 + "iana-time-zone-haiku", 474 + "js-sys", 475 + "log", 476 + "wasm-bindgen", 477 + "windows-core", 478 + ] 479 + 480 + [[package]] 481 + name = "iana-time-zone-haiku" 482 + version = "0.1.2" 483 + source = "registry+https://github.com/rust-lang/crates.io-index" 484 + checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 485 + dependencies = [ 486 + "cc", 487 + ] 488 + 489 + [[package]] 490 + name = "icu_collections" 491 + version = "2.1.1" 492 + source = "registry+https://github.com/rust-lang/crates.io-index" 493 + checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" 494 + dependencies = [ 495 + "displaydoc", 496 + "potential_utf", 497 + "yoke", 498 + "zerofrom", 499 + "zerovec", 500 + ] 501 + 502 + [[package]] 503 + name = "icu_locale_core" 504 + version = "2.1.1" 505 + source = "registry+https://github.com/rust-lang/crates.io-index" 506 + checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" 507 + dependencies = [ 508 + "displaydoc", 509 + "litemap", 510 + "tinystr", 511 + "writeable", 512 + "zerovec", 513 + ] 514 + 515 + [[package]] 516 + name = "icu_normalizer" 517 + version = "2.1.1" 518 + source = "registry+https://github.com/rust-lang/crates.io-index" 519 + checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" 520 + dependencies = [ 521 + "icu_collections", 522 + "icu_normalizer_data", 523 + "icu_properties", 524 + "icu_provider", 525 + "smallvec", 526 + "zerovec", 527 + ] 528 + 529 + [[package]] 530 + name = "icu_normalizer_data" 531 + version = "2.1.1" 532 + source = "registry+https://github.com/rust-lang/crates.io-index" 533 + checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" 534 + 535 + [[package]] 536 + name = "icu_properties" 537 + version = "2.1.2" 538 + source = "registry+https://github.com/rust-lang/crates.io-index" 539 + checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" 540 + dependencies = [ 541 + "icu_collections", 542 + "icu_locale_core", 543 + "icu_properties_data", 544 + "icu_provider", 545 + "zerotrie", 546 + "zerovec", 547 + ] 548 + 549 + [[package]] 550 + name = "icu_properties_data" 551 + version = "2.1.2" 552 + source = "registry+https://github.com/rust-lang/crates.io-index" 553 + checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" 554 + 555 + [[package]] 556 + name = "icu_provider" 557 + version = "2.1.1" 558 + source = "registry+https://github.com/rust-lang/crates.io-index" 559 + checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" 560 + dependencies = [ 561 + "displaydoc", 562 + "icu_locale_core", 563 + "writeable", 564 + "yoke", 565 + "zerofrom", 566 + "zerotrie", 567 + "zerovec", 568 + ] 569 + 570 + [[package]] 571 + name = "idna" 572 + version = "1.1.0" 573 + source = "registry+https://github.com/rust-lang/crates.io-index" 574 + checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" 575 + dependencies = [ 576 + "idna_adapter", 577 + "smallvec", 578 + "utf8_iter", 579 + ] 580 + 581 + [[package]] 582 + name = "idna_adapter" 583 + version = "1.2.1" 584 + source = "registry+https://github.com/rust-lang/crates.io-index" 585 + checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 586 + dependencies = [ 587 + "icu_normalizer", 588 + "icu_properties", 589 + ] 590 + 591 + [[package]] 592 + name = "indexmap" 593 + version = "2.12.1" 594 + source = "registry+https://github.com/rust-lang/crates.io-index" 595 + checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" 596 + dependencies = [ 597 + "equivalent", 598 + "hashbrown", 599 + "serde", 600 + "serde_core", 601 + ] 602 + 603 + [[package]] 604 + name = "itertools" 605 + version = "0.14.0" 606 + source = "registry+https://github.com/rust-lang/crates.io-index" 607 + checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" 608 + dependencies = [ 609 + "either", 610 + ] 611 + 612 + [[package]] 613 + name = "itoa" 614 + version = "1.0.15" 615 + source = "registry+https://github.com/rust-lang/crates.io-index" 616 + checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 617 + 618 + [[package]] 619 + name = "js-sys" 620 + version = "0.3.83" 621 + source = "registry+https://github.com/rust-lang/crates.io-index" 622 + checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" 623 + dependencies = [ 624 + "once_cell", 625 + "wasm-bindgen", 626 + ] 627 + 628 + [[package]] 629 + name = "juniper" 630 + version = "0.17.0" 631 + source = "registry+https://github.com/rust-lang/crates.io-index" 632 + checksum = "4feeb43439e89bc0cf5d86340374c828fc2b651de4750a970d6de5a4915a0d76" 633 + dependencies = [ 634 + "arcstr", 635 + "async-trait", 636 + "auto_enums", 637 + "compact_str", 638 + "derive_more", 639 + "fnv", 640 + "futures", 641 + "indexmap", 642 + "itertools", 643 + "juniper_codegen", 644 + "ref-cast", 645 + "serde", 646 + "static_assertions", 647 + ] 648 + 649 + [[package]] 650 + name = "juniper_axum" 651 + version = "0.3.0" 652 + source = "registry+https://github.com/rust-lang/crates.io-index" 653 + checksum = "d749d056510f6d762ceca1ae6bb53d50fd77019e5be65fe4bf2eca305a18b8ba" 654 + dependencies = [ 655 + "axum", 656 + "bytes", 657 + "juniper", 658 + "juniper_graphql_ws", 659 + "serde", 660 + "serde_json", 661 + ] 662 + 663 + [[package]] 664 + name = "juniper_codegen" 665 + version = "0.17.0" 666 + source = "registry+https://github.com/rust-lang/crates.io-index" 667 + checksum = "8634f500d6d2ec5c91c115b83e15d998d9ea05645aaa43f7afec09e660c483ba" 668 + dependencies = [ 669 + "derive_more", 670 + "proc-macro2", 671 + "quote", 672 + "syn", 673 + "url", 674 + ] 675 + 676 + [[package]] 677 + name = "juniper_graphql_ws" 678 + version = "0.5.0" 679 + source = "registry+https://github.com/rust-lang/crates.io-index" 680 + checksum = "02f74a1d6d28f29edd4e72db014229efef9b3c3baa5cdf64ebc76b82ee146fa5" 681 + dependencies = [ 682 + "derive_more", 683 + "juniper", 684 + "juniper_subscriptions", 685 + "serde", 686 + "tokio", 687 + ] 688 + 689 + [[package]] 690 + name = "juniper_subscriptions" 691 + version = "0.18.0" 692 + source = "registry+https://github.com/rust-lang/crates.io-index" 693 + checksum = "0aeaaedf8fe890b09a712224de8bf509477194fdeb35a39c32d8ada8ac754972" 694 + dependencies = [ 695 + "futures", 696 + "juniper", 697 + ] 698 + 699 + [[package]] 700 + name = "libc" 701 + version = "0.2.178" 702 + source = "registry+https://github.com/rust-lang/crates.io-index" 703 + checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" 704 + 705 + [[package]] 706 + name = "litemap" 707 + version = "0.8.1" 708 + source = "registry+https://github.com/rust-lang/crates.io-index" 709 + checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" 710 + 711 + [[package]] 712 + name = "lock_api" 713 + version = "0.4.14" 714 + source = "registry+https://github.com/rust-lang/crates.io-index" 715 + checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" 716 + dependencies = [ 717 + "scopeguard", 718 + ] 719 + 720 + [[package]] 721 + name = "log" 722 + version = "0.4.29" 723 + source = "registry+https://github.com/rust-lang/crates.io-index" 724 + checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 725 + 726 + [[package]] 727 + name = "matchit" 728 + version = "0.8.4" 729 + source = "registry+https://github.com/rust-lang/crates.io-index" 730 + checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" 731 + 732 + [[package]] 733 + name = "memchr" 734 + version = "2.7.6" 735 + source = "registry+https://github.com/rust-lang/crates.io-index" 736 + checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 737 + 738 + [[package]] 739 + name = "mime" 740 + version = "0.3.17" 741 + source = "registry+https://github.com/rust-lang/crates.io-index" 742 + checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 743 + 744 + [[package]] 745 + name = "mio" 746 + version = "1.1.1" 747 + source = "registry+https://github.com/rust-lang/crates.io-index" 748 + checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" 749 + dependencies = [ 750 + "libc", 751 + "wasi", 752 + "windows-sys 0.61.2", 753 + ] 754 + 755 + [[package]] 756 + name = "mothball-server" 757 + version = "0.1.0" 758 + dependencies = [ 759 + "axum", 760 + "chrono", 761 + "dotenv", 762 + "juniper", 763 + "juniper_axum", 764 + "serde", 765 + "serde_json", 766 + "tokio", 767 + "uuid", 768 + ] 769 + 770 + [[package]] 771 + name = "num-traits" 772 + version = "0.2.19" 773 + source = "registry+https://github.com/rust-lang/crates.io-index" 774 + checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 775 + dependencies = [ 776 + "autocfg", 777 + ] 778 + 779 + [[package]] 780 + name = "once_cell" 781 + version = "1.21.3" 782 + source = "registry+https://github.com/rust-lang/crates.io-index" 783 + checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 784 + 785 + [[package]] 786 + name = "parking_lot" 787 + version = "0.12.5" 788 + source = "registry+https://github.com/rust-lang/crates.io-index" 789 + checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" 790 + dependencies = [ 791 + "lock_api", 792 + "parking_lot_core", 793 + ] 794 + 795 + [[package]] 796 + name = "parking_lot_core" 797 + version = "0.9.12" 798 + source = "registry+https://github.com/rust-lang/crates.io-index" 799 + checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" 800 + dependencies = [ 801 + "cfg-if", 802 + "libc", 803 + "redox_syscall", 804 + "smallvec", 805 + "windows-link", 806 + ] 807 + 808 + [[package]] 809 + name = "percent-encoding" 810 + version = "2.3.2" 811 + source = "registry+https://github.com/rust-lang/crates.io-index" 812 + checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 813 + 814 + [[package]] 815 + name = "pin-project-lite" 816 + version = "0.2.16" 817 + source = "registry+https://github.com/rust-lang/crates.io-index" 818 + checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 819 + 820 + [[package]] 821 + name = "pin-utils" 822 + version = "0.1.0" 823 + source = "registry+https://github.com/rust-lang/crates.io-index" 824 + checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 825 + 826 + [[package]] 827 + name = "potential_utf" 828 + version = "0.1.4" 829 + source = "registry+https://github.com/rust-lang/crates.io-index" 830 + checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" 831 + dependencies = [ 832 + "zerovec", 833 + ] 834 + 835 + [[package]] 836 + name = "proc-macro2" 837 + version = "1.0.103" 838 + source = "registry+https://github.com/rust-lang/crates.io-index" 839 + checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" 840 + dependencies = [ 841 + "unicode-ident", 842 + ] 843 + 844 + [[package]] 845 + name = "quote" 846 + version = "1.0.42" 847 + source = "registry+https://github.com/rust-lang/crates.io-index" 848 + checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 849 + dependencies = [ 850 + "proc-macro2", 851 + ] 852 + 853 + [[package]] 854 + name = "r-efi" 855 + version = "5.3.0" 856 + source = "registry+https://github.com/rust-lang/crates.io-index" 857 + checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 858 + 859 + [[package]] 860 + name = "redox_syscall" 861 + version = "0.5.18" 862 + source = "registry+https://github.com/rust-lang/crates.io-index" 863 + checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" 864 + dependencies = [ 865 + "bitflags", 866 + ] 867 + 868 + [[package]] 869 + name = "ref-cast" 870 + version = "1.0.25" 871 + source = "registry+https://github.com/rust-lang/crates.io-index" 872 + checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" 873 + dependencies = [ 874 + "ref-cast-impl", 875 + ] 876 + 877 + [[package]] 878 + name = "ref-cast-impl" 879 + version = "1.0.25" 880 + source = "registry+https://github.com/rust-lang/crates.io-index" 881 + checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" 882 + dependencies = [ 883 + "proc-macro2", 884 + "quote", 885 + "syn", 886 + ] 887 + 888 + [[package]] 889 + name = "rustc_version" 890 + version = "0.4.1" 891 + source = "registry+https://github.com/rust-lang/crates.io-index" 892 + checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 893 + dependencies = [ 894 + "semver", 895 + ] 896 + 897 + [[package]] 898 + name = "rustversion" 899 + version = "1.0.22" 900 + source = "registry+https://github.com/rust-lang/crates.io-index" 901 + checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 902 + 903 + [[package]] 904 + name = "ryu" 905 + version = "1.0.20" 906 + source = "registry+https://github.com/rust-lang/crates.io-index" 907 + checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 908 + 909 + [[package]] 910 + name = "scopeguard" 911 + version = "1.2.0" 912 + source = "registry+https://github.com/rust-lang/crates.io-index" 913 + checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 914 + 915 + [[package]] 916 + name = "semver" 917 + version = "1.0.27" 918 + source = "registry+https://github.com/rust-lang/crates.io-index" 919 + checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 920 + 921 + [[package]] 922 + name = "serde" 923 + version = "1.0.228" 924 + source = "registry+https://github.com/rust-lang/crates.io-index" 925 + checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 926 + dependencies = [ 927 + "serde_core", 928 + "serde_derive", 929 + ] 930 + 931 + [[package]] 932 + name = "serde_core" 933 + version = "1.0.228" 934 + source = "registry+https://github.com/rust-lang/crates.io-index" 935 + checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 936 + dependencies = [ 937 + "serde_derive", 938 + ] 939 + 940 + [[package]] 941 + name = "serde_derive" 942 + version = "1.0.228" 943 + source = "registry+https://github.com/rust-lang/crates.io-index" 944 + checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 945 + dependencies = [ 946 + "proc-macro2", 947 + "quote", 948 + "syn", 949 + ] 950 + 951 + [[package]] 952 + name = "serde_json" 953 + version = "1.0.145" 954 + source = "registry+https://github.com/rust-lang/crates.io-index" 955 + checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" 956 + dependencies = [ 957 + "itoa", 958 + "memchr", 959 + "ryu", 960 + "serde", 961 + "serde_core", 962 + ] 963 + 964 + [[package]] 965 + name = "serde_path_to_error" 966 + version = "0.1.20" 967 + source = "registry+https://github.com/rust-lang/crates.io-index" 968 + checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" 969 + dependencies = [ 970 + "itoa", 971 + "serde", 972 + "serde_core", 973 + ] 974 + 975 + [[package]] 976 + name = "serde_urlencoded" 977 + version = "0.7.1" 978 + source = "registry+https://github.com/rust-lang/crates.io-index" 979 + checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 980 + dependencies = [ 981 + "form_urlencoded", 982 + "itoa", 983 + "ryu", 984 + "serde", 985 + ] 986 + 987 + [[package]] 988 + name = "shlex" 989 + version = "1.3.0" 990 + source = "registry+https://github.com/rust-lang/crates.io-index" 991 + checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 992 + 993 + [[package]] 994 + name = "signal-hook-registry" 995 + version = "1.4.7" 996 + source = "registry+https://github.com/rust-lang/crates.io-index" 997 + checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" 998 + dependencies = [ 999 + "libc", 1000 + ] 1001 + 1002 + [[package]] 1003 + name = "slab" 1004 + version = "0.4.11" 1005 + source = "registry+https://github.com/rust-lang/crates.io-index" 1006 + checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" 1007 + 1008 + [[package]] 1009 + name = "smallvec" 1010 + version = "1.15.1" 1011 + source = "registry+https://github.com/rust-lang/crates.io-index" 1012 + checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1013 + 1014 + [[package]] 1015 + name = "socket2" 1016 + version = "0.6.1" 1017 + source = "registry+https://github.com/rust-lang/crates.io-index" 1018 + checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" 1019 + dependencies = [ 1020 + "libc", 1021 + "windows-sys 0.60.2", 1022 + ] 1023 + 1024 + [[package]] 1025 + name = "stable_deref_trait" 1026 + version = "1.2.1" 1027 + source = "registry+https://github.com/rust-lang/crates.io-index" 1028 + checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" 1029 + 1030 + [[package]] 1031 + name = "static_assertions" 1032 + version = "1.1.0" 1033 + source = "registry+https://github.com/rust-lang/crates.io-index" 1034 + checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1035 + 1036 + [[package]] 1037 + name = "syn" 1038 + version = "2.0.111" 1039 + source = "registry+https://github.com/rust-lang/crates.io-index" 1040 + checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" 1041 + dependencies = [ 1042 + "proc-macro2", 1043 + "quote", 1044 + "unicode-ident", 1045 + ] 1046 + 1047 + [[package]] 1048 + name = "sync_wrapper" 1049 + version = "1.0.2" 1050 + source = "registry+https://github.com/rust-lang/crates.io-index" 1051 + checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 1052 + 1053 + [[package]] 1054 + name = "synstructure" 1055 + version = "0.13.2" 1056 + source = "registry+https://github.com/rust-lang/crates.io-index" 1057 + checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1058 + dependencies = [ 1059 + "proc-macro2", 1060 + "quote", 1061 + "syn", 1062 + ] 1063 + 1064 + [[package]] 1065 + name = "tinystr" 1066 + version = "0.8.2" 1067 + source = "registry+https://github.com/rust-lang/crates.io-index" 1068 + checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" 1069 + dependencies = [ 1070 + "displaydoc", 1071 + "zerovec", 1072 + ] 1073 + 1074 + [[package]] 1075 + name = "tokio" 1076 + version = "1.48.0" 1077 + source = "registry+https://github.com/rust-lang/crates.io-index" 1078 + checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" 1079 + dependencies = [ 1080 + "bytes", 1081 + "libc", 1082 + "mio", 1083 + "parking_lot", 1084 + "pin-project-lite", 1085 + "signal-hook-registry", 1086 + "socket2", 1087 + "tokio-macros", 1088 + "windows-sys 0.61.2", 1089 + ] 1090 + 1091 + [[package]] 1092 + name = "tokio-macros" 1093 + version = "2.6.0" 1094 + source = "registry+https://github.com/rust-lang/crates.io-index" 1095 + checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" 1096 + dependencies = [ 1097 + "proc-macro2", 1098 + "quote", 1099 + "syn", 1100 + ] 1101 + 1102 + [[package]] 1103 + name = "tower" 1104 + version = "0.5.2" 1105 + source = "registry+https://github.com/rust-lang/crates.io-index" 1106 + checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" 1107 + dependencies = [ 1108 + "futures-core", 1109 + "futures-util", 1110 + "pin-project-lite", 1111 + "sync_wrapper", 1112 + "tokio", 1113 + "tower-layer", 1114 + "tower-service", 1115 + "tracing", 1116 + ] 1117 + 1118 + [[package]] 1119 + name = "tower-layer" 1120 + version = "0.3.3" 1121 + source = "registry+https://github.com/rust-lang/crates.io-index" 1122 + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1123 + 1124 + [[package]] 1125 + name = "tower-service" 1126 + version = "0.3.3" 1127 + source = "registry+https://github.com/rust-lang/crates.io-index" 1128 + checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1129 + 1130 + [[package]] 1131 + name = "tracing" 1132 + version = "0.1.44" 1133 + source = "registry+https://github.com/rust-lang/crates.io-index" 1134 + checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" 1135 + dependencies = [ 1136 + "log", 1137 + "pin-project-lite", 1138 + "tracing-core", 1139 + ] 1140 + 1141 + [[package]] 1142 + name = "tracing-core" 1143 + version = "0.1.36" 1144 + source = "registry+https://github.com/rust-lang/crates.io-index" 1145 + checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" 1146 + dependencies = [ 1147 + "once_cell", 1148 + ] 1149 + 1150 + [[package]] 1151 + name = "unicode-ident" 1152 + version = "1.0.22" 1153 + source = "registry+https://github.com/rust-lang/crates.io-index" 1154 + checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 1155 + 1156 + [[package]] 1157 + name = "unicode-segmentation" 1158 + version = "1.12.0" 1159 + source = "registry+https://github.com/rust-lang/crates.io-index" 1160 + checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" 1161 + 1162 + [[package]] 1163 + name = "unicode-xid" 1164 + version = "0.2.6" 1165 + source = "registry+https://github.com/rust-lang/crates.io-index" 1166 + checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 1167 + 1168 + [[package]] 1169 + name = "url" 1170 + version = "2.5.7" 1171 + source = "registry+https://github.com/rust-lang/crates.io-index" 1172 + checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" 1173 + dependencies = [ 1174 + "form_urlencoded", 1175 + "idna", 1176 + "percent-encoding", 1177 + "serde", 1178 + ] 1179 + 1180 + [[package]] 1181 + name = "utf8_iter" 1182 + version = "1.0.4" 1183 + source = "registry+https://github.com/rust-lang/crates.io-index" 1184 + checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1185 + 1186 + [[package]] 1187 + name = "uuid" 1188 + version = "1.19.0" 1189 + source = "registry+https://github.com/rust-lang/crates.io-index" 1190 + checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" 1191 + dependencies = [ 1192 + "getrandom", 1193 + "js-sys", 1194 + "wasm-bindgen", 1195 + ] 1196 + 1197 + [[package]] 1198 + name = "wasi" 1199 + version = "0.11.1+wasi-snapshot-preview1" 1200 + source = "registry+https://github.com/rust-lang/crates.io-index" 1201 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 1202 + 1203 + [[package]] 1204 + name = "wasip2" 1205 + version = "1.0.1+wasi-0.2.4" 1206 + source = "registry+https://github.com/rust-lang/crates.io-index" 1207 + checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" 1208 + dependencies = [ 1209 + "wit-bindgen", 1210 + ] 1211 + 1212 + [[package]] 1213 + name = "wasm-bindgen" 1214 + version = "0.2.106" 1215 + source = "registry+https://github.com/rust-lang/crates.io-index" 1216 + checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" 1217 + dependencies = [ 1218 + "cfg-if", 1219 + "once_cell", 1220 + "rustversion", 1221 + "wasm-bindgen-macro", 1222 + "wasm-bindgen-shared", 1223 + ] 1224 + 1225 + [[package]] 1226 + name = "wasm-bindgen-macro" 1227 + version = "0.2.106" 1228 + source = "registry+https://github.com/rust-lang/crates.io-index" 1229 + checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" 1230 + dependencies = [ 1231 + "quote", 1232 + "wasm-bindgen-macro-support", 1233 + ] 1234 + 1235 + [[package]] 1236 + name = "wasm-bindgen-macro-support" 1237 + version = "0.2.106" 1238 + source = "registry+https://github.com/rust-lang/crates.io-index" 1239 + checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" 1240 + dependencies = [ 1241 + "bumpalo", 1242 + "proc-macro2", 1243 + "quote", 1244 + "syn", 1245 + "wasm-bindgen-shared", 1246 + ] 1247 + 1248 + [[package]] 1249 + name = "wasm-bindgen-shared" 1250 + version = "0.2.106" 1251 + source = "registry+https://github.com/rust-lang/crates.io-index" 1252 + checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" 1253 + dependencies = [ 1254 + "unicode-ident", 1255 + ] 1256 + 1257 + [[package]] 1258 + name = "windows-core" 1259 + version = "0.62.2" 1260 + source = "registry+https://github.com/rust-lang/crates.io-index" 1261 + checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" 1262 + dependencies = [ 1263 + "windows-implement", 1264 + "windows-interface", 1265 + "windows-link", 1266 + "windows-result", 1267 + "windows-strings", 1268 + ] 1269 + 1270 + [[package]] 1271 + name = "windows-implement" 1272 + version = "0.60.2" 1273 + source = "registry+https://github.com/rust-lang/crates.io-index" 1274 + checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" 1275 + dependencies = [ 1276 + "proc-macro2", 1277 + "quote", 1278 + "syn", 1279 + ] 1280 + 1281 + [[package]] 1282 + name = "windows-interface" 1283 + version = "0.59.3" 1284 + source = "registry+https://github.com/rust-lang/crates.io-index" 1285 + checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" 1286 + dependencies = [ 1287 + "proc-macro2", 1288 + "quote", 1289 + "syn", 1290 + ] 1291 + 1292 + [[package]] 1293 + name = "windows-link" 1294 + version = "0.2.1" 1295 + source = "registry+https://github.com/rust-lang/crates.io-index" 1296 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 1297 + 1298 + [[package]] 1299 + name = "windows-result" 1300 + version = "0.4.1" 1301 + source = "registry+https://github.com/rust-lang/crates.io-index" 1302 + checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 1303 + dependencies = [ 1304 + "windows-link", 1305 + ] 1306 + 1307 + [[package]] 1308 + name = "windows-strings" 1309 + version = "0.5.1" 1310 + source = "registry+https://github.com/rust-lang/crates.io-index" 1311 + checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" 1312 + dependencies = [ 1313 + "windows-link", 1314 + ] 1315 + 1316 + [[package]] 1317 + name = "windows-sys" 1318 + version = "0.60.2" 1319 + source = "registry+https://github.com/rust-lang/crates.io-index" 1320 + checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 1321 + dependencies = [ 1322 + "windows-targets", 1323 + ] 1324 + 1325 + [[package]] 1326 + name = "windows-sys" 1327 + version = "0.61.2" 1328 + source = "registry+https://github.com/rust-lang/crates.io-index" 1329 + checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 1330 + dependencies = [ 1331 + "windows-link", 1332 + ] 1333 + 1334 + [[package]] 1335 + name = "windows-targets" 1336 + version = "0.53.5" 1337 + source = "registry+https://github.com/rust-lang/crates.io-index" 1338 + checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" 1339 + dependencies = [ 1340 + "windows-link", 1341 + "windows_aarch64_gnullvm", 1342 + "windows_aarch64_msvc", 1343 + "windows_i686_gnu", 1344 + "windows_i686_gnullvm", 1345 + "windows_i686_msvc", 1346 + "windows_x86_64_gnu", 1347 + "windows_x86_64_gnullvm", 1348 + "windows_x86_64_msvc", 1349 + ] 1350 + 1351 + [[package]] 1352 + name = "windows_aarch64_gnullvm" 1353 + version = "0.53.1" 1354 + source = "registry+https://github.com/rust-lang/crates.io-index" 1355 + checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" 1356 + 1357 + [[package]] 1358 + name = "windows_aarch64_msvc" 1359 + version = "0.53.1" 1360 + source = "registry+https://github.com/rust-lang/crates.io-index" 1361 + checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" 1362 + 1363 + [[package]] 1364 + name = "windows_i686_gnu" 1365 + version = "0.53.1" 1366 + source = "registry+https://github.com/rust-lang/crates.io-index" 1367 + checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" 1368 + 1369 + [[package]] 1370 + name = "windows_i686_gnullvm" 1371 + version = "0.53.1" 1372 + source = "registry+https://github.com/rust-lang/crates.io-index" 1373 + checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" 1374 + 1375 + [[package]] 1376 + name = "windows_i686_msvc" 1377 + version = "0.53.1" 1378 + source = "registry+https://github.com/rust-lang/crates.io-index" 1379 + checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" 1380 + 1381 + [[package]] 1382 + name = "windows_x86_64_gnu" 1383 + version = "0.53.1" 1384 + source = "registry+https://github.com/rust-lang/crates.io-index" 1385 + checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" 1386 + 1387 + [[package]] 1388 + name = "windows_x86_64_gnullvm" 1389 + version = "0.53.1" 1390 + source = "registry+https://github.com/rust-lang/crates.io-index" 1391 + checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" 1392 + 1393 + [[package]] 1394 + name = "windows_x86_64_msvc" 1395 + version = "0.53.1" 1396 + source = "registry+https://github.com/rust-lang/crates.io-index" 1397 + checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" 1398 + 1399 + [[package]] 1400 + name = "wit-bindgen" 1401 + version = "0.46.0" 1402 + source = "registry+https://github.com/rust-lang/crates.io-index" 1403 + checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" 1404 + 1405 + [[package]] 1406 + name = "writeable" 1407 + version = "0.6.2" 1408 + source = "registry+https://github.com/rust-lang/crates.io-index" 1409 + checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" 1410 + 1411 + [[package]] 1412 + name = "yoke" 1413 + version = "0.8.1" 1414 + source = "registry+https://github.com/rust-lang/crates.io-index" 1415 + checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" 1416 + dependencies = [ 1417 + "stable_deref_trait", 1418 + "yoke-derive", 1419 + "zerofrom", 1420 + ] 1421 + 1422 + [[package]] 1423 + name = "yoke-derive" 1424 + version = "0.8.1" 1425 + source = "registry+https://github.com/rust-lang/crates.io-index" 1426 + checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" 1427 + dependencies = [ 1428 + "proc-macro2", 1429 + "quote", 1430 + "syn", 1431 + "synstructure", 1432 + ] 1433 + 1434 + [[package]] 1435 + name = "zerofrom" 1436 + version = "0.1.6" 1437 + source = "registry+https://github.com/rust-lang/crates.io-index" 1438 + checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 1439 + dependencies = [ 1440 + "zerofrom-derive", 1441 + ] 1442 + 1443 + [[package]] 1444 + name = "zerofrom-derive" 1445 + version = "0.1.6" 1446 + source = "registry+https://github.com/rust-lang/crates.io-index" 1447 + checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 1448 + dependencies = [ 1449 + "proc-macro2", 1450 + "quote", 1451 + "syn", 1452 + "synstructure", 1453 + ] 1454 + 1455 + [[package]] 1456 + name = "zerotrie" 1457 + version = "0.2.3" 1458 + source = "registry+https://github.com/rust-lang/crates.io-index" 1459 + checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" 1460 + dependencies = [ 1461 + "displaydoc", 1462 + "yoke", 1463 + "zerofrom", 1464 + ] 1465 + 1466 + [[package]] 1467 + name = "zerovec" 1468 + version = "0.11.5" 1469 + source = "registry+https://github.com/rust-lang/crates.io-index" 1470 + checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" 1471 + dependencies = [ 1472 + "yoke", 1473 + "zerofrom", 1474 + "zerovec-derive", 1475 + ] 1476 + 1477 + [[package]] 1478 + name = "zerovec-derive" 1479 + version = "0.11.2" 1480 + source = "registry+https://github.com/rust-lang/crates.io-index" 1481 + checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" 1482 + dependencies = [ 1483 + "proc-macro2", 1484 + "quote", 1485 + "syn", 1486 + ]
+15
Cargo.toml
··· 1 + [package] 2 + name = "mothball-server" 3 + version = "0.1.0" 4 + edition = "2021" 5 + 6 + [dependencies] 7 + axum = "0.8" 8 + juniper = "0.17" 9 + juniper_axum = "0.3" 10 + serde = { version = "1.0", features = ["derive"] } 11 + serde_json = "1.0" 12 + tokio = { version = "1.0", features = ["full"] } 13 + dotenv = "0.15" 14 + chrono = "0.4" 15 + uuid = { version = "1.0", features = ["v4"] }
+35
Dockerfile
··· 1 + # Dockerfile for Mothball GraphQL Server 2 + # Multi-stage build to keep the final image small 3 + 4 + # Stage 1: Build the Rust application 5 + FROM rust:1.60-slim as builder 6 + 7 + WORKDIR /app 8 + 9 + # Copy the entire project 10 + COPY . . 11 + 12 + # Build the application in release mode 13 + RUN cargo build --release 14 + 15 + # Stage 2: Create the final lightweight image 16 + FROM debian:bullseye-slim 17 + 18 + # Install only the essential dependencies 19 + RUN apt-get update && \ 20 + apt-get install -y ca-certificates && \ 21 + rm -rf /var/lib/apt/lists/* 22 + 23 + WORKDIR /app 24 + 25 + # Copy the compiled binary from the builder stage 26 + COPY --from=builder /app/target/release/mothball-server . 27 + 28 + # Copy environment variables and static files 29 + COPY .env . 30 + 31 + # Expose the port the app runs on 32 + EXPOSE 8080 33 + 34 + # Command to run the application 35 + CMD ["./mothball-server"]
+102
README.md
··· 1 + # Mothball GraphQL Server 2 + 3 + A simple GraphQL server for the Mothball application, built with Rust, Actix Web, and Juniper. 4 + 5 + ## Features 6 + 7 + - GraphQL API endpoint at `/graphql` 8 + - Interactive GraphiQL interface for development 9 + - Health check endpoint at `/health` 10 + - Environment-based configuration 11 + - Ready for deployment to Fly.io 12 + 13 + ## Installation 14 + 15 + ### Prerequisites 16 + 17 + - Rust (latest stable version) 18 + - Cargo 19 + - Fly.io CLI (for deployment) 20 + 21 + ### Building 22 + 23 + ```bash 24 + cd mothball-server 25 + cargo build --release 26 + ``` 27 + 28 + ### Running Locally 29 + 30 + ```bash 31 + # Copy the example environment file 32 + cp .env.example .env 33 + 34 + # Run the server 35 + cargo run 36 + ``` 37 + 38 + The server will start on `http://localhost:8080` by default. 39 + 40 + ## Development 41 + 42 + ### GraphQL Schema 43 + 44 + The server provides basic queries: 45 + - `hello`: Returns a greeting message 46 + - `health`: Returns server health status 47 + 48 + ### Extending the Schema 49 + 50 + To add new GraphQL types and queries: 51 + 1. Add new types to the `Query` struct in `src/main.rs` 52 + 2. Use the `#[juniper::graphql_object]` attribute 53 + 3. Add async functions for each query/mutation 54 + 55 + ## Deployment to Fly.io 56 + 57 + ### Prerequisites 58 + - Fly.io account 59 + - Fly.io CLI installed 60 + 61 + ### Deployment Steps 62 + 63 + 1. **Install Fly.io CLI** (if not already installed): 64 + ```bash 65 + curl -L https://fly.io/install.sh | sh 66 + ``` 67 + 68 + 2. **Login to Fly.io**: 69 + ```bash 70 + fly auth login 71 + ``` 72 + 73 + 3. **Create a new Fly.io app**: 74 + ```bash 75 + fly launch 76 + ``` 77 + 78 + 4. **Set up PostgreSQL (if needed)**: 79 + ```bash 80 + fly postgres create 81 + ``` 82 + 83 + 5. **Deploy**: 84 + ```bash 85 + fly deploy 86 + ``` 87 + 88 + ### Environment Configuration 89 + 90 + Copy `.env.example` to `.env` and configure as needed for your deployment. 91 + 92 + ## Configuration 93 + 94 + | Variable | Default | Description | 95 + |----------|---------|-------------| 96 + | `HOST` | `0.0.0.0` | Host to bind the server to | 97 + | `PORT` | `8080` | Port to listen on | 98 + | `DATABASE_URL` | (none) | Database connection string | 99 + 100 + ## License 101 + 102 + MIT
+23
fly.toml
··· 1 + # fly.toml app configuration 2 + # See https://fly.io/docs/reference/configuration/ for information about how to use this file. 3 + 4 + app = "mothball-server" 5 + primary_region = "iad" 6 + 7 + [build] 8 + dockerfile = "Dockerfile" 9 + 10 + [env] 11 + PRIMARY_REGION = "iad" 12 + 13 + [http_service] 14 + internal_port = 8080 15 + force_https = true 16 + auto_stop_machines = true 17 + auto_start_machines = true 18 + min_machines_running = 1 19 + 20 + [[vm]] 21 + cpu_kind = "shared" 22 + cpus = 1 23 + memory_mb = 1024
+60
graphql/useInventoryQuery.json
··· 1 + { 2 + "data": { 3 + "inventory": [ 4 + { 5 + "id": "ikea-desk", 6 + "title": "Large IKEA Desk - Spacious Workspace", 7 + "cost": "20.00", 8 + "images": [ 9 + "https://www.ikea.com/us/en/images/products/linnmon-adils-desk-black-brown__0974302_pe812345_s5.jpg?f=xl" 10 + ], 11 + "description": "Specifications:\n\n- Dimensions: 79\" long tabletop\n- Color: Black-brown\n- Model: LINNMON with ADILS legs\n- Condition: Used, good overall state\n\nThis versatile desk has been a reliable workspace for multiple years. Ideal for various activities including:\n\n- Computer setup\n- Crafting\n- Project work\n- Organizational tasks\n\nSlight cosmetic wear, minor surface imperfections.\n\nPricing:\n\n- Retail replacement cost: Approximately $100\n- Selling price: $30\n\nFlexible payment options available.", 12 + "location": "Portland, OR", 13 + "condition": "Used - Good", 14 + "category": "Furniture", 15 + "postedAt": "2024-01-15" 16 + }, 17 + { 18 + "id": "orbi-router", 19 + "title": "Orbi Router", 20 + "cost": "0", 21 + "images": [ 22 + "https://www.netgear.com/support/cloudimage/1/11/123573" 23 + ], 24 + "description": "This is an orbi wireless router. Normally it comes with satellites but\nthis one does not.", 25 + "location": "Portland, OR", 26 + "condition": "Used - Good", 27 + "category": "Electronics", 28 + "postedAt": "2024-01-18" 29 + }, 30 + { 31 + "id": "arris-router", 32 + "title": "Arris Router", 33 + "cost": "10.00", 34 + "images": [ 35 + "https://m.media-amazon.com/images/I/71gmmM9G8CL._AC_SY879_.jpg" 36 + ], 37 + "description": "This is an Arris SURFBoard router.", 38 + "location": "Portland, OR", 39 + "condition": "Used - Good", 40 + "category": "Electronics", 41 + "postedAt": "2024-01-20" 42 + }, 43 + { 44 + "id": "dell-soundbar", 45 + "title": "Dell Stereo SoundBar - AC511M", 46 + "cost": "10.00", 47 + "images": [ 48 + "https://m.media-amazon.com/images/I/71MiidZgcfL._AC_SX679_.jpg", 49 + "https://m.media-amazon.com/images/I/71VKkGixWWL._AC_SX679_.jpg" 50 + ], 51 + "description": "- Until you hear it you'll hardly notice it's there Dell Stereo Soundbar can give you the sound you want without big speakers and Long cables.Total usb ports:1\n- USB powered the Dell Stereo Soundbar is simplicity itself Just Plug in to an available USB port on your monitor or laptop No extra software Installation No power cord No Batteries required\n- An included Soundbar mount offers Easy attachment to the monitor allowing you to enjoy clear Stereo sound without losing desk space", 52 + "location": "Portland, OR", 53 + "condition": "Used - Good", 54 + "category": "Electronics", 55 + "postedAt": "2024-01-22" 56 + } 57 + ] 58 + }, 59 + "errors": [] 60 + }
+167
graphql/useMessagesQuery.json
··· 1 + { 2 + "data": { 3 + "chats": [ 4 + { 5 + "id": "chat:1", 6 + "sender": "John Doe", 7 + "avatar": "JD", 8 + "unread": true, 9 + "messages": [ 10 + { 11 + "id": "chat:1:1", 12 + "sender": "them", 13 + "text": "Hi, I'm interested in your vintage lamp. Is it still available?", 14 + "time": "2:30 PM" 15 + }, 16 + { 17 + "id": "chat:1:2", 18 + "sender": "me", 19 + "text": "Yes, the vintage lamp is still available. Would you like more details about it?", 20 + "time": "2:31 PM" 21 + }, 22 + { 23 + "id": "chat:1:3", 24 + "sender": "them", 25 + "text": "Absolutely! How old is it and what's the condition?", 26 + "time": "2:35 PM" 27 + }, 28 + { 29 + "id": "chat:1:4", 30 + "sender": "me", 31 + "text": "The lamp is from the 1960s and in excellent condition. The base has a small chip but the shade is perfect.", 32 + "time": "2:38 PM" 33 + } 34 + ] 35 + }, 36 + { 37 + "id": "chat:2", 38 + "sender": "Sarah Johnson", 39 + "avatar": "SJ", 40 + "unread": true, 41 + "messages": [ 42 + { 43 + "id": "chat:2:1", 44 + "sender": "them", 45 + "text": "Can we negotiate the price on your records collection?", 46 + "time": "1:15 PM" 47 + }, 48 + { 49 + "id": "chat:2:2", 50 + "sender": "me", 51 + "text": "Of course! What price were you thinking?", 52 + "time": "1:17 PM" 53 + }, 54 + { 55 + "id": "chat:2:3", 56 + "sender": "them", 57 + "text": "I was thinking around $150 for the whole collection. Is that doable?", 58 + "time": "1:20 PM" 59 + }, 60 + { 61 + "id": "chat:2:4", 62 + "sender": "me", 63 + "text": "I could do $175, but that's my final offer. The records are in near mint condition.", 64 + "time": "1:22 PM" 65 + } 66 + ] 67 + }, 68 + { 69 + "id": "chat:3", 70 + "sender": "Michael Brown", 71 + "avatar": "MB", 72 + "unread": false, 73 + "messages": [ 74 + { 75 + "id": "chat:3:1", 76 + "sender": "them", 77 + "text": "Thanks for the vintage camera! Can we arrange pickup tomorrow?", 78 + "time": "Yesterday" 79 + }, 80 + { 81 + "id": "chat:3:2", 82 + "sender": "me", 83 + "text": "That sounds great! Would 2 PM work for you?", 84 + "time": "Yesterday" 85 + }, 86 + { 87 + "id": "chat:3:3", 88 + "sender": "them", 89 + "text": "Yes, 2 PM is perfect. What's your address?", 90 + "time": "Yesterday" 91 + }, 92 + { 93 + "id": "chat:3:4", 94 + "sender": "me", 95 + "text": "I'm at 123 Main Street, Apt 4B. Just ring the buzzer for Brown.", 96 + "time": "Yesterday" 97 + } 98 + ] 99 + }, 100 + { 101 + "id": "chat:4", 102 + "sender": "Alex Wilson", 103 + "avatar": "AW", 104 + "unread": false, 105 + "messages": [ 106 + { 107 + "id": "chat:4:1", 108 + "sender": "them", 109 + "text": "I'm looking for similar items like your sound system.", 110 + "time": "Monday" 111 + }, 112 + { 113 + "id": "chat:4:2", 114 + "sender": "me", 115 + "text": "What specifically are you looking for? I might know where to find similar items.", 116 + "time": "Monday" 117 + }, 118 + { 119 + "id": "chat:4:3", 120 + "sender": "them", 121 + "text": "Vinyl record players and mid-century modern speakers.", 122 + "time": "Monday" 123 + }, 124 + { 125 + "id": "chat:4:4", 126 + "sender": "me", 127 + "text": "I know a great shop downtown that specializes in exactly that. Want me to text you the address?", 128 + "time": "Monday" 129 + } 130 + ] 131 + }, 132 + { 133 + "id": "chat:5", 134 + "sender": "Emily Davis", 135 + "avatar": "ED", 136 + "unread": false, 137 + "messages": [ 138 + { 139 + "id": "chat:5:1", 140 + "sender": "them", 141 + "text": "Can you provide more details about your furniture pieces?", 142 + "time": "Last week" 143 + }, 144 + { 145 + "id": "chat:5:2", 146 + "sender": "me", 147 + "text": "Sure! The dining table is solid oak with a glass top, and the chairs are original mid-century design.", 148 + "time": "Last week" 149 + }, 150 + { 151 + "id": "chat:5:3", 152 + "sender": "them", 153 + "text": "Are the chairs comfortable? I have back problems so seating is important to me.", 154 + "time": "Last week" 155 + }, 156 + { 157 + "id": "chat:5:4", 158 + "sender": "me", 159 + "text": "Yes, they're very comfortable! The cushions are original and still in great shape. I can send you photos if you'd like.", 160 + "time": "Last week" 161 + } 162 + ] 163 + } 164 + ] 165 + }, 166 + "errors": [] 167 + }
+7
graphql/useProfileQuery.json
··· 1 + { 2 + "data": { 3 + }, 4 + "errors": [ 5 + {"description":"This query should not make it to the server!"} 6 + ] 7 + }
+245
src/main.rs
··· 1 + use axum::{ 2 + response::Html, 3 + routing::{get, on, MethodFilter}, 4 + Extension, Router, 5 + }; 6 + use chrono::Utc; 7 + use dotenv::dotenv; 8 + use juniper::{graphql_object, EmptyMutation, EmptySubscription, RootNode}; 9 + use juniper_axum::{graphiql, graphql}; 10 + use serde_json::json; 11 + use std::env; 12 + use std::net::SocketAddr; 13 + use std::sync::Arc; 14 + use uuid::Uuid; 15 + 16 + // Define our GraphQL schema types 17 + #[derive(juniper::GraphQLObject)] 18 + struct Me { 19 + id: String, 20 + } 21 + 22 + #[derive(juniper::GraphQLObject)] 23 + struct ProfileViewDetailed { 24 + id: String, 25 + did: String, 26 + handle: String, 27 + display_name: Option<String>, 28 + description: Option<String>, 29 + pronouns: Option<String>, 30 + website: Option<String>, 31 + avatar: Option<String>, 32 + banner: Option<String>, 33 + followers_count: Option<i32>, 34 + follows_count: Option<i32>, 35 + posts_count: Option<i32>, 36 + } 37 + 38 + #[derive(juniper::GraphQLObject)] 39 + struct InventoryItem { 40 + id: String, 41 + title: String, 42 + cost: String, 43 + images: Vec<String>, 44 + description: String, 45 + location: Option<String>, 46 + condition: Option<String>, 47 + category: Option<String>, 48 + posted_at: String, 49 + } 50 + 51 + #[derive(juniper::GraphQLEnum)] 52 + enum Sender { 53 + Them, 54 + Me, 55 + } 56 + 57 + #[derive(juniper::GraphQLObject)] 58 + struct Message { 59 + id: String, 60 + sender: Sender, 61 + text: String, 62 + time: String, 63 + } 64 + 65 + #[derive(juniper::GraphQLObject)] 66 + struct Chat { 67 + id: String, 68 + unread: bool, 69 + sender: String, 70 + avatar: Option<String>, 71 + messages: Vec<Message>, 72 + } 73 + 74 + // Define our GraphQL schema queries 75 + #[derive(Clone, Copy, Debug)] 76 + pub struct Query; 77 + 78 + const placeholder_json = json!(include_str!("graphql/useInventoryQuery.json")); 79 + 80 + #[graphql_object] 81 + impl Query { 82 + async fn me(&self) -> Option<Me> { 83 + Some(Me { 84 + id: Uuid::new_v4().to_string(), 85 + }) 86 + } 87 + 88 + async fn profile_view_detailed(&self) -> Option<ProfileViewDetailed> { 89 + Some(ProfileViewDetailed { 90 + id: Uuid::new_v4().to_string(), 91 + did: "did:example:123456789abcdefghi".to_string(), 92 + handle: "testuser".to_string(), 93 + display_name: Some("Test User".to_string()), 94 + description: Some("Hello, I'm a test user!".to_string()), 95 + pronouns: Some("they/them".to_string()), 96 + website: Some("https://example.com".to_string()), 97 + avatar: Some("https://example.com/avatar.jpg".to_string()), 98 + banner: Some("https://example.com/banner.jpg".to_string()), 99 + followers_count: Some(42), 100 + follows_count: Some(15), 101 + posts_count: Some(7), 102 + }) 103 + } 104 + 105 + async fn inventory(&self) -> Vec<InventoryItem> { 106 + vec![ 107 + InventoryItem { 108 + id: Uuid::new_v4().to_string(), 109 + title: "Vintage Record Player".to_string(), 110 + cost: "$150.00".to_string(), 111 + images: vec![ 112 + "https://example.com/record-player-1.jpg".to_string(), 113 + "https://example.com/record-player-2.jpg".to_string(), 114 + ], 115 + description: "A fully functional vintage record player from the 1970s. Works perfectly and looks great!".to_string(), 116 + location: Some("Portland, OR".to_string()), 117 + condition: Some("Good".to_string()), 118 + category: Some("Electronics".to_string()), 119 + posted_at: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 120 + }, 121 + InventoryItem { 122 + id: Uuid::new_v4().to_string(), 123 + title: "Leather Jacket".to_string(), 124 + cost: "$85.00".to_string(), 125 + images: vec![ 126 + "https://example.com/jacket-1.jpg".to_string(), 127 + ], 128 + description: "Genuine leather jacket in excellent condition. Slightly worn but very stylish.".to_string(), 129 + location: Some("Seattle, WA".to_string()), 130 + condition: Some("Very Good".to_string()), 131 + category: Some("Clothing".to_string()), 132 + posted_at: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 133 + }, 134 + InventoryItem { 135 + id: Uuid::new_v4().to_string(), 136 + title: "Antique Desk Lamp".to_string(), 137 + cost: "$40.00".to_string(), 138 + images: vec![ 139 + "https://example.com/lamp-1.jpg".to_string(), 140 + "https://example.com/lamp-2.jpg".to_string(), 141 + "https://example.com/lamp-3.jpg".to_string(), 142 + ], 143 + description: "Beautiful antique desk lamp with brass detailing. Perfect for any study or office.".to_string(), 144 + location: Some("Portland, OR".to_string()), 145 + condition: Some("Good".to_string()), 146 + category: Some("Home".to_string()), 147 + posted_at: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 148 + }, 149 + ] 150 + } 151 + 152 + async fn chats(&self) -> Vec<Chat> { 153 + vec![ 154 + Chat { 155 + id: Uuid::new_v4().to_string(), 156 + unread: true, 157 + sender: "john_doe".to_string(), 158 + avatar: Some("https://example.com/avatar1.jpg".to_string()), 159 + messages: vec![ 160 + Message { 161 + id: Uuid::new_v4().to_string(), 162 + sender: Sender::Them, 163 + text: "Hey, are you still selling that record player?".to_string(), 164 + time: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 165 + }, 166 + Message { 167 + id: Uuid::new_v4().to_string(), 168 + sender: Sender::Them, 169 + text: "It would be perfect for my collection!".to_string(), 170 + time: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 171 + }, 172 + ], 173 + }, 174 + Chat { 175 + id: Uuid::new_v4().to_string(), 176 + unread: false, 177 + sender: "jane_smith".to_string(), 178 + avatar: Some("https://example.com/avatar2.jpg".to_string()), 179 + messages: vec![ 180 + Message { 181 + id: Uuid::new_v4().to_string(), 182 + sender: Sender::Them, 183 + text: "Thanks for the jacket! It arrived safely.".to_string(), 184 + time: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 185 + }, 186 + Message { 187 + id: Uuid::new_v4().to_string(), 188 + sender: Sender::Me, 189 + text: "Glad to hear it! Let me know if you need anything else.".to_string(), 190 + time: Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), 191 + }, 192 + ], 193 + }, 194 + ] 195 + } 196 + } 197 + 198 + pub type Schema = RootNode<Query, EmptyMutation, EmptySubscription>; 199 + 200 + async fn homepage() -> Html<String> { 201 + Html( 202 + "<html><h1>Mothball GraphQL API</h1>\ 203 + <div>Visit <a href=\"/graphiql\">GraphiQL</a> for an interactive interface</div>\ 204 + <div>Visit <a href=\"/playground\">GraphQL Playground</a> for the web-based IDE</div>\ 205 + <div>Access the API directly at <a href=\"/graphql\">/graphql</a></div>\ 206 + </html>" 207 + .to_string(), 208 + ) 209 + } 210 + 211 + #[tokio::main] 212 + async fn main() { 213 + dotenv().ok(); 214 + 215 + // Load environment variables 216 + let host = env::var("HOST").unwrap_or_else(|_| "0.0.0.0".to_string()); 217 + let port = env::var("PORT").unwrap_or_else(|_| "8080".to_string()); 218 + 219 + println!("Starting Mothball GraphQL server on {}:{}", host, port); 220 + 221 + let schema = Schema::new(Query, EmptyMutation::new(), EmptySubscription::new()); 222 + 223 + let app = Router::new() 224 + .route( 225 + "/graphql", 226 + on( 227 + MethodFilter::GET.or(MethodFilter::POST), 228 + graphql::<Arc<Schema>>, 229 + ), 230 + ) 231 + .route("/graphiql", get(graphiql("/graphql", "/subscriptions"))) 232 + .route("/", get(homepage)) 233 + .layer(Extension(Arc::new(schema))); 234 + 235 + let addr = format!("{}:{}", host, port) 236 + .parse::<SocketAddr>() 237 + .expect("Invalid socket address"); 238 + 239 + let listener = tokio::net::TcpListener::bind(addr) 240 + .await 241 + .unwrap_or_else(|e| panic!("failed to listen on {addr}: {e}")); 242 + axum::serve(listener, app) 243 + .await 244 + .unwrap_or_else(|e| panic!("failed to run `axum::serve`: {e}")); 245 + }