This repository contains a comprehensive React.js Product Management System designed to help developers master modern frontend development, React.js framework, API integration, and full-stack web application architecture. The project features a complete product management system with authentication, CRUD operations, responsive design, and modern web development practices. It serves as a complete learning platform for understanding React.js development from basics to advanced concepts.
- Node.js (version 14 or higher) and npm installed on your system
- A modern web browser (Chrome, Firefox, Edge, Safari, etc.)
- (Optional) A code editor like VS Code, Sublime Text, or Atom for easier code navigation
- Basic understanding of JavaScript, HTML, CSS, and web development concepts
- Knowledge of React.js fundamentals (components, hooks, state management)
-
Clone the repository (if not already downloaded):
git clone <repository-url> cd ShoeFit_client
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Start the application:
npm start
This will start the development server with hot reloading at http://localhost:3000.
-
Build for production:
npm run build
-
Run tests:
npm test
-
Build the application:
npm run build
-
Serve the production build:
npx serve -s build
Note: The application uses React Scripts for development, which automatically starts the development server with hot reloading when you make changes to the source code.
ShoeFit_client/
├── public/
├── src/
│ ├── assets/
│ │ ├── css/
│ │ ├── images/
│ │ ├── js/
│ │ └── scss/
│ ├── components/
│ │ ├── auths/
│ │ ├── partials/
│ │ ├── products/
│ ├── pages/
│ ├── App.js
│ └── index.js
├── package-lock.json
├── package.json
└── README.md
- public/: Static assets served directly to the browser
index.html: Main HTML templatefavicon.ico: Website faviconlogo192.png&logo512.png: Application logosmanifest.json: Web app manifest for PWA featuresrobots.txt: Search engine crawling instructions
- src/assets/: Static front-end assets (CSS, images, JS, SCSS)
- src/components/: React components organized by feature
auths/Login.jsx: Authentication component with form handlingproducts/ProductList.jsx: Product listing component with grid layoutproducts/Detail.jsx: Product detail view componentproducts/NewProduct.jsx: Product creation form componentproducts/PopularProduct.jsx: Popular products sectionproducts/Hero.jsx: Hero banner sectionpartials/Header.jsxandpartials/Footer.jsx: Layout componentsrenders/AIRender.jsx: AI render showcase
- src/pages/: Page-level components for routing
- src/App.js: Main application component with routing and state management
- src/index.js: Application entry point and React rendering
- React.js Framework: Modern JavaScript library for building user interfaces
- Component-Based Architecture: Reusable UI components with props and state
- React Router: Client-side routing for single-page application
- Authentication System: Login functionality (token-based auth ready)
- API Integration: RESTful API calls using Axios and Fetch API
- CRUD Operations: Create, Read, Update, Delete workflows
- Responsive Design: Bootstrap integration for mobile-friendly UI
- State Management: React hooks for local state management
- Local Storage: Persistent authentication state
- Modern JavaScript: ES6+ features and async/await patterns
- Hot Reloading: Automatic browser refresh during development
- Form Handling: Controlled components with validation
- Error Handling: Try-catch blocks and error states
- Loading States: Conditional rendering based on data availability
This module covers the core React.js concepts:
- Component Structure: Functional components with hooks
- State Management: useState hook for local state
- Effect Management: useEffect hook for side effects
- Routing: React Router setup and navigation
- Authentication Flow: Token-based login/logout system
- Local Storage: Browser storage for persistent data
This module demonstrates component-based development:
- Form Handling: Controlled input components
- API Integration: Axios for authentication requests
- Error Handling: User feedback for login failures
- Navigation: Programmatic routing with React Router v6
- Token Management: JWT token storage and retrieval
- Product Listing (
products/ProductList.jsx): Grid layout with product cards - Product Detail (
products/Detail.jsx): Individual product information - Product Creation (
products/NewProduct.jsx): Add new products form - Popular Products (
products/PopularProduct.jsx): Featured products section
This module covers external API communication:
- RESTful APIs: Integration pattern compatible with DummyJSON API
- HTTP Methods: GET, POST, PUT, DELETE requests
- Authentication Headers: Bearer token implementation
- Error Handling: Network error management
- Data Transformation: API response processing
This module covers React Router implementation:
- Route Configuration: Path-based component rendering
- Dynamic Routes: URL parameters for product IDs
- Navigation: Link components and programmatic routing
- Route Protection: Authentication-based access control
- Nested Routes: Complex routing structures
This module covers React state patterns:
- Local State: useState hook for component state
- Effect Dependencies: useEffect cleanup and dependencies
- State Updates: Immutable state updates
- Conditional Rendering: State-based UI changes
- Data Fetching: API calls with loading states
This module covers client-side development:
- Bootstrap Integration: Responsive design framework
- CSS Styling: Global and component styling
- Responsive Layout: Mobile-first design approach
- Component Styling: Card layouts and grid systems
- User Experience: Loading states and error messages
- React.js 18.2.0
- React Router DOM 6.13.0
- Axios 1.6.7
- Bootstrap 5.3.3
- React Bootstrap 2.10.2
- React Scripts 5.0.1
- Testing Library (Jest + React Testing Library)
- Web Vitals 2.1.4
- JSON Server 0.17.3
- Start Development Server: Run
npm startfor hot reloading - API Integration: Use DummyJSON API or a custom backend for product data
- Authentication: Test login with provided credentials
- Code Changes: Files automatically reload when modified
- Build Assets: Compile and optimize for production
- Environment Setup: Configure production API endpoints
- Deployment: Deploy to hosting platform (Netlify, Vercel, etc.)
- Monitoring: Set up analytics and error tracking
- Start with
src/App.jsto understand React component structure - Explore
src/components/to learn component patterns - Study authentication flow in
auths/Login.jsx
- Implement CRUD operations in product components
- Add form validation and error handling
- Create custom hooks for reusable logic
- Add state management with Context API or Redux
- Implement advanced routing with guards
- Add testing and deployment configurations
- Optimize performance with React.memo and useMemo
- Component Composition: Reusable and maintainable components
- Hook Usage: Proper useState and useEffect implementation
- Error Handling: Comprehensive error catching and user feedback
- Security: Input validation and secure authentication
- Performance: Efficient re-rendering and data fetching
- Code Organization: Consistent naming conventions and structure
- Documentation: Clear code comments and README
- Version Control: Proper Git workflow and commit messages
POST https://dummyjson.com/auth/login- User authenticationGET https://dummyjson.com/user- Get user profile (with token)
GET https://dummyjson.com/products- List all productsGET https://dummyjson.com/products/:id- Get product detailsPOST https://dummyjson.com/products/add- Create new productPUT https://dummyjson.com/products/:id- Update productDELETE https://dummyjson.com/products/:id- Delete product
/- Login page (default route)/product- Product listing page (requires authentication)
/product/:id- Product detail page/product/:id/update- Product edit page/product/add- Product creation page
-
Login Process:
- User enters credentials on login page
- System validates with DummyJSON API
- JWT token stored in localStorage
- User redirected to product listing
-
Session Management:
- Token checked on app initialization
- Automatic redirect if token exists
- Logout clears localStorage and redirects
-
Route Protection:
- Authentication state managed in App component
- Conditional rendering based on login status
- Programmatic navigation for authenticated users
- API Connection: Ensure internet connection for DummyJSON API
- Port Conflicts: Change port in package.json if 3000 is busy
- Dependencies: Run
npm installif modules are missing - Build Issues: Clear node_modules and reinstall dependencies
- Authentication: Check browser console for token storage issues
- Routing: Ensure React Router is properly configured
- Console Errors: Check terminal and browser console for error messages
This is a learning project designed for educational purposes. Feel free to:
- Modify examples to experiment with different approaches
- Add new features and functionality
- Improve documentation and comments
- Share your learning experiences
- Report bugs and suggest improvements
- React.js Documentation
- React Router Documentation
- Bootstrap Documentation
- Axios Documentation
- Create React App Documentation
- React Testing Library
- DummyJSON API Documentation
For questions or contributions, please open an issue or pull request on the GitHub repository.
This project is licensed under the ISC License - see the LICENSE file for details.