Skip to content

A premium full-stack e-commerce web application for browsing, purchasing, and managing plants, built with React, Node.js, Express, and MongoDB.

Notifications You must be signed in to change notification settings

techbire/BloomCart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BloomCart

A premium full-stack e-commerce web application for browsing, purchasing, and managing plants, built with React, Node.js, Express, and MongoDB. Created by TechBire. 🎯 Live Demo: https://bloomcart-wheat.vercel.app/

πŸ“Έ Screenshots

Dashboard

Dashboard

🌱 Features

Frontend Features

  • Plant Catalog: Browse through a beautiful grid of plants with images, names, prices, and categories
  • Search & Filter:
    • Search by plant name, category, or description (case-insensitive)
    • Filter by category (Indoor, Outdoor, Succulent, Air Purifying, Favorites, etc.)
    • Filter by availability (In Stock/Out of Stock)
    • Sort by date, name, or price
  • Shopping Cart: Add plants to cart, manage quantities, and proceed to checkout
  • Favorites Collection: Save your favorite plants for easy access
  • Plant Details: Detailed view with pricing, descriptions, and care instructions
  • Add Plant (Admin): Add new plants with comprehensive validation
  • Responsive Design: Glass morphism UI that works seamlessly on desktop, tablet, and mobile devices
  • Loading States: Beautiful loading animations and error handling
  • SEO Optimized: Complete meta tags, Open Graph, and Twitter Card support

Backend Features

  • RESTful API: Clean, scalable API with proper error handling
  • Database Integration: MongoDB with Mongoose ODM
  • Data Validation: Server-side validation with Joi
  • Security: CORS, Helmet, and rate limiting
  • Search: Advanced text search with indexing
  • Payment Integration: Razorpay payment gateway integration
  • Image Management: Google Images API integration for plant photos
  • Seeding: Pre-populated with 50+ plant records

πŸš€ Tech Stack

Frontend

  • React 18 with functional components and hooks
  • React Router for navigation
  • Axios for API calls
  • React Icons for beautiful icons
  • React Toastify for notifications
  • CSS3 with modern styling and animations

Backend

  • Node.js with Express.js framework
  • MongoDB with Mongoose ODM
  • Joi for data validation
  • CORS for cross-origin requests
  • Helmet for security headers
  • Express Rate Limit for API protection

πŸ“ Project Structure

BloomCart/
β”œβ”€β”€ backend/                 # Node.js Express API
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   └── Plant.js              # Plant data model
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ plants.js            # Plant API routes
β”‚   β”‚   β”œβ”€β”€ payments.js          # Payment processing
β”‚   β”‚   β”œβ”€β”€ images.js            # Image management
β”‚   β”‚   └── scraper.js           # Web scraping utilities
β”‚   β”œβ”€β”€ validators/
β”‚   β”‚   └── plantValidator.js    # Input validation
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   └── seedData.js          # Database seeding
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── GoogleImagesService.js # Image API integration
β”‚   β”œβ”€β”€ server.js                # Express server setup
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env                     # Environment variables
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/                  # Static assets, favicon, manifest
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.js        # Navigation header
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.js        # Site footer
β”‚   β”‚   β”‚   β”œβ”€β”€ PlantCard.js     # Individual plant display
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchAndFilter.js # Search and filter UI
β”‚   β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.js # Loading component
β”‚   β”‚   β”‚   β”œβ”€β”€ ErrorMessage.js  # Error display
β”‚   β”‚   β”‚   └── Cart.js          # Shopping cart
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.js          # Main catalog page
β”‚   β”‚   β”‚   β”œβ”€β”€ AddPlant.js      # Add plant form
β”‚   β”‚   β”‚   β”œβ”€β”€ PlantDetail.js   # Plant details view
β”‚   β”‚   β”‚   β”œβ”€β”€ Checkout.js      # Checkout process
β”‚   β”‚   β”‚   └── OrderSuccess.js  # Order confirmation
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── CartContext.jsx  # Shopping cart state
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js           # API integration
β”‚   β”‚   β”‚   └── imageAPI.js      # Image utilities
β”‚   β”‚   β”œβ”€β”€ App.js               # Main app component
β”‚   β”‚   └── index.js             # React entry point
β”‚   └── package.json
β”œβ”€β”€ .github/                     # GitHub configurations
β”œβ”€β”€ README.md                    # Project documentation
β”œβ”€β”€ start.ps1                    # Quick start script
β”œβ”€β”€ DEPLOYMENT_GUIDE.md          # Comprehensive deployment guide
└── DEPLOYMENT_CHECKLIST.md     # Quick deployment checklist

πŸ›  Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local installation or MongoDB Atlas)
  • npm or yarn

Backend Setup

  1. Navigate to backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Environment Configuration: Create a .env file in the backend directory:

    PORT=5000
    MONGODB_URI=mongodb://localhost:27017/plantstore
    FRONTEND_URL=http://localhost:3000
    NODE_ENV=development
  4. Start MongoDB: Make sure MongoDB is running on your system

  5. Seed the database:

    npm run seed
  6. Start the backend server:

    npm run dev

    The backend will run on http://localhost:5000

