Skip to content

BUDEGlobalEnterprise/e-commerce-platform

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Full-Stack E-Commerce Platform

A Modern, Feature-Rich E-Commerce Platform Built with Next.js 15 & MongoDB

Next.js React MongoDB TypeScript Tailwind CSS

πŸš€ Live Demo


🎯 Overview

A production-ready, full-stack e-commerce platform showcasing modern web development practices. Built with Next.js 15's latest features including Server Components, Server Actions, and advanced routing patterns. This project demonstrates enterprise-level architecture with authentication, payment processing, admin dashboard, and real-time data visualization.

🌟 Why This Project?

  • Modern Stack: Utilizes the latest Next.js 15 and React 19 features
  • Production-Ready: Includes authentication, payments, and admin tools
  • Best Practices: Follows industry standards for scalability and maintainability
  • Learning Resource: Comprehensive lessons covering every aspect of development
  • Real-World Application: Fully functional e-commerce platform ready for deployment

✨ Key Features

πŸ›οΈ Customer Experience

  • Product Catalog

    • Advanced search and filtering
    • Category-based navigation
    • Quick view modals with Next.js parallel routes
    • Product image carousels
    • Real-time stock updates
  • Shopping Features

    • Server-side cart management using HTTP cookies
    • Persistent browsing history
    • Wishlist functionality
    • Product recommendations
    • Today's deals and best sellers
  • Checkout & Payments

    • Multi-step checkout process
    • PayPal integration
    • Stripe payment gateway
    • Order confirmation emails
    • Invoice generation
  • User Account

    • Secure authentication (Email/Password, Google OAuth, Magic Link)
    • Profile management
    • Order history and tracking
    • Review and rating system
    • Address book management

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

  • Analytics & Reporting

    • Sales overview with interactive charts (Recharts)
    • Revenue analytics
    • User activity metrics
    • Best-selling products
    • Order statistics
  • Product Management

    • CRUD operations for products
    • Image upload with UploadThing
    • Inventory management
    • Category management
    • Bulk operations
  • Order Management

    • View and process orders
    • Update order status
    • Mark orders as paid/delivered
    • Print invoices
    • Order filtering and search
  • User Management

    • View and manage users
    • Role-based access control
    • User activity monitoring
    • Ban/unban users
  • Content Management

    • Dynamic web pages
    • Homepage customization
    • Banner management
    • SEO settings

🎨 Design & UX

  • Fully responsive design (mobile-first)
  • Dark/light theme support
  • Multiple color theme options
  • Accessible UI components (Shadcn/ui)
  • Smooth animations and transitions
  • Optimized images with Next.js Image
  • SEO optimized

🌐 Additional Features

  • Multilingual support
  • Email notifications (Resend)
  • Form validation (React Hook Form + Zod)
  • Server Actions for data mutations
  • Optimistic UI updates
  • Error handling and logging

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
Next.js 15 React framework with App Router
React 19 UI library with Server Components
Tailwind CSS Utility-first CSS framework
Shadcn/ui Beautiful, accessible component library
Recharts Data visualization and charts
React Hook Form Form state management
Zod Schema validation

Backend

Technology Purpose
Next.js API Routes Backend API endpoints
Server Actions Data mutations without API routes
Auth.js Authentication & authorization
Mongoose MongoDB object modeling
MongoDB NoSQL database

Integrations

Service Purpose
PayPal Payment processing
Stripe Payment processing
UploadThing File uploads
Resend Transactional emails
Google OAuth Social authentication

Development & Deployment

Tool Purpose
TypeScript Type safety (optional)
ESLint Code linting
Prettier Code formatting
Vercel Hosting & deployment
GitHub Version control

🎬 Demo

Live Application

πŸ‘‰ Visit Live Demo

Test Credentials

Admin Account:

  • Email: admin@example.com
  • Password: 123456

Customer Account:

  • Register your own account or use the demo credentials

πŸš€ Getting Started

Installation

  1. Clone the repository
git clone https://github.com/asifahemmed09/e-commerce-platform.git
cd e-commerce-platform
  1. Install dependencies
npm install --legacy-peer-deps
# or
yarn install --legacy-peer-deps
  1. Set up environment variables

Duplicate the example environment file:

cp .example-env .env.local

Then configure your environment variables (see Environment Variables section below).

  1. Set up the database

Choose one of the following options:

Option A: Cloud MongoDB (Recommended)

  • Create a free account at MongoDB Atlas
  • Create a new cluster
  • Get your connection string
  • Update MONGODB_URI in .env.local

