Here is a working live demo: E-Commerce Demo
- 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.
- Frontend: React.js
- Backend: Node.js
- Database: MongoDB
- Payment Gateway: PayPal Sandbox
- Security: Token encryption
-
Clone the repository:
git clone https://github.com/balaji305/e-commerce-app.git cd e-commerce-app
-
Install dependencies:
npm install
-
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
-
Start the server:
npm start
-
Clone the repository:
git clone https://github.com/balaji305/e-commerce-app.git cd e-commerce-app/frontend
-
Install dependencies:
npm install
-
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
-
Start the development server:
npm start
-
Frontend:
- Access the frontend at
http://localhost:3000
. - Browse product listings, manage your cart, and proceed to checkout.
- Access the frontend at
-
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.
- The API is accessible at
-
PayPal Integration:
- Test payment functionality using the PayPal Sandbox environment.
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.
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.
Run npm test
to execute the unit tests via Jest.
Run npm test
to execute the unit tests via Mocha.
For more help on the project, feel free to reach out to [email protected].