{"id":26575576,"url":"https://github.com/anusree6154s/ebazar-render","last_synced_at":"2026-04-07T16:31:54.083Z","repository":{"id":265510904,"uuid":"889335677","full_name":"Anusree6154s/ebazar-render","owner":"Anusree6154s","description":"Ebazar - MERN Stack Ecommerce Website. Deployed in render","archived":false,"fork":false,"pushed_at":"2025-01-30T12:19:56.000Z","size":6301,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T02:13:06.904Z","etag":null,"topics":["expressjs","jest","joi","mernstack","mongodb","mongoose","node","nodemail","passportjs","react","reactrouter","redux-toolkit","stripe"],"latest_commit_sha":null,"homepage":"https://ebazar-a2pa.onrender.com/home","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anusree6154s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T05:23:47.000Z","updated_at":"2025-02-13T16:34:52.000Z","dependencies_parsed_at":"2025-03-23T02:13:08.247Z","dependency_job_id":"e3c4b2a7-463d-4855-9577-902847ece0d6","html_url":"https://github.com/Anusree6154s/ebazar-render","commit_stats":null,"previous_names":["anusree6154s/ebazar","anusree6154s/ebazar-render"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anusree6154s/ebazar-render","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anusree6154s%2Febazar-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anusree6154s%2Febazar-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anusree6154s%2Febazar-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anusree6154s%2Febazar-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anusree6154s","download_url":"https://codeload.github.com/Anusree6154s/ebazar-render/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anusree6154s%2Febazar-render/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278804691,"owners_count":26048962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","jest","joi","mernstack","mongodb","mongoose","node","nodemail","passportjs","react","reactrouter","redux-toolkit","stripe"],"created_at":"2025-03-23T02:13:10.800Z","updated_at":"2025-10-07T16:14:25.948Z","avatar_url":"https://github.com/Anusree6154s.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n  \u003cimg src=\"https://github.com/user-attachments/assets/ca432d2d-09a0-40f8-a043-bdbbae85b4c6\" width=\"150\"/\u003e\r\n    \u003ch1 id=\"title\"\u003eEBazar\u003c/h1\u003e\r\n    \u003cp\u003e\u003cstrong\u003e A Fullstack E-commerce Application\u003c/strong\u003e\u003c/p\u003e\r\n    \u003cp\u003e\r\n      \u003ca href=\"https://ebazar-a2pa.onrender.com\"\u003eView Website\u003c/a\u003e •\r\n      \u003ca href=\"https://documenter.getpostman.com/view/33572999/2sAY547K4U\"\u003eView API Documentation\u003c/a\u003e\r\n    \u003c/p\u003e\r\n    \u003cimg src=\"https://github.com/user-attachments/assets/b1351b33-b68d-457f-b7c8-bc020adfba2d\" width=\"700\"/\u003e\r\n\u003c/div\u003e\r\n\r\n## Table of Contents\r\n\r\n\r\n1. [Project Overview](#project-overview)\r\n2. [Tech Stack](#tech-stack)\r\n3. [Features Overview](#features-overview)\r\n4. [Getting Started](#getting-started)\r\n5. [Technical Architecture](#technical-architecture)\r\n   1. [Components](#components)\r\n   2. [Design Pattern](#design-pattern)\r\n   3. [Deployment Architecture](#deployment-architecture)\r\n   4. [Security](#security)\r\n6. [Features in Detail](#features-in-detail)\r\n7. [Potential Improvements](#potential-improvements)\r\n\r\n## Project Overview\r\n\r\n\u003cp id=\"description\"\u003eEBazar is a full-stack E-commerce application built with the MERN stack, offering a complete online shopping experience. Users can browse products, securely purchase items, and manage their orders and account details, while admins can track orders and manage inventory effectively.\u003c/p\u003e\r\n\r\n## Tech Stack\r\n\r\n- ### Frontend\r\n\r\n  - **React**\r\n  - **React Router**\r\n  - **Redux**\r\n  - **Material UI**\r\n  - **Tailwind CSS**\r\n\r\n- ### Backend\r\n\r\n  - **Node.js**\r\n  - **Express.js**\r\n  - **MongoDB \u0026 Mongoose**\r\n  - **Passport.js**\r\n  - **Stripe**\r\n  - **Jest**\r\n  - **Joi**\r\n  - **Nodemailer**\r\n\r\n## Features Overview\r\n\r\n- Authentication\r\n  - User and Admin registration and authentication with JWT tokens.\r\n  - Secure API endpoints with Passport-based token-based authentication.\r\n  - OTP based Password recovery via email\r\n- User Features\r\n  - Product Management - View products, add to wishlist, add to cart.\r\n  - Cart Management - Update or remove cart items\r\n  - Checkout \u0026 Payments - Proceed to checkout, add/update address, process payments using Stripe.\r\n  - Order Management - View orders and order history.\r\n- Admin Features\r\n  - Product Management - Add, update, delete, and view products.\r\n  - Order Management: Manage user orders.\r\n- API Routes and Documentation\r\n  - Created RESTful API routes and documented them in Postman \r\n\r\n\r\n## Getting Started\r\n\r\n### 1. Setup and Installation\r\n\r\n- **Clone the Repository**\r\n\r\n  ```bash\r\n  git clone https://github.com/Anusree6154s/ebazar.git\r\n  cd ebazar\r\n  ```\r\n\r\n- **Set Up Environment Variables**\r\n\r\n  - Create a `.env` file in the root directory and add the following variables:\r\n\r\n    ```bash\r\n    MONGODB_URL=your_mongodb_uri  # MongoDB connection URI\r\n    MONGODB_URL_TEST=your_test_mongodb_uri  # MongoDB URI for testing\r\n\r\n    JWT_SECRET_KEY=your_jwt_secret_key  # Secret key for JWT authentication\r\n    SESSION_SECRET=your_session_secret  # Secret key for session management\r\n\r\n    SENDERS_GMAIL=your_sender_email@gmail.com  # Sender's Gmail address\r\n    SENDERS_GMAIL_APP_PASSWORD=your_app_password  # App-specific password for Gmail\r\n\r\n    STRIPE_SECRET_KEY=your_stripe_secret_key  # Stripe secret key for payment processing\r\n\r\n    PORT=your_desired_backend_port  # Example: 8080\r\n\r\n    ```\r\n\r\n- **Install Dependencies**\r\n\r\n  ```bash\r\n  cd server\r\n  npm install\r\n  ```\r\n\r\n### 2. Usage\r\n\r\nFollow the bellow commands to run the app\r\n\r\n```bash\r\nnpm build #(optional - only if you make chanegs to the client)\r\nnpm start\r\n```\r\n\r\nThis will start both the **backend** and **frontend**:\r\n\r\n- **Frontend**: `http://localhost:8080`\r\n- **Backend**: `http://localhost:8080/api` (or your specified port)\r\n\r\nNow both servers should be running and accessible on their respective URLs.\r\n\r\n### 3. Testing\r\n\r\nTo test the backend, run:\r\n\r\n```bash\r\nnpm test\r\n```\r\n\r\n## Technical Architecture\r\n\r\n### Components\r\n\r\n- **Frontend**\r\n\r\n  - **React**: Provides a component-based architecture for building efficient, dynamic user interfaces.\r\n  - **React Router DOM**: Enables client-side routing, improving the navigation experience without page reloads.\r\n  - **Redux**: Manages global state across the app, ensuring consistency and simplifying data flow.\r\n  - **Material UI (MUI)**: Offers pre-built, customizable components for fast development and responsive design.\r\n  - **Tailwind CSS**: A utility-first CSS framework that allows flexible and custom designs with minimal effort.\r\n  - **Stripe**: A trusted, secure payment gateway for processing transactions smoothly and safely.\r\n\r\n- **Backend**\r\n\r\n  - **Node.js**: A fast, non-blocking runtime that supports high concurrency and scalability for handling numerous requests.\r\n  - **Express.js**: A lightweight framework for building RESTful APIs quickly and efficiently.\r\n  - **MongoDB**: A flexible NoSQL database, ideal for handling unstructured data and scaling with ease.\r\n  - **Mongoose**: An ODM that simplifies data interaction and validation with MongoDB.\r\n  - **Passport.js**: Provides flexible, secure authentication mechanisms (e.g., JWT, OAuth) for managing user sessions.\r\n  - **Stripe**: Integrated for secure payment processing, offering reliability and ease of use.\r\n  - **Cookie-Parser**: Parses cookies for managing sessions and authentication securely.\r\n  - **Cors**: Handles cross-origin requests, enabling safe communication between the frontend and backend across different domains.\r\n  - **Joi**: A robust validation library for ensuring data integrity and security in incoming requests.\r\n  - **Nodemailer**: Facilitates reliable email communication (e.g., password resets) with easy integration.\r\n  - **Dotenv**: Safely manages environment variables to keep sensitive data secure.\r\n\r\n### Design Pattern\r\n\r\n- **Layered Architecture**: Clean separation of concerns in the backend (controllers, services, and data access).\r\n\r\n### Deployment Architecture\r\n\r\n- **Hosting**: Deployed on Render.\r\n- **Server**: Node.js server handles API requests and responses.\r\n\r\n### Security\r\n\r\n- **JWT Authentication**: Secure authentication using JSON Web Tokens.\r\n- **Passport.js**: Handles user authentication strategies.\r\n- **Password Hashing**: User passwords are securely hashed using bcrypt.\r\n\r\n## Features in Detail\r\n\r\n### Authentication\r\n\r\n- **Registration** – New users and admins can securely create an account on Ebazar using their email and password.\r\n- **Login** – Users and admins log in with their registered email and password for access to respective features.\r\n\r\n- **Password Reset** – If a user or admin forgets their password, they can reset it through OTP-based email verification. A 4-digit OTP is sent via Nodemailer and expires within 5 minutes. Once verified, the user can set a new password.\r\n\r\n- **Password Encryption** – Passwords are securely hashed using bcrypt, ensuring privacy and protection against unauthorized access.\r\n\r\n- **Authentication Security** – User authentication is managed with PassportJS and JWT tokens. Tokens are generated upon login, stored in cookies with \"SameSite\" settings to prevent cross-origin requests, and reduce CSRF risks.\r\n\r\n### User Features\r\n\r\n- **Product Management**\r\n\r\n  - **View Products and Details** – Users can explore a catalog displaying product names, prices, ratings, and images. Detailed information is accessible upon clicking a product.\r\n  - **Add to Wishlist** – Users can save products to a wishlist for easy access and future purchase.\r\n  - **Add to Cart** – Users can add products to their shopping cart.\r\n  - **Buy Now** – Users can instantly purchase a product without adding it to the cart.\r\n\r\n- **Cart Management**\r\n\r\n  - **Update Cart Items** – Users can adjust product quantities in the cart.\r\n  - **Remove Cart Items** – Users can delete items from the cart before purchase.\r\n\r\n- **Checkout \u0026 Payments**\r\n\r\n  - **Proceed to Checkout** – Users can review their order, including products, quantities, and total cost, before completing the purchase.\r\n  - **Add/Update Address** – Users can add a new shipping address or update an existing one for accurate delivery.\r\n  - **Process Payments using Stripe** – Payments are securely processed using Stripe's encrypted gateway. (Test version card details for this setup:\r\n    - **Card Number**: 4242 4242 4242 4242\r\n    - **Expiry Date**: Any future date\r\n    - **CVC**: 424\r\n    - **Country**: Any country)\r\n\r\n- **Order Management**\r\n  - **View Orders** – Users can access their past orders to track status and view details.\r\n\r\n### Admin Features\r\n\r\n- **Product Management**\r\n\r\n  - **Add Products** – Admins can add new products, including details like name, price, and description.\r\n  - **Update Products** – Admins can modify existing products, adjusting attributes like price, stock, or description.\r\n  - **Delete Products** – Admins can remove products from the catalog if they are discontinued or unavailable.\r\n\r\n- **Order Management**\r\n  - **Manage User Orders** – Admins can update order statuses (e.g., pending, shipped, delivered) to keep users informed.\r\n\r\n### API Documentation\r\n\r\n- **Postman API Documentation** – [Access API documentation on Postman](https://documenter.getpostman.com/view/33572999/2sAY547K4U) for detailed endpoint information, request formats, and response examples.\r\n\r\n## Potential Improvements\r\n\r\n- **Two-Factor Authentication (2FA):** Add SMS or email-based 2FA for both users and admins to enhance login security.\r\n- **Rate Limiting and Captchas:** Implement rate limiting and captchas to prevent brute-force attacks and bot abuse on login and signup endpoints.\r\n- **Lazy Loading and Caching:** Use lazy loading for images and API response caching to improve page load times and performance.\r\n- **Automated Testing:** Set up automated tests for front-end and back-end components to ensure application reliability and reduce bugs.\r\n\r\n\r\n\u003cp align=\"center\"\u003e \r\n \u003cimg width=\"0\" id=\"image\" src=\"https://github.com/user-attachments/assets/7558c916-e7df-4c9d-aa39-92d3e48f8f2d\" \u003e\r\n\u003c/p\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusree6154s%2Febazar-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanusree6154s%2Febazar-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusree6154s%2Febazar-render/lists"}