A modern, fully-featured e-commerce template built with Next.js, featuring Google Authentication, MongoDB for data storage, and Cloudinary for product images management.
- Responsive Modern Design
- User Authentication with Google
- Product Catalog with Categories
- Shopping Cart Functionality
- Product Search and Filtering
- User Profile Management
- Image Management with Cloudinary
- Secure Payment Processing
- Order History
- Admin Dashboard
- Responsive Product Gallery
- SEO Optimized
- Install dependencies
npm install
- Run the development server
npm run dev
- Open http://localhost:3000 with your browser to see the result.
Rename .env.example
to .env.local
in the root directory and configure the following variables:
# Database Configuration
MONGODB_URI=your_mongodb_uri
# Authentication
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
NEXTAUTH_SECRET=your_nextauth_secret
NEXTAUTH_URL=http://localhost:3000
# Image Storage
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
- Create a free MongoDB database following this guide
- Perfect for storing:
- Product catalog
- User information
- Orders
- Shopping cart data
- Set up Google OAuth for secure user authentication following this guide
- Enables:
- User registration
- Secure login
- Profile management
Generate a random secret key by running:
npx auth secret
- Set up Cloudinary for product image management following this guide
- Used for:
- Product images storage
- Image optimization
- Responsive images
src/
├── components/
│ ├── layout/ # Layout components
│ ├── products/ # Product-related components
│ ├── cart/ # Shopping cart components
│ ├── auth/ # Authentication components
│ └── ui/ # Reusable UI components
├── pages/
│ ├── api/ # API endpoints
│ ├── products/ # Product pages
│ ├── cart/ # Cart pages
│ ├── checkout/ # Checkout process
│ ├── admin/ # Admin dashboard
│ └── auth/ # Authentication pages
├── styles/ # CSS and styling
├── lib/
│ ├── mongodb.js # Database configuration
│ ├── auth.js # Authentication utilities
│ └── cart.js # Cart management
├── models/ # MongoDB models
└── utils/ # Helper functions
- Browse product catalog
- Search and filter products
- Add items to cart
- Secure checkout process
- Order tracking
- User profile management
- Order history
- Product management
- Order management
- User management
- Analytics dashboard
- Inventory tracking
- Image upload and management
- Secure authentication
- Protected API routes
- Secure payment processing
- Data encryption
- Input validation
- XSS protection
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Deployment Checklist:
- Configure environment variables
- Set up production database
- Configure payment processing for production
- Update authentication callbacks
- Set up proper image optimization
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add: AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details.