A high-performance, production-grade distributed system designed to deliver real-time commerce dashboard metrics, atomic inventory control, and enterprise-grade user lifecycle tracking.
Built using a Strict Clean Layered Architecture with Node.js, Express.js, and MongoDB Atlas on the backend, and a stunning, high-performance React (Vite) Single Page Application on the frontend. The CartX platform houses both a robust transactional backend service and a visually striking, consumer-facing storefront and analytics dashboard UI.
- High-Performance Ingestion Engine: Dynamically converts raw JSON records containing 21,629 orders into a standardized CSV file, parsing it line-by-line using a custom quote-tolerant parser, and seeding MongoDB Atlas in highly optimized chunked batches.
- Atomic Stock Booking Engine: Employs two-phase stock locking checks in MongoDB using atomic
$incoperators to mitigate concurrency race conditions, featuring automatic transaction rollbacks on failures to prevent catalog leaks. - Observability & Request Tracing: Cryptographic trace ID generation (
crypto.randomUUID()) injected automatically in each HTTP request context for instant transactional diagnostics.
- Zero-Latency Interactions: Integrated with
@tanstack/react-queryfor ultra-fast, cached data fetching, paginated catalog scrolling, and dynamic state management. - Modern Premium UI/UX: Utilizing Tailwind CSS and Framer Motion, the CartX platform features a state-of-the-art "billion-dollar tech giant" aesthetic. Complete with glassmorphism panels, dynamic glows, and micro-interactions.
- SEO & PWA Ready: Fully optimized with
react-helmet-asyncfor dynamic meta tags (Open Graph & Twitter Cards),sitemap.xml, Google Rich Snippets (JSON-LD), and Web App Manifests for progressive mobile installation.
amazon_orders_raushan_kumar/
βββ backend/ # Enterprise Backend Engine (Node.js/Express)
β βββ src/
β β βββ api/ # HTTP Routing and Request Orchestration
β β β βββ controllers/ # Adapters converting HTTP requests to Domain logic
β β β β βββ admin.controller.js # User suspensions and system metric lookups
β β β β βββ analytics.controller.js # Sales facets and geolocation grouping logic
β β β β βββ auth.controller.js # Authentication (signups, passwords, logins)
β β β β βββ category.controller.js # Taxonomy category node creations & lookups
β β β β βββ customer.controller.js # Shopper profiles and personal transaction history
β β β β βββ health.controller.js # Server and database ping health checks
β β β β βββ inventory.controller.js # Stock metrics and manual stock level overrides
β β β β βββ order.controller.js # Checkout execution and payment webhooks
β β β β βββ product.controller.js # Paginated catalog multi-filter searches
β β β β βββ seller.controller.js # Merchant directories and storefront analytics
β β β βββ routes/ # Express Routers mapping endpoints to controllers
β β βββ configs/ # Environment-specific Configurations (.env parsers)
β β βββ domain/ # Core Enterprise Business Rules
β β β βββ repositories/ # Layer-isolated Mongoose database commands
β β β β βββ category.repository.js # Category taxonomy tree materialized paths
β β β β βββ customer.repository.js # Customer accounts lookups & soft-deletes
β β β β βββ order.repository.js # Order database writes and state machine updates
β β β β βββ product.repository.js # Products queries & atomic stock reservations
β β β β βββ seller.repository.js # Merchant performance metrics database scans
β β β β βββ user.repository.js # User security profile operations (RBAC)
β β β βββ services/ # Application Workflow Services Orchestration
β β β βββ admin.service.js # User suspensions and backend OS diagnostics
β β β βββ analytics.service.js # High-performance analytical MongoDB aggregations
β β β βββ auth.service.js # Password hashing, JWT token generation
β β β βββ category.service.js # Array generations for taxonomy tree branches
β β β βββ customer.service.js # Shopper listings compilation
β β β βββ inventory.service.js # Manual inventory overrides
β β β βββ order.service.js # Multi-item checkout distributed locking
β β β βββ product.service.js # Catalog paginated search engines
β β β βββ search.service.js # Multi-entity search indexing and typo-tolerance
β β β βββ seller.service.js # Merchant performance calculations
β β βββ infrastructure/ # Technical Adapters & Database Engines
β β β βββ database/ # MongoDB Cloud Atlas Connection Pooling
β β β βββ logger/ # Winston Structured Logging (RFC 5424)
β β βββ middlewares/ # Express HTTP Pipeline Middlewares
β β β βββ auth.middleware.js # Token decryptions and Role RBAC guards
β β β βββ trace.middleware.js # UUID request trace injectors for logging
β β βββ seed/ # Database Ingestion & Testing Mockers
β β βββ importDatasetCsv.js # High-performance JSON-to-CSV database seeder
β β βββ seed.js # Bootstraps SuperAdmin and default mock data
β βββ app.js # Express instantiation and global security helmet
β
βββ frontend/ # Commerce Analytics & Storefront Client (React/Vite)
β βββ src/
β β βββ components/ # Reusable UI presentation layers
β β β βββ Toast.jsx # Global floating notification HUD manager
β β β βββ HeroBackground.jsx # Cinematic glowing particle animations
β β βββ layouts/ # Outer structural routing wrappers
β β β βββ AdminLayout.jsx # Sidebar navigation for staff and analytics
β β β βββ ShopperLayout.jsx # Navigation bar and footer for public storefront
β β βββ pages/ # Core interactive UI screens
β β β βββ AdminAnalytics.jsx # High-charts visualization of sales facets
β β β βββ AdminCategories.jsx # Taxonomy tree management UI
β β β βββ AdminDashboard.jsx # Executive metrics overview dashboard
β β β βββ AdminMetrics.jsx # Server OS and database latency monitors
β β β βββ AdminOrders.jsx # Order fulfillment and status progression table
β β β βββ AdminProducts.jsx # Catalog inventory addition and pricing management
β β β βββ AdminUsers.jsx # IAM user suspension and directory
β β β βββ AuthPages.jsx # Sign In, Registration, and Password Reset screens
β β β βββ LandingPage.jsx # Cinematic entry point for the CartX platform
β β β βββ NotFound.jsx # 404 Fallback routing for lost navigations
β β β βββ ShopperCatalog.jsx # Multi-filter paginated product discovery grid
β β β βββ ShopperProductDetails.jsx # Individual product specification and checkout injection
β β β βββ WarehouseOverrides.jsx # Direct manual stock quantity mutations for staff
β β βββ services/ # Network boundary configuration
β β β βββ api.js # Configured Axios instance with JWT interceptors
β β β βββ resourceApi.js # Pre-compiled fetch hooks for React Query
β β βββ store/ # Global frontend state machines (Zustand)
β β β βββ useAuthStore.js # Session tracking and role capabilities
β β β βββ useCartStore.js # Local storage persistent shopping cart
β β βββ App.jsx # React Router definition map and entry DOM tree
β β βββ main.jsx # React root injection and HelmetProvider wrapper
β βββ public/ # Static web server assets
β βββ manifest.json # Progressive Web App installation definitions
β βββ robots.txt # Search engine bot crawl directives
β βββ sitemap.xml # XML priority mapping for SEO indexing
β βββ cartx-logo.png # The primary CartX visual identity branding
Create a .env file in the backend/ root directory:
PORT=5001
NODE_ENV=development
# MongoDB Connection String (Atlas Cluster URI)
MONGODB_URI=mongodb+srv://Raushankumar0720:Raushan%40150720@bynd.ollivm8.mongodb.net/commerce_intelligence?retryWrites=true&w=majority&appName=BYND
# JWT Security Configurations
JWT_SECRET=commerce_intelligence_local_development_jwt_secret_key_998877
JWT_ACCESS_EXPIRATION=15m
JWT_REFRESH_EXPIRATION=7d
BCRYPT_SALT_ROUNDS=12Logging in as Admin grants immediate access to all administrative and business intelligence analytical routes:
- Email:
admin@commerce.com - Password:
SecurityPassword99!
All backend endpoints are mapped under the /api/v1 namespace and strictly follow RESTful conventions.
- Identity Management:
/auth/register,/auth/login,/auth/change-password - Products & Taxonomy:
/products,/categories,/search/products - Orders & Checkout:
/orders(Two-phase commit),/orders/:id/pay,/orders/:id/cancel - Inventory & Overrides:
/inventory/:productId(Atomic operations) - Sales Intelligence:
/analytics/revenue,/analytics/top-products,/analytics/category-sales
To run the full-stack platform locally:
cd amazon_orders_raushan_kumar/backend
npm install
# Perform JSON-to-CSV Cloud Database Atlas Ingestion
node src/seed/importDatasetCsv.js
# Boot up the Express HTTP server (Runs on port 5001)
npm startOpen a new terminal window:
cd amazon_orders_raushan_kumar/frontend
npm install
# Boot the Vite React Application (Runs on port 5173)
npm run devYour cloud-connected database is now fully populated, and the complete distributed system is live! π