A React application that provides a real-time GitHub user search experience with advanced optimization techniques, infinite scrolling, and state persistence. Built as an interview-level project to showcase mastery of React hooks, performance patterns, and API integration.
-
🔎 Real-Time Search – Search GitHub users instantly with debouncing to avoid excessive API calls.
-
📜 Infinite Scroll – Automatically loads more users as you scroll down.
-
💾 State Persistence – Last search query is stored in
localStorageand restored across reloads. -
⚡ Performance Optimizations – Uses
useMemo,useCallback, andReact.memoto minimize re-renders. -
🪝 Custom Hooks
useDebounce– Control API calls during typing.useInfiniteScroll– Trigger API calls when reaching scroll end.useLocalStorage– Persist query state easily.
-
🎨 User Experience Enhancements – Loading states, error handling, and empty results UI using TailwindCSS.
-
🔥 Bonus – Click a user card to open a modal with detailed GitHub profile info.
src/
├── App.js
├── components/
│ ├── SearchInput.jsx
│ ├── UserList.jsx
│ ├── UserCard.jsx
│ └── UserModal.jsx # (Optional: user details modal)
├── hooks/
│ ├── useDebounce.js
│ ├── useInfiniteScroll.js
│ └── useLocalStorage.js
└── index.js
-
Search Users:
GET https://api.github.com/search/users?q={USERNAME}&page={PAGE}&per_page=30 -
User Details (Bonus):
GET https://api.github.com/users/{USERNAME}
-
Clone the repository:
git clone https://github.com/your-username/github-user-search.git cd github-user-search -
Install dependencies:
npm install
-
Run the app:
npm run dev
-
Open in browser: [http://localhost:5173]
- API integration with pagination
- Debounce + localStorage persistence
- Component communication (props & lifting state)
- Performance tuning (
React.memo,useCallback,useMemo) - Custom hooks & separation of concerns
- Clean, modular architecture
- Add Zustand/Recoil for global state management
- Implement a theme switcher (light/dark mode)
- Use React Query or SWR for caching & server state
- Rewrite with Next.js App Router or React Server Components (RSC)