Skip to content

A full-stack E-Commerce application with a React.js frontend and Node.js backend. It features product listings, stock management, and occasional offers/discounts. The app ensures secure API calls with token encryption and integrates with PayPal Sandbox for payment processing.

Notifications You must be signed in to change notification settings

balaji305/e-commerce-app

Repository files navigation

E-Commerce Project

Language Frontend Backend

Demo

Here is a working live demo: E-Commerce Demo

About

  • This project is a full-stack E-Commerce application.
  • It features:
    • Product listings with details such as name, description, price, and stock availability.
    • Stock management for updating product quantities.
    • Occasional offers and discounts for a dynamic shopping experience.
    • Secure API calls with token encryption to prevent unauthorized access.
    • Integration with PayPal Sandbox for handling payments.

Tech Stack

  • Frontend: React.js
  • Backend: Node.js
  • Database: MongoDB
  • Payment Gateway: PayPal Sandbox
  • Security: Token encryption

Setup and Installation

Backend

  1. Clone the repository:

    git clone https://github.com/balaji305/e-commerce-app.git
    cd e-commerce-app
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with the following environment variables:

    PORT=5000
    MONGODB_URI=your-mongodb-uri
    PAYPAL_CLIENT_ID=your-paypal-client-id
    PAYPAL_CLIENT_SECRET=your-paypal-client-secret
    JWT_SECRET=your-jwt-secret
  4. Start the server:

    npm start

Frontend

  1. Clone the repository:

    git clone https://github.com/balaji305/e-commerce-app.git
    cd e-commerce-app/frontend
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with the following environment variables:

    REACT_APP_API_URL=http://localhost:5000
    PAYPAL_CLIENT_ID=your-paypal-client-id
  4. Start the development server:

    npm start

Usage

  1. Frontend:

    • Access the frontend at http://localhost:3000.
    • Browse product listings, manage your cart, and proceed to checkout.
  2. Backend:

    • The API is accessible at http://localhost:5000/api.
    • Endpoints include:
      • GET /api/products: Get a list of products.
      • GET /api/products/:id: Get product details by ID.
      • POST /api/cart: Add items to the cart.
      • POST /api/checkout: Handle checkout and payment.
  3. PayPal Integration:

    • Test payment functionality using the PayPal Sandbox environment.

Code Scaffolding

Run npm generate component component-name to generate a new component in the frontend. You can also use npm generate service|class|module for other types of scaffolding.

Build

Run npm run build to build the project. The build artifacts will be stored in the build/ directory for the frontend and dist/ directory for the backend.

Running Tests

Frontend

Run npm test to execute the unit tests via Jest.

Backend

Run npm test to execute the unit tests via Mocha.

Further Help

For more help on the project, feel free to reach out to [email protected].

About

A full-stack E-Commerce application with a React.js frontend and Node.js backend. It features product listings, stock management, and occasional offers/discounts. The app ensures secure API calls with token encryption and integrates with PayPal Sandbox for payment processing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published