Loading repository data…
Loading repository data…
NileshKonkankar / repository
ShopStream is a production-grade, highly responsive full-stack e-commerce platform built on the MERN stack (MongoDB, Express, React, Node.js) with end-to-end TypeScript type safety.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
ShopStream is a production-grade, highly responsive full-stack e-commerce platform designed with micro-animations, real-time inventory synchronization, and a secure Stripe checkout process. Built on the MERN stack (MongoDB, Express, React, Node.js), it models enterprise practices such as secure server-side recalculations, strict Zod input validation, role-based route protection, robust TypeScript type safety, and real-time client socket notifications.
customer and admin users.graph TD
Client[React SPA Client - Port 80/5173] <-->|Real-Time Inventory Updates| Socket[Socket.IO Gateway]
Client -->|HTTP Requests| Express[Express API Server - Port 5000]
Express <-->|Query & Persist| Mongo[(MongoDB - Port 27017)]
Express -->|Create Payment Intent| Stripe[Stripe Payment Intents API]
Client -->|Confirm Payment| Stripe
Express <-->|Webhooks| Stripe
client_secret to the client, and confirming the order after successful webhooks or intent resolution.shopstream/
├── .github/
│ └── workflows/
│ └── ci.yml # Main GitHub Actions CI/CD Pipeline
├── client/ # Frontend Application
│ ├── src/
│ │ ├── api/ # API clients (axios, endpoints)
│ │ ├── components/ # Presentational and layout components
│ │ ├── pages/ # Route-level views (Products, Cart, Admin)
│ │ ├── routes/ # Route guards (ProtectedRoute, AdminRoute)
│ │ ├── store/ # Zustand state management (auth, cart)
│ │ ├── tests/ # Unit and integration test suites (Vitest)
│ │ └── types/ # Common TypeScript interfaces
│ ├── Dockerfile # Multi-stage production Nginx dockerfile
│ ├── nginx.conf # Custom Nginx configuration for SPA routing
│ └── package.json
├── server/ # Backend API Application
│ ├── src/
│ │ ├── config/ # DB, Env, and Stripe initializers
│ │ ├── controllers/ # Controller logic (Auth, Cart, Orders, Payments)
│ │ ├── middleware/ # Middlewares (Auth, Error, Logger, Zod)
│ │ ├── models/ # Mongoose Schemas (User, Product, Cart, Order)
│ │ ├── routes/ # REST endpoint configurations
│ │ ├── sockets/ # Socket.IO handlers
│ │ ├── tests/ # Jest and Supertest integration tests
│ │ └── validations/ # Zod verification schemas
│ ├── Dockerfile # Multi-stage production Alpine runner dockerfile
│ └── package.json
├── docker-compose.yml # Local orchestration config for full application
├── .gitignore # Monorepo-level git ignores
└── README.md # Root Documentation
server/.env)Create a server/.env file in the server root folder:
PORT=5000
NODE_ENV=development
MONGO_URI=mongodb://localhost:27017/shopstream
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:5173
STRIPE_SECRET_KEY=sk_test_your_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
CURRENCY=INR
client/.env)Create a client/.env file in the client root folder:
VITE_API_URL=http://localhost:5000
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key
Clone the repository:
git clone https://github.com/yourusername/shopstream.git
cd shopstream
Configure Environment Variables:
server/.env using the server .env.example.client/.env using the client .env.example.Install Dependencies & Run Backend:
cd server
npm install
npm run dev
The server will start on http://localhost:5000.
Install Dependencies & Run Frontend:
cd ../client
npm install
npm run dev
The frontend dev server will launch on http://localhost:5173.
Orchestrate MongoDB, the Express backend, and the React frontend inside an isolated Docker container cluster using a single command:
docker-compose up --build
http://localhost.http://localhost:5000.mongodb://localhost:27017.| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register | Register a new user profile | None |
| POST | /api/auth/login | Login user and issue access JWT | None |
| GET | /api/auth/me | Fetch active user information | Customer/Admin |
| GET | /api/products | Fetch filtered catalog list (Search, Categories) | None |
| POST | /api/products | Create catalog item | Admin |
| GET | /api/cart | View current logged-in user's cart | Customer |
| POST | /api/cart | Add / increment items in shopping cart | Customer |
| PUT | /api/cart | Update individual cart quantities | Customer |
| DELETE | /api/cart/:productId | Remove item from cart | Customer |
| POST | /api/payments/intent | Initialize Stripe Payment Intent (Recalculated) | Customer |
| POST | /api/orders | Instantiate order from successful payment |
io.emit("inventory:update", { productId, stock });
To prevent critical payment exploits, ShopStream uses a zero-trust client pricing architecture:
/api/payments/intent.client_secret.express-rate-limit prevents brute-force login and API flooding.helmet is set up to block server header disclosures, cross-site scripting, and sniffing.Automated testing is critical for
| Customer |