Frontend Setup

  1. Navigate to frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Environment Configuration (Optional): Create a .env file in the frontend directory:

    REACT_APP_API_URL=http://localhost:5000/api
  4. Start the frontend:

    npm start

    The frontend will run on http://localhost:3000

🌐 API Endpoints

Plants

  • GET /api/plants - Get all plants with optional filters
  • GET /api/plants/:id - Get single plant by ID
  • POST /api/plants - Add new plant
  • PUT /api/plants/:id - Update plant
  • DELETE /api/plants/:id - Delete plant
  • GET /api/plants/meta/categories - Get all categories

Query Parameters for GET /api/plants

  • search - Search by name, category, or description
  • category - Filter by category
  • availability - Filter by availability (true/false)
  • page - Page number for pagination
  • limit - Items per page
  • sortBy - Sort field (createdAt, name, price)
  • sortOrder - Sort order (asc, desc)

πŸ’Ύ Database Schema

Plant Model

{
  name: String (required, 2-100 characters),
  price: Number (required, >= 0),
  categories: [String] (required, enum values),
  availability: Boolean (default: true),
  description: String (max 500 characters),
  image: String (URL),
  care_instructions: String (max 300 characters),
  stock_quantity: Number (>= 0, default: 0),
  createdAt: Date,
  updatedAt: Date
}

Available Categories

  • Indoor
  • Outdoor
  • Succulent
  • Air Purifying
  • Home Decor
  • Low Light
  • Pet Friendly
  • Flowering
  • Medicinal
  • Hanging
  • Large
  • Small

🎨 Features Showcase

Plant Catalog

  • Grid layout with responsive design
  • Beautiful plant cards with hover effects
  • Category tags and availability badges
  • Price display with Indian Rupee symbol

Search & Filter

  • Real-time search with debouncing
  • Category dropdown with all available categories
  • Availability filter
  • Sorting options (date, name, price)
  • Clear filters functionality

Add Plant Form

  • Comprehensive form with validation
  • Category suggestions and custom category input
  • Image preview functionality
  • Character count for text fields
  • Success/error notifications

Responsive Design

  • Mobile-first approach
  • Tablet and desktop optimizations
  • Touch-friendly interface
  • Flexible grid layouts

οΏ½ Deployment

This project is ready for production deployment! Choose from multiple deployment options:

Quick Deployment (Recommended)

  • Frontend: Vercel (Free tier)
  • Backend: Railway (Free tier)
  • Database: MongoDB Atlas (Free tier)

Deployment Files

  • πŸ“‹ DEPLOYMENT_CHECKLIST.md - Quick checklist for immediate deployment
  • πŸ“– DEPLOYMENT_GUIDE.md - Comprehensive step-by-step deployment guide

Environment Variables Required

# Frontend
REACT_APP_API_URL=https://your-backend-url.com
REACT_APP_RAZORPAY_KEY=rzp_test_your_key

# Backend
NODE_ENV=production
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/bloomcart
RAZORPAY_KEY_ID=rzp_test_your_key_id
RAZORPAY_KEY_SECRET=your_razorpay_secret
JWT_SECRET=your_super_secret_jwt_key
FRONTEND_URL=https://your-frontend-url.com

οΏ½πŸ”’ Security Features

  • CORS protection
  • Helmet for security headers
  • Rate limiting (100 requests per 15 minutes)
  • Input validation and sanitization
  • Error handling without exposing sensitive data

πŸš€ Performance Optimizations

  • Database indexing for faster searches
  • Pagination to limit data transfer
  • Debounced search to reduce API calls
  • Optimized images with fallback
  • Lazy loading components

πŸ§ͺ Testing

The application includes:

  • Form validation
  • Error boundary handling
  • API error handling
  • Responsive design testing

πŸ“± Responsive Breakpoints

  • Mobile: < 480px
  • Tablet: 480px - 768px
  • Desktop: > 768px

🌟 Future Enhancements

  • User authentication and authorization
  • User profiles and order history
  • Plant care reminders and notifications
  • Reviews and ratings system
  • Advanced filtering (price range, plant size, difficulty level)
  • Plant care guides and tutorials
  • Community features (plant sharing, forums)
  • Real-time inventory management
  • Multi-language support
  • Mobile app development

πŸ‘₯ Contributing

This project was built as a comprehensive plant e-commerce solution. Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ž Contact

Developer: TechBire
Email: anshhtechnical@gmail.com
LinkedIn: https://www.linkedin.com/in/techbire/

For any queries, suggestions, or collaboration opportunities, feel free to reach out!

🌟 Acknowledgments

  • Thanks to all plant lovers who inspired this project
  • Special thanks to the open-source community for amazing libraries and tools

Built with ❀️ for plant lovers everywhere 🌱
Transform your space with nature's beauty 🏑

About

A premium full-stack e-commerce web application for browsing, purchasing, and managing plants, built with React, Node.js, Express, and MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published