- Overview
- Architecture
- Features
- Tech Stack
- Project Structure
- Getting Started
- Available Scripts
- Deployment
- Contributing
- License
- Contact
Welcome to my grocery store website. ZestCo is not just a grocery app; it's a full-scale ecosystem designed for speed and reliability. Built with a decoupled architecture, it uses Next.js 15 for a blazing-fast frontend and a dedicated Node.js Socket Server for real-time bidirectional data flow.
| β‘ | Real-Time Engine | Custom Socket.io server for instant bidirectional order tracking and live delivery status. |
| π¨ | UI & UX Masterclass | Premium Glassmorphic aesthetics with cinematic staggered letter-glow (Sheryians Inspired). |
| π¦ | Scalable Architecture | Decoupled MERN + Next.js 15 setup with specialized service separation for high availability. |
| π | Security Ecosystem | Robust OTP (Send/Verify) logic combined with Next-Auth for bulletproof session management. |
| π | Smart Logistics | Automated Delivery Assignment system with real-time coordinate updates on Leaflet maps. |
| π€ | AI Support | Integrated AI-Suggestion engine within the support chat for intelligent product resolutions. |
| π³ | Financial Suite | Production-ready Stripe integration with secure Webhook handling for automated order success. |
| π | Admin Analytics | Data-driven Dashboard with Recharts for real-time inventory and sales performance tracking. |
| π§ | Automation Hub | Nodemailer powered automated transaction receipts and security alerts sent instantly. |
| πΌοΈ | Asset Management | Cloudinary integrated media pipeline for optimized image delivery and cloud-based storage. |
| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/api/otp/send |
POST | Generates & Sends 6-digit OTP via Email | β Yes (User) |
/api/otp/verify |
POST | Validates OTP & sets temporary session | β Yes (Partner) |
/api/delivery/assignment |
GET | Fetches active orders for delivery partner | β Yes (Partner) |
/api/user/payment |
POST | Creates Stripe Payment Intent | β Yes (User) |
MONGODB_URI=your_mongodb_connection_string
NEXTAUTH_SECRET=your_next_auth_secret_key
STRIPE_SECRET_KEY=your_stripe_secret_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
NODEMAILER_EMAIL=your_email_address
NODEMAILER_PASSWORD=your_app_password
SOCKET_SERVER_URL=http://localhost:4000
NEXT.JS_SERVER_URL=http://localhost:3000
1οΈβ£ PWA Support: Prepare the app for offline mode and home screen installation.
2οΈβ£ Multi-Vendor Support: Provide individual dashboards to different shop owners.
3οΈβ£ Analytics Engine: Detailed sales and delivery efficiency graphs for the admin.
The project is split into two specialized cores to maintain maximum performance:
A dedicated Node.js environment handling live connections.
. Role: Order status broadcasting, live delivery coordinates, and support pings.
. Tech : Socket.io, Express, Node.js.
The primary Next.js 15 application.
. Role: Core business logic, Product catalog, Auth, and Premium legal modules.
. Tech : React 19, Tailwind CSS 4, Framer Motion.
| Feature | Description |
|---|---|
| π 3D Particle System | Interactive particle backgrounds that respond to mouse movements |
| π· Geometric Animations | CSS-powered floating shapes with smooth parallax effects |
| π±οΈ Custom Cursor | Unique cursor that transforms on hover states |
| π Page Transitions | Cinematic transitions between routes using Framer Motion |
| π Theme Switching | Smooth dark/light mode with persistent localStorage |
| β¨ Micro-interactions | Delightful hover effects and button animations |
| β‘ Latest Glow | UI Premium staggered letter-glow animations with metallic rust-orange neon effects |
| π Glassmorphism Design | Modern dark-themed UI with translucent layers and backdrop filters |
| π Fluid Transitions | Cinematic page and component transitions powered by Framer Motion |
| π±οΈInteractive Stagger | Typography that reacts independently to mouse movements on legal pages |
| π± Adaptive Layout | Fully responsive experience across mobile, tablet, and ultra-wide screens |
| β¨ Micro-interactions | High-end hover states and spring-based physics for all UI elements |
| Feature | Description |
|---|---|
| π Live Order Tracking | Real-time delivery visualization using Leaflet maps and Socket.io |
| π Smart Assignments | Automated system for order allocation between Admin and Delivery Partners |
| π‘οΈ Dual-Stage OTP | Secure mobile authentication with dedicated 'Send' and 'Verify' logic |
| π€ AI-Suggestion Engine | Smart product recommendations integrated within the real-time support chat |
| π³ Secure Payments | Stripe integration with robust Webhook handling for order success/failure |
| π Admin Control Center | Comprehensive dashboard for inventory intake and live order management |
| Feature | Description |
|---|---|
| ποΈ Decoupled Servers | Separated Socket Server and Main App for high scalability and low latency. |
| π Next-Auth Security | Role-based access control (RBAC) with secure session middleware. |
| πΌοΈ Media Optimization | Cloudinary integration for fast image delivery and optimized assets |
| π§ Automated Alerts | Nodemailer powered transaction receipts and security notifications |
| ποΈ Mongoose Singleton | Optimized MongoDB connections to prevent serverless function overhead |
| π SEO Optimized | Next.js 15 App Router with dynamic metadata and structured data |
| Category | Highlights |
|---|---|
| π Real-time Engine | Live order tracking and instant status notifications via Socket.io. |
| π‘οΈ Advanced Security | AES-256 encrypted legal modules and secure Stripe payment gateways. |
| π Fluid Animations | Framer Motion powered staggered letter-glow with Neon Aura effects. |
| π Admin Dashboard | Comprehensive management for inventory, orders, and delivery partners. |
| π Dark Aesthetics | Native glassmorphism design optimized for high-performance low-light UI. |
| π± Mobile First | Fully responsive logistics interface for on-the-go delivery partners. |
π¦ Full Dependencies List (ZestCo Ecosystem)
π Authentication & Security
| Package | Version | Description |
|---|---|---|
next-auth |
^5.0.0-beta | Secure session management & Auth provider |
bcryptjs |
^2.4.3 | High-security password hashing (Salt & Hash) |
jsonwebtoken (JWT) |
^9.x | Token-based authentication for secure API access |
otp-generator |
^4.x | Unique numeric/alphanumeric OTP generation engine |
π Frontend & Core Framework
| Package | Version | Description |
|---|---|---|
next |
^15.x | Full-stack React framework (App Router) |
react |
^19.0.0 | UI Library with Concurrent Rendering support |
framer-motion |
^12.0 | High-end staggered animations (Neon Glow) |
tailwindcss |
^4.0 | Utility-first CSS for glassmorphic UI |
lucide-react |
Latest | Premium vector icons for modern UI |
π οΈ State Management & Data Fetching
| Package | Version | Description |
|---|---|---|
axios |
^1.7.x | Promise-based HTTP client for seamless API calls |
@reduxjs/toolkit |
^2.x | Scalable global state management (Cart, User, Auth) |
react-redux |
^9.x | Redux bindings for React components |
react-hook-form |
^7.x | Type-safe form handling & validation |
π Real-time & Backend Core
| Package | Version | Description |
|---|---|---|
socket.io |
^4.8.x | Real-time server logic (Bidirectional Events) |
socket.io-client |
^4.8.x | Live client-side WebSocket communication |
mongoose |
^8.x | Advanced MongoDB object modeling (ODM) |
nodemailer |
^6.10.x | Professional automated email & OTP service |
cloudinary |
^2.x | Cloud-based media storage & image optimization |
π³ Logistics & Payments
| Package | Version | Description |
|---|---|---|
Stripe |
^17.x | Professional payment gateway with Webhook support |
leaflet & react-leaflet |
^1.9.x | Interactive maps for live delivery tracking |
recharts |
^2.15.x | Data visualization for Admin Dashboard analytics |
π¨ UI Feedback & Utilities
| Package | Version | Description |
|---|---|---|
sonner |
^2.x | Premium, stackable toast notifications |
clsx & tailwind-merge |
Latest | Conditional Tailwind class merging & optimization |
react-icons |
^5.x | Comprehensive icon library support |
π¦ zestCo-main-folder
β
β£ββ π socketServer # Real-time WebSocket Engine (Node.js)
β β£ββ π index.js # Server entry point & Socket event listeners
β β£ββ π .env # PORT, CORS & Socket configurations
β βββ π package.json # Socket-specific dependencies
β
βββ π zestco # Full-Stack Web App (Next.js 15 + TS)
β
β£ββ π src
β β£ββ π app # Next.js App Router (Routing & Layouts)
β β β£ββ π (auth) # Authentication Flow (Grouped)
β β β β£ββ π login # User Login & Identity Access
β β β β£ββ π register # New User Onboarding
β β β βββ π verify-otp # Multi-stage OTP Verification UI
β β β
β β β£ββ π (user) # Client-facing Routes
β β β β£ββ π cart # Cart Management & Persistence
β β β β£ββ π checkout # Stripe Secure Checkout Pipeline
β β β β£ββ π orders # Order History & Status Dashboard
β β β βββ π track-order # Live [orderId] Tracking (Leaflet Map)
β β β
β β β£ββ π admin # Business Control Center
β β β β£ββ π add-grocery # Inventory Intake (Cloudinary Managed)
β β β β£ββ π all-orders # Global Order Management Logic
β β β βββ π users # Role-Based Access Control (RBAC)
β β β
β β β£ββ π api # Serverless Backend Architecture
β β β β£ββ π auth # NextAuth Configuration & Signup
β β β β£ββ π admin # Protected Admin Operations
β β β β£ββ π chat # AI Support & Message Archiving
β β β β£ββ π delivery # Partner Assignment & Logic
β β β β£ββ π otp # Nodemailer OTP Engine (Send/Verify)
β β β β£ββ π stripe # Payment Intents & Webhook Handlers
β β β βββ π user # Personalization & Order Logic
β β β
β β β£ββ π help # Legal/Support UI & UX Masterclass
β β β£ββ π privacy # Legal/Support UI & UX Masterclass
β β β£ββ π refund # Legal/Support UI & UX Masterclass
β β β£ββ π terms # Legal/Support UI & UX Masterclass
β β β£ββ π layout.tsx # Global Root Layout (Glassmorphism)
β β βββ π page.tsx # Dynamic Hero & Product Ecosystem
β β
β β£ββ π components # Modular UI Engine
β β β£ββ π Delivery # LiveMap.tsx, GeoUpdator.tsx
β β β£ββ π AdminDash # OrderTable.tsx, AnalyticsChart.tsx
β β β£ββ π Navbar # Glassmorphism.tsx, UserMenu.tsx
β β β£ββ π EditRole.tsx # Role Switcher Modal Component
β β β£ββ π GroceryCard.tsx # Animated Product Display Card
β β βββ π Footer.tsx # Staggered Letter Glow Footer
β β
β β£ββ π hooks # Custom React Hooks
β β βββ π useGetMe.tsx # Custom Redux Session-State Hook
β β
β β£ββ π redux # Global State Management
β β β£ββ π slices # cartSlice.ts, userSlice.ts
β β β£ββ π storeProvider.tsx # Client-side Redux Wrapper
β β βββ π store.ts # Persisted Redux Store Config
β β
β β£ββ π models # Mongoose Database Architecture
β β β£ββ π user.model.ts # User, Admin & Partner Schemas
β β β£ββ π order.model.ts # Real-time Tracking & Order Metadata
β β β£ββ π grocery.model.ts # Inventory & Pricing Schema
β β β£ββ π message.model.ts # Chat Message Schema
β β β£ββ π chatRoom.model.ts # Support Room Thread Logic
β β βββ π deliveryAssignment.model.ts # Logistics Assignment Logic
β β
β β£ββ π lib # Server-side Infrastructure
β β β£ββ π db.ts # MongoDB Connection (Singleton Pattern)
β β β£ββ π cloudinary.ts # Multi-media Optimization Config
β β β£ββ π mailer.ts # Nodemailer Transporter Utility
β β β£ββ π emitHandler.ts # Centralized Socket Event Handler
β β βββ π socket.ts # Client-side Socket Initialization
β β
β β£ββ π middleware.ts # Global Route Protection & JWT Guard
β βββ π Provider.tsx # High-order Context Wrappers
β
β£ββ π .env # System Secrets & API Credentials
β£ββ π .gitignore # Git Deployment Exclusions
β£ββ π next.config.js # Next.js Advanced Optimizations
β£ββ π tailwind.config.ts # Custom Theme & "Sheryians" Glow Config
βββ π package.json # Deployment Scripts & Metadata
Before you begin, ensure you have the following installed:
- Node.js
v18.0.0or higher - npm
v9.0.0or higher (or yarn / pnpm) - Next.js
v16.21.0or higher
1οΈβ£ Clone the repository
git clone 2οΈβ£ Navigate to project directory
cd zestCo main folder3οΈβ£ Current Directory
cd zestco 4οΈβ£ Current Directory
cd socketServer 5οΈβ£ Install dependencies
npm install
# or
yarn install
# or
pnpm install6οΈβ£ Start development server (for zestco folder)
npm run dev7οΈβ£ Start development server(for socketServer folder)
npm run dev8οΈβ£ Open in browser (for next.js)
http://localhost:3000
9οΈβ£ Open in browser (for socket.IO)
http://localhost:4000
| Script | Command | Description |
|---|---|---|
| π§ Dev | npm run dev |
Start development server with HMR |
| ποΈ Build | npm run build |
Create production build |
| ποΈ Preview | npm run preview |
Preview production build locally |
| π Lint | npm run lint |
Run ESLint and auto-fix issues |
| π§Ή Clean | npm run clean |
Remove dist and cache folders |
| π¦ Build Prod | npm run build:prod |
Clean + Production build |
This Project is configured for seamless deployment on Vercel:
# Build for production
npm run build
# Preview build locally
npm run previewThe dist/ folder contains the production-ready files.
Contributions make the open-source community amazing! Any contributions are greatly appreciated.
-
Fork the Project
-
Create your Feature Branch
git checkout -b feature/AmazingFeature
-
Commit your Changes
git commit -m 'β¨ Add some AmazingFeature' -
Push to the Branch
git push origin feature/AmazingFeature
-
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 - 2027 Pintu Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
π If you found this project helpful, please give it a star!
Β© 2026 All Rights Reserved