Skip to content

A comprehensive e-commerce platform featuring a multi-vendor marketplace, chatbot support, order tracking, advanced analytics, and full customer, vendor, and admin management.

License

Notifications You must be signed in to change notification settings

lyes-mersel/megashop

Repository files navigation

MEGA SHOP πŸ›οΈ

Academic Project

A comprehensive e-commerce platform featuring a multi-vendor marketplace, chatbot support, order tracking, advanced analytics, and full customer, vendor, and admin management.

✨ Features

πŸ›’ Customer Features

  • Product Catalog: Browse products with advanced filtering and search
  • Shopping Cart: Persistent cart with real-time updates
  • Order Management: Track orders with real-time status updates
  • Product Reviews: Rate and review products with photo uploads
  • Wishlist: Save favorite products for later
  • Real-time Chat: Get instant support from vendors
  • Email Verification: Secure account creation with email verification
  • Password Reset: Secure password recovery system

πŸͺ Vendor Features

  • Store Management: Create and manage your own store
  • Product Management: Add, edit, and manage product inventory
  • Order Processing: Handle customer orders with status updates
  • Sales Analytics: Track sales performance and revenue
  • Payment Tracking: Monitor payment status and history
  • Customer Support: Chat with customers in real-time

πŸ‘¨β€πŸ’Ό Admin Features

  • User Management: Manage customers, vendors, and admins
  • Store Oversight: Monitor and manage all vendor stores
  • Order Management: Oversee all platform orders
  • Analytics Dashboard: Comprehensive platform analytics
  • Report Management: Handle user reports and disputes
  • System Notifications: Send platform-wide announcements

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS - Utility-first CSS framework
  • Framer Motion - Animation library
  • Redux Toolkit - State management
  • React Hook Form - Form handling
  • Zod - Schema validation

Backend

  • Next.js API Routes - Server-side API endpoints
  • Prisma - Database ORM
  • PostgreSQL - Primary database
  • NextAuth.js - Authentication system
  • Nodemailer - Email service

External Services

  • Cloudinary - Image and file storage
  • OpenRouter AI - AI-powered chat support
  • Supabase - Database hosting

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn
  • PostgreSQL database
  • Git

πŸš€ Installation

  1. Clone the Repository

    git clone https://github.com/lyes-mersel/megashop.git
    cd megashop
  2. Install Dependencies

    npm install
  3. Set Up Environment Variables

    Create a .env file in the root directory:

    # Local Development
    NEXT_PUBLIC_BASE_URL="http://localhost:3000"
    NEXT_PUBLIC_API_URL="http://localhost:3000/api"
    
    # Production
    PROD_API_URL="https://project-megashop.vercel.app"
    PROD_BASE_URL="https://project-megashop.vercel.app/api"
    
    # Database Connection
    DATABASE_URL="postgresql://postgres.fallhpfxzcmhrvtticfn:[YOUR-PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=200&pool_timeout=10"
    DATABASE_DIRECT_URL="postgresql://postgres.fallhpfxzcmhrvtticfn:[YOUR-PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres?connection_limit=200&pool_timeout=10"
    
    # Cloudinary Configuration
    NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="dzmbj5d0b"
    NEXT_PUBLIC_CLOUDINARY_API_KEY="****"
    CLOUDINARY_API_SECRET="****"
    
    # Authentication
    AUTH_SECRET="****"
    
    # Chatbot OpenRouter API Key
    OPENROUTER_API_KEY="****"
    
    # Email Configuration
    EMAIL_USER="noreply.megashop@gmail.com"
    EMAIL_APP_PASSWORD="****"
    
    # Default User Password
    DEFAULT_PASSWORD="****"
  4. Database Setup

    # Generate Prisma client
    npx prisma generate
    
    # Run database migrations
    npx prisma migrate dev
    
    # Seed the database with initial data
    npx prisma db seed
  5. Run the Development Server

    npm run dev

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

πŸ“Š Database Schema

The application uses PostgreSQL with the following main entities:

  • Users: Customers, vendors, and admins
  • Products: Product catalog with variants
  • Orders: Order management and tracking
  • Carts: Shopping cart functionality
  • Reviews: Product reviews and ratings
  • Notifications: System notifications
  • Reports: User reports and disputes

πŸ—οΈ Project Structure

megashop/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ (portal)/           # Admin, vendor, and client portals
β”‚   β”œβ”€β”€ (store)/            # Public store pages
β”‚   β”œβ”€β”€ api/                # API routes
β”‚   └── auth/               # Authentication pages
β”œβ”€β”€ components/             # Reusable UI components
β”‚   β”œβ”€β”€ auth/               # Authentication components
β”‚   β”œβ”€β”€ common/             # Shared components
β”‚   β”œβ”€β”€ layout/             # Layout components
β”‚   β”œβ”€β”€ portal/             # Portal-specific components
β”‚   β”œβ”€β”€ store/              # Store-specific components
β”‚   └── ui/                 # Base UI components
β”œβ”€β”€ lib/                    # Utility libraries
β”‚   β”œβ”€β”€ auth/               # Authentication utilities
β”‚   β”œβ”€β”€ helpers/            # Helper functions
β”‚   β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── validations/        # Form validations
β”œβ”€β”€ prisma/                 # Database schema and migrations
β”œβ”€β”€ redux/                  # State management
└── styles/                 # Global styles

πŸš€ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npx prisma studio - Open Prisma Studio
  • npx prisma migrate dev - Run database migrations
  • npx prisma db seed - Seed database with initial data

πŸ” Authentication

The application uses NextAuth.js with the following authentication methods:

  • Email/Password authentication
  • Email verification
  • Password reset functionality
  • Role-based access control (Customer, Vendor, Admin)

πŸš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Set up environment variables in Vercel dashboard
  4. Deploy automatically on push

Manual Deployment

  1. Build the application:

    npm run build
  2. Start the production server:

    npm start

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“š About This Project

MEGA SHOP Β© 2025 – Academic project developed by Master 1 Software Engineering students from the University of BΓ©jaΓ―a. This project serves as a comprehensive e-commerce solution that demonstrates modern web development practices, full-stack architecture, and real-world application development skills.

🏫 Institution: University of Béjaïa
πŸ“– Program: Master 1 Software Engineering
πŸ‘₯ Team: 4 students
πŸ“… Year: 2025
πŸ‘¨β€πŸ« Supervisor: Mr Z.Farah


Note: The user experience (UI) and all project documentation are provided in French.


πŸ‘¨β€πŸ’» Development Team

πŸ“Έ Screenshots

Hero Section

Hero Section

View All Screenshots

Explore the complete visual showcase in the πŸ“ Screenshots Gallery, featuring main store interface, admin portal, vendor portal, client portal, and mobile responsive design.

πŸ“– API Documentation

For detailed API documentation, please refer to the API Documentation README.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


MEGA SHOP - Your complete e-commerce solution! πŸ›οΈβœ¨

About

A comprehensive e-commerce platform featuring a multi-vendor marketplace, chatbot support, order tracking, advanced analytics, and full customer, vendor, and admin management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages