Discover GitHub users with a clean, fast React + Vite app. Search by username, view profile details, and jump to followers, following, and repositories.
- GitHub user search with loading and error states
- Profile card: avatar, name, username, bio, location
- Quick links: followers, following, repositories
- Copy-to-clipboard for username and email
- Dark/light theme toggle (persisted in localStorage)
- Responsive UI built with Tailwind CSS v4
- Client-side routing with a shared layout
- React 19 + Vite 7
- React Router 7
- Tailwind CSS v4 (@tailwindcss/vite)
- Axios
- Lucide Icons
.env.local
.gitignore
eslint.config.js
index.html
package.json
vite.config.js
public/
src/
App.jsx
index.css
main.jsx
components/
common/ThemeToggle.jsx
layout/{Footer.jsx,Layout.jsx,NavBar.jsx}
search/SearchForm.jsx
ui/{Button.jsx,Card.jsx,Spinner.jsx}
user/{UserProfileCard.jsx,UserSocialLinks.jsx,UserStats.jsx}
hooks/useGithubUser.js
pages/{HomePage.jsx,NotFound.jsx,SavedProfilesPage.jsx,SavedSearchesPage.jsx,SearchPage.jsx,SettingsPage.jsx}
services/github.js
utils/api.js
Prerequisites:
- Node.js 18+ and npm
Install and run:
npm install
npm run devBuild and preview:
npm run build
npm run previewCreate a .env.local in the project root:
VITE_GITHUB_TOKEN=your_github_token_here # optional but recommended
Notes:
- Unauthenticated GitHub API calls are rate-limited. Supplying a token increases limits.
- The token is sent as a bearer token in
GithubService.getUser.
npm run dev— start dev servernpm run build— production buildnpm run preview— preview production buildnpm run lint— run ESLint
-
Routing and layout:
-
Pages:
-
Search flow:
- Hook:
useGithubUser - API wrapper:
fetchGitHubUser - Service:
GithubService.getUser - UI:
SearchForm,UserProfileCard,UserStats,UserSocialLinks
- Hook:
-
UI primitives:
Button,Card,Spinner- Theme:
ThemeToggle
-
Styling and tooling:
- Tailwind setup: src/index.css
- Vite config and alias @ -> src: vite.config.js
- App entry: index.html, src/main.jsx
- Package scripts: package.json
- External links open in new tabs where applicable.
- The path alias
@resolves tosrc/as configured in vite.config.js.
MIT