A modern, full-featured e-commerce platform built with Next.js, React, Node.js, and MongoDB. Perfect for baby products and kids' essentials with a comprehensive admin dashboard and customer-facing storefront.
A modern, responsive e-commerce platform for baby products
This project includes premium locked features that showcase advanced e-commerce functionality. Get full access to all features, complete source code, and lifetime updates!
Note: This is a community project maintained by TheNeovimmer. Premium features may be available through the original project maintainers.
β¨ What's Included:
- β Complete source code for all 3 projects (Client + Admin + Server)
- β All premium features unlocked
- β Lifetime access and updates
- β Comprehensive documentation
- β Priority support
- β Production-ready code
- β No hidden fees or subscriptions
Get up and running in minutes:
# Clone the repository
git clone https://github.com/TheNeovimmer/babyshop.git
cd babyshop
# Install dependencies for all projects
cd client && pnpm install && cd ..
cd admin && pnpm install && cd ..
cd server && pnpm install && cd ..
# Set up environment variables (see Configuration section)
# Then start the development servers
cd server && pnpm dev # Terminal 1
cd client && pnpm dev # Terminal 2
cd admin && pnpm dev # Terminal 3Visit:
- ποΈ Client: http://localhost:3000
- π Admin: http://localhost:5173
- π API: http://localhost:5000/api-docs
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Running the Application
- Available Scripts
- API Documentation
- Premium Features
- Deployment
- Security Considerations
- Troubleshooting
- Contributing
- License
- Support
- Acknowledgments
-
ποΈ Modern Shopping Experience
- Product browsing with advanced filtering and sorting
- Real-time search functionality
- Product detail pages with image galleries
- Shopping cart with quantity management
- Wishlist functionality
- User authentication and profile management
-
π³ Secure Checkout
- Stripe payment integration
- Multiple address management
- Order tracking and history
- Payment success/failure handling
-
π± Responsive Design
- Mobile-first approach
- Beautiful UI with Tailwind CSS
- Dark mode support
- Smooth animations and transitions
-
π― User Features
- Account dashboard
- Order history and details
- Profile management
- Wishlist management
- Address book
-
π Analytics & Insights
- Sales statistics and charts
- Revenue tracking
- Product performance metrics
- User analytics
-
πͺ Product Management
- Add, edit, delete products
- Image upload with Cloudinary
- Inventory tracking
- Category and brand management
-
π¦ Order Management
- View and manage orders
- Update order status
- Order details and tracking
- Customer information
-
π₯ User Management
- Customer list and details
- User activity tracking
- Account management
-
π¨ Content Management
- Banner management
- Category management
- Brand management
-
π Authentication & Security
- JWT-based authentication
- Password encryption with bcrypt
- Protected routes and middleware
- CORS configuration
-
π‘ RESTful API
- Comprehensive API endpoints
- Swagger documentation
- Error handling
- Request validation
-
πΎ Database
- MongoDB with Mongoose ODM
- Optimized queries
- Data validation
- Relationships and references
-
π§ Email Service
- Order confirmation emails
- User notifications
- Nodemailer integration
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Radix UI, shadcn/ui
- State Management: Zustand
- Forms: React Hook Form + Zod
- Payment: Stripe
- HTTP Client: Axios
- Icons: Lucide React
- Framework: React 18 + Vite
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Radix UI, shadcn/ui
- State Management: Zustand
- Routing: React Router DOM
- Charts: Recharts
- Forms: React Hook Form + Zod
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT (jsonwebtoken)
- File Upload: Cloudinary, Multer
- Email: Nodemailer
- API Docs: Swagger
- Security: bcryptjs, CORS
babyshop/
βββ client/ # Next.js Customer Frontend
β βββ app/ # App router pages
β β βββ (public)/ # Public pages (about, terms, etc.)
β β βββ api/ # API routes
β β βββ auth/ # Authentication pages
β β βββ product/ # Product pages
β β βββ shop/ # Shop page
β β βββ user/ # User dashboard
β β βββ layout.tsx # Root layout
β βββ components/ # React components
β β βββ common/ # Shared components
β β βββ pages/ # Page-specific components
β β βββ skeleton/ # Loading skeletons
β β βββ ui/ # shadcn/ui components
β βββ lib/ # Utilities and API clients
β βββ hooks/ # Custom React hooks
β βββ public/ # Static assets
β βββ package.json
β
βββ admin/ # React Admin Dashboard
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Dashboard pages
β β βββ hooks/ # Custom hooks
β β βββ store/ # Zustand stores
β β βββ lib/ # Utilities
β βββ public/ # Static assets
β βββ package.json
β
βββ server/ # Node.js Backend API
β βββ config/ # Configuration files
β β βββ db.js # MongoDB connection
β β βββ cloudinary.js # Cloudinary setup
β β βββ swagger.js # API documentation
β βββ controllers/ # Route controllers
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ utils/ # Helper functions
β βββ scripts/ # Data import/export scripts
β βββ data/ # Seed data
β βββ package.json
β
βββ .env.example # Environment variables template
βββ README.md # This file
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download
- pnpm (v8 or higher) -
npm install -g pnpm - MongoDB - MongoDB Atlas (cloud) or local installation
- Git - Download
- MongoDB Atlas - For database hosting
- Cloudinary - For image storage
- Stripe - For payment processing
- Email Service - Gmail or SendGrid for emails
git clone https://github.com/TheNeovimmer/babyshop.git
cd babyshopOr using SSH:
git clone git@github.com:TheNeovimmer/babyshop.git
cd babyshopInstall dependencies for all three projects:
# Install client dependencies
cd client
pnpm install
# Install admin dependencies
cd ../admin
pnpm install
# Install server dependencies
cd ../server
pnpm installCreate .env file in the server/ directory:
cd server
cp .env.example .envEdit the .env file with your credentials:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
# Get your MongoDB URI from: https://www.mongodb.com/cloud/atlas/register
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/babyshop?retryWrites=true&w=majority
# JWT Configuration
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRE=7d
# Cloudinary Configuration
# Get credentials from: https://console.cloudinary.com/console
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Stripe Payment Configuration
# Get keys from: https://dashboard.stripe.com/test/apikeys
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
# Email Configuration
EMAIL_SERVICE=gmail
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_specific_password
EMAIL_FROM=noreply@babyshop.com
# Client URLs
CLIENT_URL=http://localhost:3000
ADMIN_URL=http://localhost:5173Create .env file in the client/ directory:
cd ../client
cp .env.example .envEdit the .env file:
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:5000/api
# Stripe Configuration
# Get your publishable key from: https://dashboard.stripe.com/test/apikeys
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
# NextAuth Configuration
# Generate with: openssl rand -base64 32
NEXTAUTH_SECRET=your_nextauth_secret_here
NEXTAUTH_URL=http://localhost:3000
# Site Configuration
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_SITE_NAME=BabyShopCreate .env file in the admin/ directory:
cd ../admin
cp .env.example .envEdit the .env file:
# API Configuration
VITE_API_URL=http://localhost:5000/api
# Admin Configuration
VITE_APP_NAME=BabyShop Admin
VITE_APP_VERSION=1.0.0
# Environment
VITE_NODE_ENV=developmentOpen three terminal windows and run:
Terminal 1 - Backend Server:
cd server
pnpm dev
# Server runs on http://localhost:5000Terminal 2 - Client Frontend:
cd client
pnpm dev
# Client runs on http://localhost:3000Terminal 3 - Admin Dashboard:
cd admin
pnpm dev
# Admin runs on http://localhost:5173You can create a root package.json to run all services:
{
"scripts": {
"dev:server": "cd server && pnpm dev",
"dev:client": "cd client && pnpm dev",
"dev:admin": "cd admin && pnpm dev",
"dev": "npm-run-all --parallel dev:*"
}
}Then run:
pnpm install npm-run-all
pnpm devpnpm dev # Start development server with nodemon
pnpm start # Start production server
pnpm export-data # Export data to JSON
pnpm import-data # Import data from JSONpnpm dev # Start Next.js development server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLintpnpm dev # Start Vite development server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm lint # Run ESLintOnce the server is running, access the Swagger API documentation at:
http://localhost:5000/api-docs
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/products- Get all productsGET /api/products/:id- Get product by IDPOST /api/products- Create product (Admin)PUT /api/products/:id- Update product (Admin)DELETE /api/products/:id- Delete product (Admin)
GET /api/orders- Get user ordersGET /api/orders/:id- Get order by IDPOST /api/orders- Create new orderPUT /api/orders/:id- Update order status (Admin)
GET /api/cart- Get user cartPOST /api/cart- Add to cartPUT /api/cart/:id- Update cart itemDELETE /api/cart/:id- Remove from cart
GET /api/wishlist- Get user wishlistPOST /api/wishlist- Add to wishlistDELETE /api/wishlist/:id- Remove from wishlist
This project includes premium features that are locked by default. These features showcase advanced e-commerce functionality:
- β¨ Advanced Shop - Filtering, sorting, and search capabilities
- π Analytics Dashboard - Comprehensive business insights
- π§Ύ Invoice Generator - Professional invoicing system
- π¦ Order Details - Detailed order tracking
- π Legal Pages - Privacy Policy, Terms & Conditions
- π Testimonials - Customer review management
- π Returns/Exchange - Return management system
- π€ Partnership Programs - Affiliate and wholesale programs
To unlock these features, check the original project maintainers or enable them for development (see below).
To enable premium features during development, locate the feature component and change:
const ENABLE_FREE_ACCESS = false; // Change to trueUsing Vercel:
cd server
vercel deployUsing Railway:
- Connect your GitHub repository
- Add environment variables
- Deploy automatically
Using Render:
- Create a new Web Service
- Connect your repository
- Add environment variables
- Deploy
Using Vercel:
cd client
vercel deployUsing Netlify:
cd client
pnpm build
netlify deploy --prod --dir=.nextUsing Vercel:
cd admin
vercel deployUsing Netlify:
cd admin
pnpm build
netlify deploy --prod --dir=distUpdate all .env files with production URLs:
- Replace
localhostwith your deployed URLs - Use production MongoDB URI
- Use production Stripe keys
- Update CORS settings in the server
- Never commit
.envfiles to version control - Use strong JWT secrets (32+ characters)
- Enable HTTPS in production
- Implement rate limiting for API endpoints
- Regularly update dependencies
- Use environment-specific configurations
- Sanitize user inputs
- Implement proper error handling
MongoDB Connection Error:
# Check your MONGO_URI in .env
# Ensure your IP is whitelisted in MongoDB Atlas
# Verify network connectivityPort Already in Use:
# Change PORT in .env file
# Or kill the process using the port:
lsof -ti:5000 | xargs kill -9 # macOS/LinuxCloudinary Upload Error:
# Verify CLOUDINARY credentials
# Check file size limits
# Ensure proper file formatStripe Payment Issues:
# Use test cards: 4242 4242 4242 4242
# Verify STRIPE_PUBLISHABLE_KEY is in client .env
# Check STRIPE_SECRET_KEY in server .envContributions are welcome and greatly appreciated! This project follows standard open-source contribution guidelines.
-
Fork the repository
# Click the "Fork" button on GitHub, then clone your fork git clone https://github.com/TheNeovimmer/babyshop.git cd babyshop
-
Create a feature branch
git checkout -b feature/AmazingFeature
-
Make your changes
- Write clean, maintainable code
- Follow the existing code style
- Add comments where necessary
- Update documentation if needed
-
Commit your changes
git commit -m 'Add some AmazingFeature'Use clear, descriptive commit messages following Conventional Commits
-
Push to your fork
git push origin feature/AmazingFeature
-
Open a Pull Request
- Provide a clear description of your changes
- Reference any related issues
- Add screenshots if UI changes are involved
- π― Focus: Keep PRs focused on a single feature or fix
- β Testing: Test your changes thoroughly before submitting
- π Documentation: Update README or docs if needed
- π¬ Communication: Be respectful and constructive in discussions
- π Code Quality: Ensure your code passes linting and follows best practices
Found a bug or have a feature request? Please open an issue with:
- Clear description of the problem/feature
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Screenshots if applicable
- Environment details (OS, Node version, etc.)
This project is licensed under the MIT License - see the LICENSE file for details.
Need help? We're here for you!
- π Bug Reports: Open an issue
- π‘ Feature Requests: Request a feature
- π¬ Discussions: Join the discussion
- π§ Email: Open an issue for direct contact
Special thanks to the amazing open-source community and the following projects:
- Next.js - The React framework for production
- Vercel - For hosting solutions and deployment
- shadcn/ui - Beautiful, accessible components
- Stripe - Payment processing infrastructure
- MongoDB - Database hosting and management
- Cloudinary - Image and media management
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible UI primitives
- React Hook Form - Performant forms library
- Zod - TypeScript-first schema validation
Created and maintained by TheNeovimmer
β If this project helped you, please consider giving it a star!