A beautiful flower shop e-commerce application built with React, Node.js, Express, and MongoDB.
- Browse products by category
- Product search and filtering
- Shopping cart functionality
- User registration and authentication
- Checkout process
- Order history
- Product reviews
- Dashboard with statistics
- Product management (CRUD)
- Category management
- Order management
- User management
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- React Router for navigation
- Zustand for state management
- React Hook Form for forms
- React Hot Toast for notifications
- Node.js with Express
- MongoDB with Mongoose
- JWT for authentication
- bcryptjs for password hashing
- Node.js 18+
- MongoDB (local or Atlas)
-
Clone the repository
-
Install Frontend dependencies:
cd frontend
npm install- Install Backend dependencies:
cd backend
npm install- Configure environment variables:
# Copy example env file
cp backend/.env.example backend/.env
# Edit the .env file with your settings- Seed the database:
cd backend
npm run seed- Start the development servers:
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run devAfter running the seed command:
- Admin: admin@flowerbloom.com / admin123
- User: user@example.com / user123
flower-shop/
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── store/ # Zustand stores
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ └── ...
│
└── backend/
├── src/
│ ├── models/ # MongoDB models
│ ├── routes/ # API routes
│ ├── middleware/ # Express middleware
│ └── seeds/ # Database seeders
└── ...
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current userPUT /api/auth/update-profile- Update profilePUT /api/auth/change-password- Change password
GET /api/products- Get all productsGET /api/products/featured- Get featured productsGET /api/products/:slug- Get product by slugPOST /api/products- Create product (Admin)PUT /api/products/:id- Update product (Admin)DELETE /api/products/:id- Delete product (Admin)
GET /api/categories- Get all categoriesGET /api/categories/:slug- Get category with productsPOST /api/categories- Create category (Admin)PUT /api/categories/:id- Update category (Admin)DELETE /api/categories/:id- Delete category (Admin)
GET /api/orders- Get user ordersGET /api/orders/:id- Get order detailsPOST /api/orders- Create orderPUT /api/orders/:id/status- Update order status (Admin)PUT /api/orders/:id/cancel- Cancel order
GET /api/reviews- Get all reviewsGET /api/reviews/product/:productId- Get product reviewsPOST /api/reviews- Create reviewPUT /api/reviews/:id- Update reviewDELETE /api/reviews/:id- Delete review
MIT