Skip to content

4darsh-Dev/store

Β 
Β 

Repository files navigation

Full Stack E-Commerce Website (+ Dashboard) with Next.js 14: React, Typescript, Tailwindcss, Prisma, Supabase, NextAuth, Redux.

Fullstack E-Commerce Website

Overview

Bitex is a full-stack E-Commerce project developed with Next.js 14, featuring a range of technologies including React, Typescript, Tailwindcss, Prisma, Supabase (PostgreSQL), NextAuth, and Redux. Now enhanced with advanced search functionality and bulk import capabilities.

⚠️ Note: This project is a personal endeavor created for portfolio purposes and is not associated with any real business or project.

πŸ†• Latest Updates

  • βœ… Migrated from MongoDB to Supabase (PostgreSQL) for better performance and scalability
  • πŸ” Enhanced Search Engine with full-text search and advanced filtering
  • πŸ“€ Bulk Import System for products, categories, and brands
  • πŸ“Š Search Analytics with query logging and performance tracking
  • 🎯 Optimized Database Schema with proper indexes and relationships

πŸ”— Live Version:

https://bitex.namvar.dev ‴️


πŸ–₯️ Admin Dashboard Features

πŸ” Authentication:

  • Credential authentication for Dashboard using NextAuth.

πŸ“ Category Management:

  • Advanced category management, including combining categories.
  • Add, update, and delete categories and subcategories.
  • Dedicated specifications for every category.

🏭 Brands and Products:

  • Add and delete products with category-specific specifications.
  • Add, update, and delete brands.

πŸ“‹ Traffic Report:

  • Reports on user page visits.



πŸ›οΈ E-Commerce Store Features

🎨 UI Features:

  • Full responsiveness

  • CSS animations and effects

  • Skeleton loadings (without using external library )to have seamless page navigation experience.

  • Custom made UI Components (no external library):

    • Price range slider
    • CheckBox
    • DropDownList
    • Popups
    • Button
  • Interactive Homepage Slider

    • Crafted from scratch without using any Library
    • Supports both Mouse Drag and TouchInput
  • Shopping cart management with Redux.

  • Product gallery to showcase items attractively.

  • Dynamically Loading Categories (List) from Database

πŸ” Filter and Search:

  • πŸ†• Advanced Search Engine with full-text search across products, brands, and categories
  • 🎯 Smart Filtering by price range, brand, category, availability, and discounts
  • πŸ“Š Search Analytics with query logging and result tracking
  • ⚑ Real-time Search with instant results and suggestions
  • Advanced filters products by Price, Brand, and Availability.
  • Sorting options in product list page (sort by name, price, and relevance).

βš™οΈ Backend:

  • πŸ†• Supabase Integration with PostgreSQL for enhanced performance
  • πŸ“€ Bulk Import APIs for efficient data management
  • Database integration using Supabase (PostgreSQL) with Prisma ORM.
  • Server-side form data validation using ZOD.
  • πŸ” Search APIs with advanced filtering and pagination

πŸš€ Getting Started

πŸ“‹ Prerequisites

  • Node.js 18+
  • Supabase account (supabase.com)
  • npm or yarn package manager

πŸ’Ύ Cloning the repository

git clone https://github.com/HosseinNamvar/bitex.git
cd bitex

πŸ“₯ Install packages

npm install

πŸ› οΈ Setup .env file

Copy .env.example to .env and configure:

# Supabase Database URL (PostgreSQL)
DATABASE_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres"

# NextAuth Configuration
NEXTAUTH_SECRET="your-super-secret-nextauth-key"
NEXTAUTH_URL="http://localhost:3000"

# Optional: Cloudinary for image uploads
CLOUDINARY_URL="cloudinary://api_key:api_secret@cloud_name"

# Optional: Supabase keys for advanced features  
NEXT_PUBLIC_SUPABASE_URL="https://your-project-ref.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-anon-key"

⬆️ Setup Database with Prisma

# Generate Prisma client
npm run db:generate

# Run database migrations
npm run db:migrate

# Seed database with sample data
npm run db:seed

πŸš€ Start the app

npm run dev

Visit http://localhost:3000 to see your store!

πŸ“€ Bulk Data Import

Quick Import with Sample Data

cd examples
node bulk-import.js

API Endpoints for Bulk Import

  • POST /api/products/bulk - Import products
  • POST /api/categories - Import categories
  • POST /api/brands - Import brands
  • GET /api/search - Search products with filters

See examples/ directory for sample data and import scripts.

πŸ” Search API Usage

Basic Search

GET /api/search?q=iPhone&category=smartphones&minPrice=500&maxPrice=1000

Advanced Search

POST /api/search
{
  "query": "iPhone",
  "filters": {
    "categories": ["cat-id-1"],
    "brands": ["brand-id-1"],
    "priceRange": { "min": 500, "max": 1000 },
    "hasDiscount": true,
    "inStock": true
  },
  "sort": { "field": "price", "order": "asc" },
  "pagination": { "page": 1, "limit": 20 }
}

πŸ“š Documentation

πŸ› οΈ Available Scripts

# Development
npm run dev              # Start development server
npm run build           # Build for production
npm run start           # Start production server

# Database
npm run db:migrate      # Run Prisma migrations
npm run db:generate     # Generate Prisma client
npm run db:seed         # Seed database with sample data
npm run db:studio       # Open Prisma Studio
npm run db:reset        # Reset and reseed database

# Code Quality
npm run lint            # Run ESLint
npm run lint:fix        # Fix ESLint errors

About

Fullstack e-commerce website built with Next.js, Typescript, Prisma, MongoDB

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.1%
  • JavaScript 9.1%
  • CSS 0.8%