Skip to content

πŸ” GitHub Repositories Explorer is a sleek web app built with Next.js and TypeScript that lets you search for GitHub users and browse their public repositories effortlessly. πŸš€βœ¨

Notifications You must be signed in to change notification settings

thoriqdharmawan/github-repositories-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ GitHub Repositories Explorer

Next.js TypeScript TailwindCSS React Query Jest

πŸ” Discover and explore GitHub users and their repositories with style! A modern, responsive web application built with Next.js, featuring GitHub OAuth authentication, infinite scrolling, and beautiful UI components.

πŸŽ₯ Demo

See the app in action!

πŸ–₯️ Desktop Experience

Desktop Demo

πŸ“± Mobile Experience

Mobile Demo

Experience the smooth user interface, search functionality, and responsive design across all devices

✨ Features

πŸ” Authentication & Security

  • GitHub OAuth Integration - Secure login with your GitHub account
  • Token-based Authentication - Persistent login sessions
  • Rate Limiting Protection - Smart error handling for API limits

πŸ‘₯ User Exploration

  • πŸ” User Search - Find GitHub users by username with real-time search
  • πŸ“Š User Profiles - View detailed user information and statistics
  • πŸ”— Quick Access - Direct links to user's GitHub profile, followers, following, and more
  • ⚑ Responsive UI - Beautiful user cards with hover effects

πŸ“š Repository Discovery

  • ♾️ Infinite Scrolling - Seamlessly browse through repositories
  • 🏷️ Language Detection - Color-coded programming languages
  • ⭐ Repository Stats - Stars, forks, watchers, and size information
  • πŸ“… Metadata Display - Creation dates, last updates, and descriptions
  • πŸ”— External Links - Quick access to GitHub repository pages
  • πŸ“Š Detailed Information - License, default branch, and clone URLs

🎨 User Interface & Experience

  • πŸŒ™ Dark/Light Mode - Toggle between themes with persistent preference
  • πŸ“± Responsive Design - Perfect on desktop, tablet, and mobile devices
  • 🎭 Modern Components - Built with Radix UI primitives and custom styling
  • ✨ Smooth Animations - CSS transitions and micro-interactions
  • πŸš€ Fast Loading - Optimized with Next.js and React Query caching
  • πŸ“ Drawer/Modal System - Elegant detail views for users and repositories

πŸ› οΈ Technical Features

  • ⚑ Performance Optimized - Server-side rendering and static generation
  • πŸ”„ Real-time Updates - React Query for efficient data fetching
  • πŸ§ͺ Comprehensive Testing - Unit tests with Jest and Testing Library
  • πŸ“Š Code Coverage - Detailed testing reports
  • 🎯 TypeScript - Full type safety and better developer experience
  • πŸ” SEO Optimized - Meta tags, structured data, and sitemap

πŸ› οΈ Tech Stack

Frontend Framework

  • Next.js 15.3.3 - React framework with App Router
  • React 19 - Latest React with concurrent features
  • TypeScript - Static type checking

Styling & UI

  • TailwindCSS 4.0 - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Lucide React - Beautiful icon library
  • next-themes - Theme switching support
  • Vaul - Drawer component for mobile

State Management & Data Fetching

  • TanStack Query (React Query) - Server state management
  • Axios - HTTP client for API requests
  • React Context - Client state management

Development & Testing

  • Jest - JavaScript testing framework
  • Testing Library - React component testing utilities
  • ESLint - Code linting and formatting
  • Prettier - Code formatting

Authentication & APIs

  • GitHub OAuth - Secure authentication
  • GitHub REST API - User and repository data
  • Local Storage - Token persistence

πŸš€ Getting Started

Prerequisites

  • Node.js 18.0 or higher
  • npm or yarn package manager
  • GitHub OAuth App credentials

Installation

  1. Clone the repository

    git clone https://github.com/thoriqdharmawan/github-repositories-explorer.git
    cd github-repositories-explorer
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    Create a .env file in the root directory:

    NEXT_PUBLIC_APP_API_URI=https://api.github.com
    NEXT_PUBLIC_HOMEPAGE_URI=http://localhost:3000 (optional)
    NEXT_PUBLIC_AUTHORIZATION_CALLBACK_URI=http://localhost:3000/callback (optional)
    NEXT_PUBLIC_CLIENT_ID=your-client-id-from-github (optional)
    CLIENT_SECRET=your-secret-from-github (optional)
    NEXT_PUBLIC_BASE_URL=http://localhost:3000 (optional)
  4. GitHub OAuth Setup

    • Go to GitHub Developer Settings
    • Create a new OAuth App
    • Set Authorization callback URL to: http://localhost:3000/callback
    • Copy the Client ID to your .env file
  5. Run the development server

    npm run dev
    # or
    yarn dev
  6. Open your browser

    Navigate to http://localhost:3000 πŸŽ‰

🐳 Docker Setup (Alternative)

Prefer using Docker? Here's a quick setup guide:

Prerequisites

  • Docker and Docker Compose installed on your machine