Option B: Local MongoDB

  • Install MongoDB from mongodb.org
  • Start MongoDB service
  • Update MONGODB_URI in .env.local (default: mongodb://localhost:27017/amazona)
  1. Seed the database
npm run seed

This will populate your database with sample products, categories, and admin user.

  1. Run the development server
npm run dev
  1. Open your browser

Navigate to http://localhost:3000

  1. Sign in as admin
  • Click "Sign In"
  • Email: admin@example.com
  • Password: 123456

πŸ” Environment Variables

Create a .env.local file in the root directory with the following variables:

# Database
MONGODB_URI=your_mongodb_connection_string

# Authentication
NEXTAUTH_SECRET=your_nextauth_secret_key
NEXTAUTH_URL=http://localhost:3000

# Google OAuth (optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

# PayPal
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_APP_SECRET=your_paypal_app_secret
PAYPAL_API_URL=https://api-m.sandbox.paypal.com # Use sandbox for testing

# Stripe
STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

# Email (Resend)
RESEND_API_KEY=your_resend_api_key
EMAIL_FROM=noreply@yourdomain.com

# File Upload (UploadThing)
UPLOADTHING_SECRET=your_uploadthing_secret
UPLOADTHING_APP_ID=your_uploadthing_app_id

# App Settings
NEXT_PUBLIC_APP_NAME=Your Store Name
NEXT_PUBLIC_APP_URL=http://localhost:3000

How to Get API Keys


πŸ“– Usage

Customer Flow

  1. Browse Products: Navigate through categories or use search
  2. View Details: Click on products for detailed information
  3. Add to Cart: Select quantity and add items to cart
  4. Checkout: Sign in and proceed to checkout
  5. Payment: Choose PayPal or Stripe for payment
  6. Track Order: View order status in your account

Admin Flow

  1. Sign In: Use admin credentials
  2. Dashboard: View analytics and metrics
  3. Manage Products: Add, edit, or delete products
  4. Process Orders: Update order status and mark as delivered
  5. Manage Users: View and edit user accounts
  6. Customize Content: Update homepage and web pages

Development Commands

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Seed database
npm run seed

# Lint code
npm run lint

# Format code
npm run format

πŸ“ Project Structure

nextjs-amazona/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/                   # Authentication routes
β”‚   β”œβ”€β”€ (root)/                   # Public routes
β”‚   β”œβ”€β”€ admin/                    # Admin dashboard routes
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   └── layout.tsx                # Root layout
β”œβ”€β”€ components/                   # Reusable components
β”‚   β”œβ”€β”€ ui/                       # Shadcn UI components
β”‚   β”œβ”€β”€ shared/                   # Shared components
β”‚   └── ...
β”œβ”€β”€ lib/                          # Utility functions
β”‚   β”œβ”€β”€ actions/                  # Server Actions
β”‚   β”œβ”€β”€ db/                       # Database utilities
β”‚   β”œβ”€β”€ models/                   # Mongoose models
β”‚   └── utils.ts                  # Helper functions
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ images/                   # Images
β”‚   └── ...
β”œβ”€β”€ lessons/                      # Tutorial lessons
β”œβ”€β”€ .env.local                    # Environment variables
β”œβ”€β”€ .example-env                  # Example env file
β”œβ”€β”€ next.config.js                # Next.js configuration
β”œβ”€β”€ tailwind.config.ts            # Tailwind configuration
β”œβ”€β”€ package.json                  # Dependencies
└── README.md                     # Documentation

πŸ”Œ API Documentation

Authentication Endpoints

POST   /api/auth/signin          - Sign in user
POST   /api/auth/signup          - Register new user
POST   /api/auth/signout         - Sign out user
GET    /api/auth/session         - Get current session

Product Endpoints

GET    /api/products             - Get all products
GET    /api/products/:id         - Get product by ID
POST   /api/products             - Create product (Admin)
PUT    /api/products/:id         - Update product (Admin)
DELETE /api/products/:id         - Delete product (Admin)

Order Endpoints

GET    /api/orders               - Get user orders
GET    /api/orders/:id           - Get order by ID
POST   /api/orders               - Create order
PUT    /api/orders/:id/pay       - Mark order as paid
PUT    /api/orders/:id/deliver   - Mark order as delivered

User Endpoints

GET    /api/users/profile        - Get user profile
PUT    /api/users/profile        - Update user profile
GET    /api/users                - Get all users (Admin)
PUT    /api/users/:id            - Update user (Admin)
DELETE /api/users/:id            - Delete user (Admin)

πŸ“„ License

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

What this means:

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Private use

πŸ’¬ Support

Get Help


πŸ™ Acknowledgments

Built With


⭐ Star this repo if you find it helpful!

Back to Top

Made with ❀️ by Asif Ahemmed

About

Production-ready e-commerce built with Next.js 15, React 19, MongoDB, Tailwind, Shadcn/ui. Includes authentication, payments, analytics & admin tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.4%
  • JavaScript 1.1%
  • CSS 0.5%