A modern, feature-rich product management dashboard built with the latest web technologies. Manage your products, track inventory, and process orders with a beautiful, responsive interface.
- ๐ Secure Authentication - JWT-based login with persistent sessions
- โพ๏ธ Infinite Scrolling - Smooth, seamless product browsing experience
- ๐จ Beautiful UI - Dark/Light mode with smooth Framer Motion animations
- ๐ Smart Filtering - Search, category, and price range filters that work together
- โ๏ธ Full CRUD - Create, read, update products with form validation
- ๐ Shopping Cart - Add items, adjust quantities, checkout with simulation
- ๐ฑ Fully Responsive - Works perfectly on desktop, tablet, and mobile
- โก Type-Safe - End-to-end TypeScript with oRPC for API safety
- Node.js 18+ installed
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/erzer12/Product-daskboard-.git cd Product-daskboard- -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
Use these test credentials to log in:
- Username:
emilys - Password:
emilyspass
๐ก Note: We use DummyJSON's authentication API for demo purposes. In production, you'd replace this with your own auth system.
- Browse Products - Scroll through the product catalog with infinite loading
- Search & Filter - Use the search bar, category dropdown, or price range to find what you need
- View Details - Click any product to see full information
- Add to Cart - Select quantity and add items to your cart
- Checkout - Review your cart and complete the simulated checkout process
- Add Products - Click "Add Product" to create new listings with title, price, description, and category
- Edit Products - Click "Edit Product" on any product detail page to update information
- Manage Inventory - View stock levels and product ratings
src/
โโโ app/ # Next.js 14 App Router
โ โโโ (auth)/ # Authentication pages (login)
โ โโโ (dashboard)/ # Protected dashboard pages
โ โ โโโ products/ # Product listing & management
โ โ โ โโโ [id]/ # Product detail & edit
โ โ โ โโโ add/ # Create new product
โ โ โโโ cart/ # Shopping cart & checkout
โ โโโ api/orpc/ # API route handlers
โโโ components/ # Reusable UI components
โ โโโ ui/ # Shadcn UI primitives
โ โโโ features/ # Feature-specific components
โโโ lib/ # Utility functions
โโโ server/ # Backend logic
โ โโโ routers/ # oRPC API endpoints
โ โโโ schemas/ # Zod validation schemas
โโโ store/ # Zustand state management
โโโ use-auth-store.ts # Authentication state
โโโ use-cart-store.ts # Shopping cart state
โโโ use-filter-store.ts # Product filters state
- Next.js 14 - React framework with App Router for modern web apps
- TypeScript - Type safety throughout the codebase
- Tailwind CSS v4 - Utility-first styling with custom color palette
- Shadcn UI - Beautiful, accessible component library
- Framer Motion - Smooth animations and transitions
- TanStack Query - Server state caching, refetching, and synchronization
- Zustand - Simple, fast client state (auth, cart, filters)
- oRPC - Type-safe RPC framework (like tRPC but more flexible)
- Zod - Runtime validation for forms and API inputs
- DummyJSON - Mock API for product data (can be replaced with real backend)
- React Hook Form - Performant form handling
- Zod - Schema validation for forms and API
Products load 12 at a time as you scroll. An intersection observer detects when you reach the bottom and automatically fetches more. No more pagination buttons!
All filters work together seamlessly:
- Search - Searches across product titles and descriptions
- Category - Filter by product category (fetched from API)
- Price Range - Set minimum and maximum price limits
- Clear Filters - Reset everything with one click
- Add items with custom quantities
- Update quantities with +/- buttons
- Remove items easily
- Auto-calculates totals
- Persists to localStorage (survives page refresh)
- Beautiful checkout flow with progress animation
- Secure JWT token storage
- Automatic token injection in API requests
- Protected routes redirect to login
- Session persists across page refreshes
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linting
npm run lint
# Type checking
npx tsc --noEmitThis codebase follows clean code principles:
- Descriptive Names - Variables and functions clearly state their purpose
- Single Responsibility - Each component/function does one thing well
- Comments - Complex logic explained with helpful comments
- Type Safety - TypeScript everywhere, no 'any' types
- Separation of Concerns - UI, business logic, and API calls are separated
Routes are protected at two levels:
- Client-side - Dashboard layout checks for auth token and redirects
- Server-side - Middleware checks authentication (additional layer)
- API-level - Protected procedures validate JWT tokens
- โ TypeScript strict mode enabled
- โ ESLint for code quality
- โ Component composition over prop drilling
- โ Custom hooks for reusable logic
- โ Error boundaries for graceful failures
- โ Loading and empty states everywhere
- โ Responsive design mobile-first
- โ Accessible UI components (ARIA labels, keyboard navigation)
Solution: Make sure you're logged in. The create/edit/delete operations require authentication.
Solution: Check if npm run dev is running and DummyJSON API is accessible.
Solution: Check if localStorage is enabled in your browser. Private/Incognito mode may not persist cart data.
Solution: Delete .next folder and node_modules, then run npm install and npm run build again.
- Real-time product updates with WebSockets
- Image upload for products
- Order history page
- User profile management
- Product reviews and ratings
- Advanced analytics dashboard
- Export data to CSV/PDF
- Multi-language support
This project is open source and available under the MIT License.
- DummyJSON for the mock API
- Shadcn for the beautiful component library
- Vercel for Next.js and hosting
- The open source community for amazing tools and libraries
If you encounter any problems or have questions:
- Check the troubleshooting section above
- Search existing GitHub issues
- Open a new issue with details about your problem
Built with โค๏ธ using Next.js, TypeScript, and modern web technologies