Quick Start with Docker

  1. Clone and navigate to the project

    git clone https://github.com/thoriqdharmawan/github-repositories-explorer.git
    cd github-repositories-explorer
  2. Set up environment variables (same as above)

    NEXT_PUBLIC_APP_API_URI=https://api.github.com
    # Add other environment variables as needed
  3. Choose your Docker setup:

    πŸ”₯ Development Mode (with hot reload):

    npm run docker:dev
    # or use docker-compose directly
    docker-compose --profile dev up dev --build

    πŸš€ Production Mode:

    # Build production image
    npm run docker:build
    
    # Start production server
    npm run docker:start
  4. Access the application

πŸ› οΈ Docker Commands

Command Description
npm run docker:dev πŸ”₯ Start development server with hot reload
npm run docker:build πŸ“¦ Build production Docker image
npm run docker:start πŸš€ Start production server
npm run docker:stop πŸ›‘ Stop all containers
npm run docker:clean 🧹 Remove containers and images
npm run docker:logs πŸ“‹ Show container logs

πŸ’‘ Docker Tips

  • Development mode includes volume mounting for hot reload
  • Production mode creates optimized builds for deployment
  • All Docker scripts are available in docker-setup.sh
  • Use docker-compose logs dev to check development logs

πŸ“‹ Available Scripts

Command Description
npm run dev πŸ”₯ Start development server with Turbopack
npm run build πŸ“¦ Build for production
npm run start πŸš€ Start production server
npm run lint πŸ” Run ESLint
npm test πŸ§ͺ Run tests
npm run test:watch πŸ‘€ Run tests in watch mode
npm run test:coverage πŸ“Š Generate test coverage report
npm run test:coverage:open πŸ“ˆ Open coverage report in browser

πŸ§ͺ Testing

This project includes comprehensive testing with:

  • Unit Tests - Component and utility function testing
  • Integration Tests - API hooks and provider testing
  • Test Coverage - Detailed coverage reports
  • Continuous Testing - Watch mode for development

πŸ“Š Test Coverage Report

Test Coverage

Our test suite maintains high code coverage across all modules to ensure reliability and maintainability.

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

# Open coverage report in browser
npm run test:coverage:open

πŸ“ Project Structure

β”œβ”€β”€ πŸ“ api/                    # API hooks and utilities
β”‚   β”œβ”€β”€ πŸ“ repos/             # Repository-related API hooks
β”‚   β”œβ”€β”€ πŸ“ users/             # User-related API hooks
β”‚   └── πŸ“ __test__/          # API tests
β”œβ”€β”€ πŸ“ app/                   # Next.js App Router
β”‚   β”œβ”€β”€ πŸ“„ layout.tsx         # Root layout
β”‚   β”œβ”€β”€ πŸ“„ page.tsx          # Home page
β”‚   └── πŸ“ api/              # API routes
β”œβ”€β”€ πŸ“ components/            # Reusable UI components
β”‚   β”œβ”€β”€ πŸ“ ui/               # Base UI components
β”‚   └── πŸ“ __test__/         # Component tests
β”œβ”€β”€ πŸ“ features/              # Feature-based components
β”‚   β”œβ”€β”€ πŸ“ list-users/       # User search and listing
β”‚   β”œβ”€β”€ πŸ“ list-repos/       # Repository listing
β”‚   β”œβ”€β”€ πŸ“ user-detail/      # User detail view
β”‚   └── πŸ“ repo-detail/      # Repository detail view
β”œβ”€β”€ πŸ“ lib/                   # Utility libraries
β”œβ”€β”€ πŸ“ providers/             # React Context providers
β”œβ”€β”€ πŸ“ types/                 # TypeScript type definitions
└── πŸ“ utils/                 # Helper functions

🎨 UI Components

The project features a comprehensive design system built with:

  • 🎯 Consistent Theming - Dark/light mode support
  • β™Ώ Accessibility - ARIA compliant components
  • πŸ“± Responsive Design - Mobile-first approach
  • 🎭 Animation - Smooth transitions and loading states
  • 🧩 Modular Components - Reusable and composable

Key Components

  • Header - Navigation with auth and theme toggle
  • SearchInput - User search functionality
  • UserItem - User card with details
  • RepoItem - Repository card with stats
  • DetailViews - Drawer/modal system for details
  • LoadingState - Skeleton loading components
  • ErrorState - Error handling with retry actions

🌐 Deployment

Vercel (Recommended)

  1. Connect your repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on every push

Manual Deployment

# Build the project
npm run build

# Start the production server
npm start

πŸ‘¨β€πŸ’» Author

Thoriq Dharmawan

πŸ™ Acknowledgments

  • GitHub API - For providing comprehensive repository data
  • Vercel - For seamless deployment and hosting
  • Next.js Team - For the amazing React framework
  • Radix UI - For accessible component primitives
  • TanStack - For powerful data fetching capabilities

⭐ Star this repository if you found it helpful!

GitHub stars GitHub forks

Made with ❀️ and β˜• by Thoriq Dharmawan

About

πŸ” GitHub Repositories Explorer is a sleek web app built with Next.js and TypeScript that lets you search for GitHub users and browse their public repositories effortlessly. πŸš€βœ¨

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages