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.
- 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
-
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
-
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
- 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
- Multilingual support
- Email notifications (Resend)
- Form validation (React Hook Form + Zod)
- Server Actions for data mutations
- Optimistic UI updates
- Error handling and logging
| 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 |
| 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 |
| Service | Purpose |
|---|---|
| PayPal | Payment processing |
| Stripe | Payment processing |
| UploadThing | File uploads |
| Resend | Transactional emails |
| Google OAuth | Social authentication |
| Tool | Purpose |
|---|---|
| TypeScript | Type safety (optional) |
| ESLint | Code linting |
| Prettier | Code formatting |
| Vercel | Hosting & deployment |
| GitHub | Version control |
π Visit Live Demo
Admin Account:
- Email:
admin@example.com - Password:
123456
Customer Account:
- Register your own account or use the demo credentials
- Clone the repository
git clone https://github.com/asifahemmed09/e-commerce-platform.git
cd e-commerce-platform- Install dependencies
npm install --legacy-peer-deps
# or
yarn install --legacy-peer-deps- Set up environment variables
Duplicate the example environment file:
cp .example-env .env.localThen configure your environment variables (see Environment Variables section below).
- 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_URIin.env.local
Option B: Local MongoDB
- Install MongoDB from mongodb.org
- Start MongoDB service
- Update
MONGODB_URIin.env.local(default:mongodb://localhost:27017/amazona)
- Seed the database
npm run seedThis will populate your database with sample products, categories, and admin user.
- Run the development server
npm run dev- Open your browser
Navigate to http://localhost:3000
- Sign in as admin
- Click "Sign In"
- Email:
admin@example.com - Password:
123456
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- MongoDB: MongoDB Atlas
- NextAuth Secret: Generate with
openssl rand -base64 32 - Google OAuth: Google Cloud Console
- PayPal: PayPal Developer
- Stripe: Stripe Dashboard
- Resend: Resend
- UploadThing: UploadThing
- Browse Products: Navigate through categories or use search
- View Details: Click on products for detailed information
- Add to Cart: Select quantity and add items to cart
- Checkout: Sign in and proceed to checkout
- Payment: Choose PayPal or Stripe for payment
- Track Order: View order status in your account
- Sign In: Use admin credentials
- Dashboard: View analytics and metrics
- Manage Products: Add, edit, or delete products
- Process Orders: Update order status and mark as delivered
- Manage Users: View and edit user accounts
- Customize Content: Update homepage and web pages
# 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 formatnextjs-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
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
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)
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
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)
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use
- β Modification
- β Distribution
- β Private use
- π§ Email: asifahemmed.dev@gmail.com
- Next.js - The React Framework
- MongoDB - Database
- Tailwind CSS - Styling
- Shadcn/ui - UI Components
- Auth.js - Authentication
- Recharts - Charts