Skip to content

Pintu-Kumar-1709/zestCo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ZestCo Ecosystem

A Premium, Real-Time & High-Performance Grocery Delivery Platform

Next.js React Vite Node.js Socket.io TailwindCSS MongoDB TypeScript Cloudinary Leaflet Nodemailer Recharts Stripe Framer Motion


Stars Forks Last Commit License

🌐 Live Preview Β β€’Β  ✨Features Β β€’Β  πŸ› οΈ Tech Stack Β β€’Β  πŸš€ Get Started




πŸ“‹ Table of Contents


🎯 Overview


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.

1️⃣ πŸ›‘οΈ API Endpoints Preview (Security Showcase)

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)

2️⃣ πŸ› οΈ Environment Variables (.env.example)


Create a .env file and add these keys

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

3️⃣ πŸš€ Future Roadmap (Scalability)


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.

πŸ—οΈ Architecture

The project is split into two specialized cores to maintain maximum performance:

1️⃣ SocketServer (The Heart)

A dedicated Node.js environment handling live connections.
. Role: Order status broadcasting, live delivery coordinates, and support pings.

. Tech : Socket.io, Express, Node.js.

2️⃣ zestco (The Brain)

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.


✨ Features


🎨 Design & User Experience

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

βš™οΈ Core Logistics & Functionality

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

πŸš€ Performance & Backend Architecture

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

✨ Features

⚑ Core Ecosystem Highlights

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.

πŸ› οΈ Tech Stack

Core Technologies

Core Cloudinary Leaflet Recharts


Animation & UI

Animation Framer GSAP


Tools & Deployment

Tools


πŸ“¦ 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

πŸ“ Project Structure

πŸ“¦ 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

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js v18.0.0 or higher
  • npm v9.0.0 or higher (or yarn / pnpm)
  • Next.js v16.21.0 or higher

Installation

1️⃣ Clone the repository

git clone 

2️⃣ Navigate to project directory

cd zestCo main folder

3️⃣ Current Directory

cd zestco 

4️⃣ Current Directory

cd socketServer 

5️⃣ Install dependencies

npm install
# or
yarn install
# or
pnpm install

6️⃣ Start development server (for zestco folder)

npm run dev

or

7️⃣ Start development server(for socketServer folder)

npm run dev

8️⃣ Open in browser (for next.js)

http://localhost:3000

9️⃣ Open in browser (for socket.IO)

http://localhost:4000

πŸ“œ Available Scripts

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

🌐 Deployment

This Project is configured for seamless deployment on Vercel:

Deploy with Vercel

Manual Deployment

# Build for production
npm run build

# Preview build locally
npm run preview

The dist/ folder contains the production-ready files.


🀝 Contributing

Contributions make the open-source community amazing! Any contributions are greatly appreciated.

  1. Fork the Project

  2. Create your Feature Branch

    git checkout -b feature/AmazingFeature
  3. Commit your Changes

    git commit -m '✨ Add some AmazingFeature'
  4. Push to the Branch

    git push origin feature/AmazingFeature
  5. Open a Pull Request


πŸ“„ License

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.

πŸ“ž Contact

Pintu Kumar β€” Full Stack Developer

GitHub LinkedIn Email


🌟 If you found this project helpful, please give it a star!

Built with ❀️ and β˜• by Pintu Kumar
Β© 2026 All Rights Reserved

About

πŸ›’ ZestCo Backend Engine | A high-performance real-time grocery delivery infrastructure. Powering seamless user experiences with Next.js 15, Socket.io for live order tracking, and Secure RBAC (Role-Based Access Control). πŸš€ πŸ“¦

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages