Skip to content

farhan-6710/shopnow

Repository files navigation

ShopNow Banner

πŸ‘Ÿ ShopNow – Full-Stack Shoe Hunt Platform

ShopNow is a high-performance, frontend-focused full-stack shoe discovery and listing application designed for real-world shopping flows. Built with a strong emphasis on usability, accessibility, and speed, it leverages Next.js for the frontend and API routes, with Supabase handling authentication and database management.

The application is engineered to handle large product datasets efficiently using list virtualization and includes a context-aware AI assistant to enhance product discovery and user decision-making.


πŸš€ Key Features

πŸ›οΈ Core Shopping Experience

  • Search-Driven Navigation
    A global search bar available in the header on every page. Searching routes users directly to dynamic product detail pages.

  • Advanced Filtering
    Sidebar-based filtering by brand, size, color, and price range, implemented using custom React hooks for clean and reusable state management.

  • Dynamic Product Pages
    SEO-friendly, server-rendered product detail pages using dynamic routing.

  • Cart & Wishlist
    Dedicated routes for managing cart and wishlist items with instant UI feedback.


🧠 Smart & Interactive

  • Context-Aware AI Assistant
    Implemented using a shadcn Sheet (drawer), allowing users to ask product-related questions and receive insights without leaving the current page.

  • Optimistic UI Updates
    Actions like Add to Cart and Add to Wishlist update the UI instantly using Redux Toolkit, while Redux Saga handles API calls and side effects in the background.

  • User Feedback System
    Non-intrusive toast notifications provide clear success and failure feedback for user actions.


πŸ” Authentication & Data Sync

  • Modal-Based Authentication
    Login and signup flows are handled via accessible modals, preserving user context without page redirects.

  • Custom JWT Authentication
    Secure authentication using JWT tokens stored in HttpOnly cookies, with password hashing via bcryptjs.

  • Automatic Data Synchronization
    Guest cart and wishlist data are automatically merged with persistent backend data when a user logs in.


⚑ Performance & Engineering

  • List Virtualization
    Ensures smooth 60fps scrolling even with large product lists.

  • Loading Skeletons
    Improve perceived performance during data fetching.

  • Express.js Backend APIs
    RESTful API endpoints handle business logic and database operations with Prisma ORM.


πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui
  • Icons: Lucide React

State Management & Async Logic

  • Global State: Redux Toolkit
  • Side Effects: Redux Saga (optimistic updates, async flows, error handling)
  • API Communication: Axios with credentials support for JWT cookies

Backend & Database

  • API Layer: Express.js with TypeScript
  • Database: Neon DB (PostgreSQL)
  • ORM: Prisma
  • Authentication: Custom JWT-based (bcryptjs, jsonwebtoken, HttpOnly cookies)

πŸ—οΈ Architecture Highlights

Optimistic UI with Redux Saga

  1. User triggers an action (e.g., Add to Cart).
  2. Redux updates the UI immediately.to the Express backend in the background.
  3. On success, the state is confirmed; on failure, changes are rolled back and an error toast is shown.

Authentication Flow

Authentication is handled via modals with JWT tokens stored in HttpOnly cookies. Users can sign in or sign up without losing their current browsing context. API requests automatically include credentials via Axios configuration Authentication is handled via modals instead of full-page redirects, allowing users to sign in or sign up without losing their current browsing context.


πŸ“‚ Project Structure

