Ecommerce website MERN Project Overview
Project Overview
• Frontend: Built using React.
• Backend: Node.js + Express.
• Database: MongoDB.
• Styling: Tailwind CSS.
• Features:
o Homepage with categories like Latest Products, Best Sellers.
o Product filtering by category/type.
o Product sorting by price (low to high, high to low).
o Product search bar.
o Product detail page with image gallery and size selection.
o Add to Cart with quantity adjustments.
o Checkout with delivery info and payment method (Stripe, Razorpay, COD).
o My Orders page with order tracking.
o Admin panel to:
View & update orders
Add/list products
Track status updates
________________________________________
Setup Steps Recap
1. Create folder & initialize Vite React app
2. npm create vite@latest
3. Install dependencies
4. npm install
5. npm install react-router-dom react-toastify
6. Clean up starter files and setup basic component structure.
7. Install and configure Tailwind CSS using:
8. npm install -D tailwindcss postcss autoprefixer
9. npx tailwindcss init -p
10. Setup tailwind.config.js and include Tailwind in your CSS.
11. Add assets and dummy data (images and product objects).
12. Start frontend server
13. npm run dev
________________________________________
Frontend Features (React + Tailwind):
1. Home Page
o Latest collections
o Best sellers
o Policies section
o Email subscription form
o Footer with copyright
2. Collections Page
o Displays all products
o Sidebar filters by category and type
o Sorting (low to high, high to low)
o Search functionality
3. Product Details Page
o Product image gallery with zoom
o Title, price, reviews, description
o Size selection
o Add to cart
4. Cart Page
o Product list with quantity update and remove option
o Totals (subtotal + shipping)
o Checkout button
5. Checkout Page
o Delivery info form
o Payment options: Stripe, Razorpay, COD
o Order confirmation
6. My Orders Page
o List of user’s past orders
o Track order button and status updates
7. Authentication
o Login and Sign-up
o Redirect and validation
________________________________________
Admin Panel Features:
1. Login Page
2. Order Management
o View placed orders
o Update order status (e.g., Out for Delivery)
3. Product Management
o View existing products
o Add new product (with multiple images, category, price, sizes)
o Option to mark as Best Seller
________________________________________
Tech Stack & Tools Used:
• Frontend: React + Vite + Tailwind CSS
• Backend: Node.js + Express.js
• Database: MongoDB
• State Management: Likely Context API or Redux (TBD in tutorial)
• Routing: React Router
• Notifications: React Toastify
• Payments: Razorpay, Stripe (demo-based)
• Deployment: Will be covered in another tutorial if target engagement is met
________________________________________
Setup Steps Started:
• Created project folder (e-commerce-app)
• Initialized frontend(npx create-react-app frontend)
• Installed dependencies (react-router-dom, react-toastify)
• Cleaned up default React setup
• Integrated Assets and Assets.js (centralized image + product data)
• Preparing to set up Tailwind CSS
________________________________________
Sure! Here’s a step-by-step guide to begin the development process for the full stack e-commerce website as outlined in the tutorial:
### Step 1: Set Up Your Development Environment
1. **Create a Project Folder**:
- Create a new folder on your desktop or preferred location and name it `e-commerce-app`.
2. **Open the Folder in VS Code**:
- Right-click on the folder and select "Open with Code" to open it in Visual Studio Code.
3. **Open Integrated Terminal**:
- In VS Code, open the integrated terminal by selecting `Terminal` > `New Terminal`.
### Step 2: Create a React Project
1. **Create React App**:
- In the terminal, run the following command to create a new React project using Vite:
```bash
npx create-react-app frontend
```
- When prompted, provide the project name as `frontend`, select `React` as the framework, and choose `JavaScript`.
2. **Navigate to the Frontend Directory**:
```bash
cd frontend
```
3. **Install Dependencies**:
- Run the following command to install the necessary dependencies:
```bash
npm install
```
4. **Install Additional Packages**:
- Install React Router and React Toastify:
```bash
npm install react-router-dom react-toastify
```
### Step 3: Run the Project
1. **Start the Development Server**:
- Run the following command to start the development server:
```bash
npm start
```
- Open your web browser and navigate to `http://localhost:5173` to see the default React project running.
### Step 4: Clean Up the Default Project
1. **Remove Unnecessary Files**:
- In the `src` folder, delete the `App.css` file.
- Open `App.js` and clear all the code inside it.
2. **Install Snippet Extension**:
- If you want to use the `rafc` snippet, install the `ES7 React/Redux/GraphQL/React-Native snippets` extension from the VS Code marketplace.
3. **Update `index.html`**:
- Open `index.html` and change the title to your project name (e.g., "Forever").
### Step 5: Organize Assets
1. **Create an Assets Folder**:
- Create a new folder named `assets` inside the `src` directory.
- Copy all your project-related images and files into this `assets` folder.
2. **Create an `assets.js` File**:
- Create a new file named `assets.js` in the `src` folder to import and export your images.
### Step 6: Set Up Tailwind CSS
1. **Install Tailwind CSS**:
- Stop the development server (Ctrl + C) and run the following commands to install Tailwind CSS and PostCSS:
```bash
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```
2. **Configure Tailwind**:
- Open `tailwind.config.js` and set the content paths:
```javascript
module.exports = {
content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
```
3. **Add Tailwind Directives**:
- Open `index.css` and add the following lines:
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
4. **Start the Project Again**:
- Run the development server again:
```bash
npm start
```
### Step 7: Create Folder Structure
1. **Create Pages and Components Folders**:
- Inside the `src` folder, create two new folders: `pages` and `components`.
2. **Create Context Folder**:
- Create another folder named `context` for managing application state.
### Step 8: Create Page Components
1. **Create Page Files**:
- Inside the `pages` folder, create the following files:
- `Home.jsx`
- `Collection.jsx`
- `About.jsx`
- `Contact.jsx`
- `Product.jsx`
- `Cart.jsx`
- `Login.jsx`
- `PlaceOrder.jsx`
- `Orders.jsx`
2. **Add Basic Component Structure**:
- For each file, use the `rafc` snippet to create a functional component. For example, in `Home.jsx`:
```javascript
import React from 'react';
const Home = () => {
return
Home Page
;
};
export default Home;
Comments
Post a Comment