Team DoD: Challenge 10 BullMQ Valkey checkout integration#1
Open
Vasanthadithya-mundrathi wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new backend/checkout service that implements a BullMQ-powered checkout workflow backed by Valkey, and updates docs/tests to support and validate it.
Changes:
- Introduces a standalone TypeScript checkout backend (Express + BullMQ + ioredis) with inventory reservation/commit via Lua + Valkey JSON.
- Adds unit/integration test suites (Vitest) for Valkey connection parsing, idempotency, auth, and end-to-end checkout flows.
- Updates frontend test setup and repository docs to accommodate the new demo backend.
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/setupTests.js | Adds window.matchMedia shim for Jest DOM usage. |
| frontend/src/App.test.js | Reworks App render test using mocks for route-level components. |
| backend/checkout/vitest.config.ts | Adds Vitest configuration for the checkout backend. |
| backend/checkout/tsconfig.json | TypeScript compiler settings for backend build output. |
| backend/checkout/test/unit/connection.test.ts | Unit tests for env-based Valkey connection construction. |
| backend/checkout/test/integration/checkout.test.ts | Integration tests for checkout flow, idempotency, auth, and inventory correctness. |
| backend/checkout/src/types.ts | Defines shared types for products, orders, and events. |
| backend/checkout/src/store.ts | Implements Valkey JSON persistence, order creation, listing, and stream event emission. |
| backend/checkout/src/server.ts | Express API endpoints for checkout, orders, and SSE order events. |
| backend/checkout/src/seed.ts | Seeds Valkey with product fixtures. |
| backend/checkout/src/runtime.ts | Wires config, Valkey connection, scripts, queues, and server lifecycle. |
| backend/checkout/src/queues.ts | Defines BullMQ queues/workers for reserve/payment/confirm/release/dispatch. |
| backend/checkout/src/payment.ts | Stub deterministic payment processor logic. |
| backend/checkout/src/inventoryScripts.ts | Lua scripts wrapper for atomic reserve/commit/release inventory mutations. |
| backend/checkout/src/index.ts | Service entrypoint with startup/shutdown and logging. |
| backend/checkout/src/ids.ts | Order ID + sortable timestamp helpers (uuidv7). |
| backend/checkout/src/idempotency.ts | Idempotency replay + locking using Valkey keys. |
| backend/checkout/src/fixtures.ts | Product fixtures for seeding/integration tests. |
| backend/checkout/src/errors.ts | API error type and normalization helpers. |
| backend/checkout/src/connection.ts | Valkey connection parsing (URL vs discrete env vars) + reachability check. |
| backend/checkout/src/config.ts | Loads service config (port, concurrency, TTL, queue prefix) from env. |
| backend/checkout/package.json | Adds backend package scripts/deps for build/dev/test/seed. |
| backend/checkout/README.md | Documents backend run steps, env vars, and API endpoints. |
| README.md | Documents optional backend usage and adds repository structure/commands. |
| .gitignore | Adds ignore rules for node_modules, dist, coverage, env files, etc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Challenge
Challenge 10: Checkout with Inventory Tracking
Integration
BullMQ + Valkey checkout backend for the Valkey e-commerce demo.
What changed
Validation
Browser E2E edge cases covered