A modern web application built with Next.js that allows you to explore GitHub users, view their profiles, and manage your favorite users. The application features a clean, responsive design with dark mode support.
- ๐ Search GitHub users by username
- ๐ค View detailed user profiles
- ๐ Browse user repositories
- โญ Save favorite users
- ๐ Dark/Light theme support
- ๐ฑ Responsive design
- โก Fast and efficient with React Query
Before you begin, ensure you have the following installed:
- Node.js (v18.0.0 or higher)
- pnpm (v8.0.0 or higher)
- Git
- Create a
.env.localfile in the root directory with the following variables:GITHUB_ACCESS_TOKEN=your_github_personal_access_token
Note: While the app works without a token, you'll have limited API requests. Create a token at: GitHub Settings > Developer Settings > Personal Access Tokens
- Framework: Next.js (Pages Router)
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- State Management: React Query
- Icons: Lucide React
- Date Formatting: date-fns
- API Client: Axios
-
Clone the repository:
git clone https://github.com/mcabreradev/fravega-tech.git cd fravega-tech -
Install dependencies:
pnpm install
-
Start the development server:
pnpm dev
-
Open http://localhost:3000 in your browser
pnpm dev- Start development serverpnpm build- Build production bundlepnpm start- Start production serverpnpm lint- Run ESLintpnpm format- Format code with Prettierpnpm type-check- Run TypeScript type checking
โโโ components/ # React components
โ โโโ layout/ # Layout components
โ โโโ ui/ # UI components (shadcn/ui)
โ โโโ ... # Feature components
โโโ lib/ # Utility functions and API
โโโ pages/ # Next.js pages
โโโ styles/ # Global styles
โโโ types/ # TypeScript types
โโโ hooks/ # Custom React hooks
โโโ public/ # Static assets
- Real-time search with debouncing
- Displays user cards with essential information
- Error handling for failed searches
- Pagination support for search results
- Comprehensive user information display
- Repository list with sorting and filtering
- Social links and user metadata
- Repository statistics and language breakdown
- Local storage-based favorites management
- Add/remove favorites with one click
- Persistent across sessions
- Sync state across tabs
- System-based theme detection
- Manual theme toggle
- Smooth theme transitions
- Persisted theme preference
The GitHub API has rate limiting:
- Unauthenticated requests: 60 requests per hour
- Authenticated requests: 5,000 requests per hour
To avoid rate limiting, set up your GitHub token as described in the Environment Setup section.
- React Query for efficient data fetching and caching
- Image optimization with Next.js Image component
- Debounced search to minimize API calls
- Incremental Static Regeneration for user profiles
- Code splitting and lazy loading
- Chrome (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Edge (latest 2 versions)
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Pick an issue to work on
- Create a new branch
- Write your code
- Add tests if applicable
- Ensure all tests pass
- Submit a pull request
-
Rate Limiting
- Error: "API rate limit exceeded"
- Solution: Set up a GitHub token as described in Environment Setup
-
Build Errors
- Error: "Module not found"
- Solution: Run
pnpm installto ensure all dependencies are installed
-
Type Errors
- Run
pnpm type-checkto identify type issues - Ensure your TypeScript version matches the project's
- Run
The project uses TypeScript for type safety. To check for type errors:
pnpm type-checkThis command:
- Runs the TypeScript compiler in type-checking mode
- Checks all TypeScript files in the project
- Reports any type errors found
- Does not generate any JavaScript output files
It's recommended to:
- Run type checking before committing changes
- Include type checking in your CI/CD pipeline
- Fix any type errors before merging code
-
Missing type declarations for imported modules
- Solution: Install appropriate
@types/*packages
- Solution: Install appropriate
-
Incompatible prop types in React components
- Solution: Check component prop interfaces and make sure they match usage
-
Incorrect generic type parameters
- Solution: Verify generic type arguments match expected types
This project is licensed under the MIT License - see the LICENSE file for details.
- shadcn/ui for the beautiful UI components
- GitHub API for the data
- Next.js team for the amazing framework