Skip to content

FadyFathey/FULL-MEARN-STACK-REACT-PROJECT

Repository files navigation

E-Commerce Application (MERN Stack)

This is a comprehensive e-commerce application built with the MERN stack (MongoDB, Express, React, Node.js). It consists of a frontend developed with React and a backend built with Node.js and Express.

Demo

Check out the live demo: https://cleverxpress.web.app/

Features

Frontend

  • Authentication & Authorization: Secure user login and registration with JWT.
  • Product Management: View, search, filter, and sort products.
  • Shopping Cart: Add, remove, and manage products in the shopping cart.
  • Order Management: Place orders, choose payment methods, and manage order history.
  • Admin Dashboard: Manage products, categories, brands, and orders.
  • User Profile: Manage user profile, addresses, and order history.
  • Responsive Design: Optimized for both desktop and mobile devices.
  • Multilingual Support: Integration with Google Translator for multiple languages.

Backend

  • Authentication & Authorization: Secure user authentication using JWT.
  • Product Management: CRUD operations for products.
  • Category & Brand Management: CRUD operations for categories and brands.
  • Order Management: Manage customer orders and payment processing.
  • User Management: User profile management and address book.
  • Cart Management: Add, remove, and manage items in the cart.
  • Wishlist Management: Add, remove, and manage wishlist items.
  • Review Management: Add, edit, and delete product reviews.
  • Coupon Management: Create and apply discount coupons.

Technologies Used

Frontend

  • React: Library for building user interfaces.
  • Redux Toolkit: State management.
  • React Router: Client-side routing.
  • Bootstrap: Responsive design framework.
  • Axios: Promise-based HTTP client.
  • React Toastify: Notification system.
  • React Paginate: Pagination component.
  • Firebase: For various backend services and tools.

Backend

  • Node.js: JavaScript runtime for server-side development.
  • Express: Web framework for Node.js.
  • MongoDB: NoSQL database for data storage.
  • Mongoose: ODM library for MongoDB.
  • JWT: JSON Web Tokens for secure authentication.
  • Bcrypt: Library for hashing passwords.
  • Nodemailer: Library for sending emails.

Project Structure

Frontend

  • src/App.js: Main application file where routes are defined.
  • src/RTK/store.js: Redux store configuration.
  • src/index.js: Main entry point of the React application.

Backend

  • config: Configuration files for the application.
  • controllers: Contains the logic for handling various routes.
  • middlewares: Custom middleware functions.
  • models: Mongoose models for MongoDB.
  • routes: Express routes for different API endpoints.
  • utils: Utility functions and helpers.

Installation

Frontend

  1. Clone the repository:
    git clone https://github.com/FadyFathey/frontend-repo.git
  2. Navigate to the project directory:
    cd frontend-repo/e-commerce-app
  3. Install dependencies:
    npm install
  4. Start the development server:
    npm start

The application will start on http://localhost:3000.

Backend

  1. Clone the repository:
    git clone https://github.com/FadyFathey/FULL-MEARN-STACK-REACT-PROJECT.git
  2. Navigate to the project directory:
    cd FULL-MEARN-STACK-REACT-PROJECT
  3. Install dependencies:
    npm install
  4. Create a .env file and add your environment variables:
    
    NODE_ENV=development
    PORT=5000
    MONGO_URI=your_mongodb_uri
    JWT_SECRET=your_jwt_secret
                
  5. Start the server:
    npm run dev

The server will start on http://localhost:5000.

Available Scripts

Frontend

  • npm start: Runs the app in development mode.
  • npm test: Launches the test runner.
  • npm run build: Builds the app for production.
  • npm run eject: Ejects the app configuration.

Backend

  • npm start: Runs the server in production mode.
  • npm run dev: Runs the server in development mode with nodemon.
  • npm test: Runs the test suite.

API Endpoints (Backend)

Authentication

  • POST /api/v1/auth/register: Register a new user.
  • POST /api/v1/auth/login: Login a user.
  • POST /api/v1/auth/forgotpassword: Send password reset link.
  • PUT /api/v1/auth/resetpassword/:resettoken: Reset password.

Users

  • GET /api/v1/users: Get all users.
  • GET /api/v1/users/:id: Get user by ID.
  • PUT /api/v1/users/:id: Update user.
  • DELETE /api/v1/users/:id: Delete user.

Products

  • GET /api/v1/products: Get all products.
  • GET /api/v1/products/:id: Get product by ID.
  • POST /api/v1/products: Create a new product.
  • PUT /api/v1/products/:id: Update product.
  • DELETE /api/v1/products/:id: Delete product.

Orders

  • GET /api/v1/orders: Get all orders.
  • GET /api/v1/orders/:id: Get order by ID.
  • POST /api/v1/orders: Create a new order.
  • PUT /api/v1/orders/:id: Update order.
  • DELETE /api/v1/orders/:id: Delete order.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you would like to contribute to the project.

License

This project is licensed under the MIT License.

Releases

No releases published

Packages

No packages published