team Minutemaid#22
Open
MdNaqui4 wants to merge 8 commits into
Open
Conversation
…and session management using Valkey
… the Account component
feat: implement user authentication system with registration, login, …
…Valkey state visualization and demo management
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.
Feature: Persistent Shopping Cart, Atomic Checkout & Live Simulator Dashboard using Valkey
📝 Overview
This pull request introduces a highly scalable and thread-safe persistent shopping cart and checkout subsystem built with Fast API on the backend and React on the frontend, fully powered by Valkey as the fast, multi-model storage layer.
To assist with evaluation, we have also created a beautiful Live Simulation Dashboard directly integrated into the React application, which allows step-by-step walkthroughs of e-commerce lifecycles with real-time Valkey memory and TTL visualization.
Key Features Implemented
/api/cart)cart:{userId}) to persist user cart states globally./api/checkout/start)EVAL) to atomically check physical product stock and increment areservedcount in Valkey JSON (product:{id}).reservation:{orderId}:{productId} EX 600) to hold items during payment.X-Idempotency-Keyheader on checkout.SET idempotency:{key} {orderId} NX EX 86400) to guarantee that double-clicked payments or re-transmissions return the cached order JSON structure immediately without double-booking inventory./simulation)Valkey Command Coverage
The implementation covers a wide array of advanced Valkey data structures and commands:
HSET,HGETALL,HDEL,HEXISTS**: Active shopping cart storage.JSON.SET,JSON.GET,JSON.NUMINCRBY**: Product catalog data, Coupon configurations, and Order structures.EVAL**: Atomic stock reservation script executing transactionally.SET ... NX EX**: Idempotency locks and temporary TTL reservations.SADD,SISMEMBER,SMEMBERS**: Coupon usage limits and unique user analytics tracking.ZADD,ZRANGE**: User order histories stored in a sorted set keyed by timestamp.Verification & Run Instructions
Run Valkey Bundle image inside your Docker container:
Backend Setup
Move to backend folder:
cd backendInstall dependencies:
pip install -r requirements.txtRun automated Pytest integration tests:
Start FastAPI server:
Frontend Setup
Move to frontend folder:
cd frontendStart React app:
Open
http://localhost:3000/simulationto run the step-by-step interactive simulator console.