β”œβ”€β”€ public/                    # Static assets
β”‚   └── images/                # Image assets & product images
β”œβ”€β”€ scripts/                   # Database scripts & seed data
└── src/
    β”œβ”€β”€ app/                   # (Legacy - migrated to Express backend)
    β”‚   β”œβ”€β”€ auth/              # Auth pages & callback handler
    β”‚   β”œβ”€β”€ cart/              # Cart page
    β”‚   β”œβ”€β”€ products/          # Product pages
    β”‚   β”‚   └── [itemName]/    # Dynamic product detail pages
    β”‚   └── wishlist/          # Wishlist page
    β”œβ”€β”€ components/            # Reusable UI components
    β”‚   β”œβ”€β”€ ai-assistant/      # AI assistant components
    β”‚   β”œβ”€β”€ auth/              # Authentication components
    β”‚   β”œβ”€β”€ cart/              # Cart components
    β”‚   β”œβ”€β”€ footers/           # Footer components
    β”‚   β”œβ”€β”€ headers/           # Header components
    β”‚   β”œβ”€β”€ home/              # Home page components
    β”‚   β”œβ”€β”€ modals/            # Modal components
    β”‚   β”œβ”€β”€ product-details/   # Product detail components
    β”‚   β”œβ”€β”€ shared/            # Shared components
    β”‚   β”œβ”€β”€ skeletons/         # Loading skeletons
    β”‚   β”œβ”€β”€ ui/                # shadcn UI components
    β”‚   └── wishlist/          # Wishlist components
    β”œβ”€β”€ config/                # App configuration
    β”œβ”€β”€ constants/             # App constants (animations, filters, routes)
    β”œβ”€β”€ hooks/                 # Custom React hooks
    β”œβ”€β”€ lib/                   # Utilities & helpers
    β”œβ”€β”€ providers/             # React context providers
    β”œβ”€β”€ redux/                 # Redux state management
    β”‚   β”œβ”€β”€ cart/              # Cart state
    β”‚   β”œβ”€β”€ wishlist/          # Wishlist state
    β”‚   β”œβ”€β”€ slices/            # Redux slices
    β”‚   └── sagas/             # Redux sagas
    β”œβ”€β”€ services/              # API service layer (Axios)
    β”œβ”€β”€ styles/                # Global styles
    β”œβ”€β”€ types/                 # TypeScript types
    └── utils/                 # Utility functions
        β”œβ”€β”€ products/          # Product utilities
        └── redux/             # Reduxilities
        └── supabase/          # Supabase utilities

🧭 Navigation Structure

Header

  • Global search bar accessible from all pages

Sidebar

  • Product filtering controls

Routes

  • / – Home page with product listings
  • /products/[itemName] – Dynamic product detail pages
  • /cart – Cart management
  • /wishlist – Wishlist management

Modals

  • Login & Signup
  • User feedback interactions

Drawer (Sheet)

  • Context-aware AI assistant

🎨 UI & Accessibility

  • Built with shadcn UI and Tailwind CSS
  • Fully responsive, pixel-perfect layout
  • Dark mode support
  • Accessibility best practices followed

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ or Bun
  • npm/yarn/pnpm/bun
  • Supabase account (for authentication and database)

Installation

# Clone the repository
git clone https://github.com/yourusername/shop-now.git
cd shop-now

# Install dependencies
npm install
# or
bun install

# Set up environment variables
# Create a .env.local file with:
# NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# Run database migrations (optional)
bun run seed

# Start development server
npm run dev
# or
bun dev

Open http://localhost:3000 in your browser.

Build & Deploy

# Production build
npm run build

# Start production server
npm run start

# Lint codebase
npm run lint

🎯 Project Focus

ShopNow is intentionally designed as a frontend-specialized full-stack application, prioritizing UI/UX quality, performance optimization, and scalable frontend architecture while keeping backend complexity clean and manageable. The project demonstrates strong proficiency in modern React patterns, real-world state management, and production-ready frontend engineering practices.


πŸ“„ License

MIT License – See LICENSE file for details


Built with ❀️ using Next.js, React, Redux, and Supabase

About

ShopNow is a high-performance, full-stack shoe e-commerce platform built with React and Next.js, featuring Neon/PostgreSQL with Prisma, Express APIs, and secure auth using JWT and Google OAuth. It delivers fast, virtualized product browsing and an optimistic cart/wishlist experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors