Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

169 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CartX Platform Hero

πŸ›’ CartX - Premium E-Commerce Orchestration

A high-performance, production-grade distributed system designed to deliver real-time commerce dashboard metrics, atomic inventory control, and enterprise-grade user lifecycle tracking.

Node React Vite Tailwind MongoDB


🌟 Executive Summary

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.

Analytics Dashboard


πŸš€ Enterprise Core Technical Features

Backend Engine

  • 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 $inc operators 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.

Frontend Storefront

  • Zero-Latency Interactions: Integrated with @tanstack/react-query for 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-async for dynamic meta tags (Open Graph & Twitter Cards), sitemap.xml, Google Rich Snippets (JSON-LD), and Web App Manifests for progressive mobile installation.

πŸ—οΈ System Architecture Blueprint

System Architecture

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

πŸ”‘ Cloud Database & Environment Configuration

Backend Setup

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=12

πŸ‘€ Global Administrator Access Credentials

Logging in as Admin grants immediate access to all administrative and business intelligence analytical routes:

  • Email: admin@commerce.com
  • Password: SecurityPassword99!

πŸ“‘ REST API Endpoint Overview (48 Endpoints)

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

⚑ Quick Boot & Installation Guide

To run the full-stack platform locally:

1. Boot the Backend (API & Database)

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 start

2. Boot the Frontend (CartX UI)

Open a new terminal window:

cd amazon_orders_raushan_kumar/frontend
npm install

# Boot the Vite React Application (Runs on port 5173)
npm run dev

Your cloud-connected database is now fully populated, and the complete distributed system is live! πŸš€


Logistics and Commerce

Engineered for speed, scale, and uncompromising security.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages