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/
βββ app/
β βββ api/ # API endpoints
β βββ products/ # Product pages
β βββ cart/ # Cart pages
β βββ checkout/ # Checkout process
β βββ admin/ # Admin dashboard
β βββ auth/ # Authentication pages
β βββ layout.tsx # Root layout
βββ components/
β βββ layout/ # Layout components
β βββ products/ # Product-related components
β βββ cart/ # Shopping cart components
β βββ auth/ # Authentication components
β βββ ui/ # Reusable UI components
βββ styles/ # CSS and styling
βββ lib/
β βββ mongodb.ts # Database configuration
β βββ auth.ts # Authentication utilities
β βββ cart.ts # 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 file for details.