Skip to content

A sleek React.js app with JWT authentication using DummyJSON credentials. Features include responsive product listing, search, and sorting functionality.

Notifications You must be signed in to change notification settings

SyedFaisal30/ProdView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ ProdView – React Product Viewer

A sleek React.js application that allows users to log in using DummyJSON credentials and view a responsive list of products with search, sorting, and secure JWT authentication. It’s built with modern React practices, Tailwind CSS, and toast notifications for a clean UI/UX.


πŸ“Έ Preview

πŸ” Login ➝ View Products ➝ Auto Logout on Token Expiry

πŸš€ Live Demo

πŸ”— https://prodview.vercel.app (replace with your deployment URL)


βš™οΈ Tech Stack

  • βš›οΈ React 18+
  • πŸ’¨ Tailwind CSS
  • πŸ” React Router
  • πŸ” JWT Authentication
  • πŸ”” React Toastify
  • πŸ”— Axios
  • ⚑ Vite
  • πŸ—‚οΈ Context API

πŸ”‘ Features

βœ… Authentication

  • Login with DummyJSON test credentials
  • JWT token stored securely in localStorage
  • Auto logout on token expiry
  • Session checked every minute
  • Toast notifications for login/logout/session

πŸ›οΈ Product Listing

  • Fetch products from DummyJSON API
  • Display name, image, price & rating
  • Loading state while fetching
  • Fully responsive grid layout

πŸ” Search & Sorting (Optional)

  • Search by product title
  • Sort by price, rating, or name (if implemented)

πŸ§ͺ Dummy Login Credentials

{
  "username": "kminchelle",
  "password": "0lelplR"
}

πŸ› οΈ Getting Started 1️⃣ Clone the Repository

git clone https://github.com/your-username/prodview.git

cd prodview 2️⃣ Install Dependencies npm install

3️⃣ Create .env File VITE_API=https://dummyjson.com You can also create .env.example for sharing in GitHub.

4️⃣ Start the Dev Server npm run dev Navigate to http://localhost:5173

🧠 How It Works On login, token is stored in localStorage

Every 60 seconds, we check if token is expired

If expired β†’ auto logout + toast + redirect to /

All routes are protected using AuthContext

🌐 APIs Used πŸ”— Login API - POST: https://dummyjson.com/auth/login πŸ”— Products API - GET: https://dummyjson.com/products

πŸ“Έ Screenshots (Optional) Login Page Product Listing

πŸ“„ License This project is licensed under the MIT License.

πŸ™‹β€β™‚οΈ Author Made with ❀️ by Syed Faisal Abdul Rahman Zulfequar

About

A sleek React.js app with JWT authentication using DummyJSON credentials. Features include responsive product listing, search, and sorting functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published