A premium tech e-commerce platform built with the MERN stack (MongoDB, Express, React, Node.js), featuring a responsive design and comprehensive shopping experience.
- Frontend: https://peakhive.vercel.app/
- Backend API: https://peakhive-backend.vercel.app/
- Features
- Project Structure
- Pages
- Components
- Getting Started
- Environment Variables
- Deployment
- Development Progress
- Technology Stack
- API Endpoints
- Future Enhancements
- Contributing
- Responsive Design: Works seamlessly on mobile, tablet, and desktop devices
- Consistent UI: Built with Bootstrap components for a cohesive user experience
- Interactive Elements: Dynamic hover effects and transitions
- Comprehensive E-commerce Flow: From product browsing to checkout
- User Authentication: Login and signup functionality with JWT
- User Profiles: Account management and order history
- Cart System: Add, remove, and update product quantities
- Admin Dashboard: Manage products, orders, and users
- Payment Processing: Secure checkout process
- Order Management: Track order status and history
- Product Reviews: Leave and view product reviews
PeakHive/
βββ public/ # Static assets
βββ src/ # Frontend application code
β βββ api/ # API service layer
β βββ assets/ # Application-specific assets
β βββ components/ # Reusable UI components
β βββ pages/ # Route-specific page components
β β βββ admin/ # Admin dashboard pages
β βββ redux/ # State management
β β βββ slices/ # Redux slices
β βββ utils/ # Utility functions
β βββ App.jsx # Main application component and routing
β βββ main.jsx # Application entry point
βββ server/ # Backend application code
β βββ controllers/ # API route controllers
β βββ middleware/ # Express middleware
β βββ models/ # MongoDB models
β βββ routes/ # API route definitions
β βββ utils/ # Utility functions
β βββ server.js # Server entry point
β βββ vercel.json # Vercel deployment configuration
βββ .env # Frontend environment variables
βββ server/.env # Backend environment variables
βββ package.json # Project dependencies and scripts
| Page | Description |
|---|---|
| Home | Landing page with hero section, featured categories, and promotional content |
| Products | Product listing with filtering and sorting options |
| Product Detail | Comprehensive product information, images, specs, and reviews |
| Login/Register | User authentication with form validation |
| Cart | Shopping cart with product listings, quantity adjustment, and price calculations |
| Checkout | Order completion with shipping and payment information |
| Profile | User account management and order history |
| Order History | List of past orders with status and details |
| Order Details | Detailed view of a specific order |
| Admin Dashboard | Overview of store performance metrics |
| Admin Products | Manage product listings (add, edit, delete) |
| Admin Orders | Process and manage customer orders |
| Admin Users | Manage user accounts and permissions |
| Admin Reviews | Moderate product reviews |
- Node.js (v14.0.0 or later)
- npm or yarn
- MongoDB account or local installation
-
Clone the repository
git clone https://github.com/chaman2003/PeakHive.git cd PeakHive -
Install frontend dependencies
npm install # or yarn install -
Install backend dependencies
cd server npm install # or yarn install
-
Set up environment variables (see Environment Variables section)
-
Start the backend development server
cd server npm run dev # or yarn dev
-
Start the frontend development server (in a new terminal)
# From the root directory npm run dev # or yarn dev
-
Open your browser and navigate to
http://localhost:5173
VITE_API_URL=http://localhost:5000/api # Development
# VITE_API_URL=https://peakhive-backend.vercel.app/api # Production
VITE_NODE_ENV=development # or production
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
NODE_ENV=development # or production
PORT=5000
The application is deployed on Vercel with separate projects for frontend and backend.
- Push your code to GitHub
- Create a new project in Vercel
- Connect your GitHub repository
- Set the following settings:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install
- Add environment variables:
VITE_API_URL=https://peakhive-backend.vercel.app/apiVITE_NODE_ENV=production
- Deploy
- Create a new project in Vercel
- Connect your GitHub repository
- Set the following settings:
- Root Directory:
server - Build Command:
npm install - Output Directory:
.
- Root Directory:
- Add environment variables:
MONGO_URI=your_mongodb_connection_stringJWT_SECRET=your_jwt_secretNODE_ENV=production
- Deploy
The frontend and backend are connected through API calls. The frontend's .env file or Vercel environment variables should have the VITE_API_URL pointing to the deployed backend API URL.
- Framework: React 18
- State Management: Redux Toolkit
- UI Framework: Bootstrap 5
- Routing: React Router v6
- HTTP Client: Axios
- Build Tool: Vite
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- File Upload: Multer
- Validation: Express Validator
- Platform: Vercel
- Database Hosting: MongoDB Atlas
- Environment: Node.js (Serverless)
POST /api/users/login- User loginPOST /api/users/register- User registrationGET /api/users/profile- Get user profilePUT /api/users/profile- Update user profile
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create a product (admin)PUT /api/products/:id- Update a product (admin)DELETE /api/products/:id- Delete a product (admin)
GET /api/orders- Get user ordersGET /api/orders/:id- Get order by IDPOST /api/orders- Create new orderPUT /api/orders/:id/pay- Update order to paidPUT /api/orders/:id/deliver- Update order to deliveredGET /api/orders/admin- Get all orders (admin)PUT /api/orders/:id/refund- Refund an order (admin)
GET /api/reviews- Get all reviewsPOST /api/products/:id/reviews- Create product reviewDELETE /api/reviews/:id- Delete review (admin)
GET /api/users- Get all users (admin)GET /api/users/:id- Get user by ID (admin)PUT /api/users/:id- Update user (admin)DELETE /api/users/:id- Delete user (admin)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Built with β€οΈ by Chammy :p