Skip to content

dinkar1708/github-repo-search-ios

Repository files navigation

GitHub Repository Search iOS App

A modern, native iOS application for searching GitHub repositories and users with a beautiful, intuitive user interface built entirely with SwiftUI.

About This Project

This iOS app achieves feature parity with the Android GitHub Cruise app. Both apps share the same core features for searching repositories, users, viewing profiles, and managing favorites. The implementation follows native platform conventions (SwiftUI for iOS, Jetpack Compose for Android) while maintaining consistent functionality.

πŸ“š Documentation

iOS Documentation:

Master Documentation (GitHub Cruise Android):

For complete API specs and cross-platform guidelines, see the Android repository:

Features

Core Features

  • Repository Search - Incremental search with real-time results and 3-second debouncing
  • User Search - Search GitHub users with 800ms debouncing and auto-complete
  • User Profiles - View detailed user profiles with bio, stats, and repository list
  • Favorites - Save favorite users AND repositories with UserDefaults persistence
  • Tab Navigation - 4 tabs: Users, Repositories, Favorites, Settings
  • Settings - Dark mode toggle, language selection, cache management

Technical Features

  • No external libraries - 100% native iOS implementation
  • API request throttling for optimal performance
  • Modern iOS design with cards, gradients, and smooth animations
  • Rich repository cards with avatars, stats, and descriptions
  • Comprehensive detail view with full repository information
  • Dark mode support with adaptive colors
  • Multi-language support (English, Japanese)
  • Universal app - supports iPhone and iPad

Screenshots

Light Mode

Repository Search Repository Results User Search
User Profile Repository Details Favorites - Users
Favorites - Repositories Settings

Dark Mode

Users - Dark Mode Repositories - Dark Mode

Project Folder Structure

The project follows a modular architecture with clear separation between data, features, and utilities:

Xcode Project Structure

Main Components:

  • Modules/ - Core application modules (Data, Feature, Util)
  • AppConfig/ - App configuration and navigation
  • Resource/ - Assets, colors, localization files
  • Tests/ - Unit tests, UI tests, Integration tests, Performance tests

App Structure

The app consists of 4 main tabs:

Tab 1: Users

  • Search GitHub users by username
  • View user cards with avatar and stats
  • Tap to view detailed profile
  • 800ms debounce for smooth searching

Tab 2: Repositories

  • Search GitHub repositories
  • Real-time search with 3-second debouncing
  • Rich repository cards with stats
  • Infinite scroll pagination

Tab 3: Favorites

  • View saved favorite users AND repositories
  • Segmented control to switch between Users and Repositories
  • Swipe to delete
  • Persists across app restarts using UserDefaults
  • One-tap favorite from repository search
  • One-tap favorite from user profile

Tab 4: Settings

  • Toggle dark mode
  • Change language (English/Japanese)
  • Clear cache
  • App information

Testing

Test Summary

Total: 8 test cases (all implemented and passing!)

Test Type Framework What It Verifies Count Status
Unit XCTest One function or class, isolated 4 βœ“ Pass
Integration XCTest Multiple components together 0 N/A
UI XCTest (XCUI) Real user flows on screen 3 βœ“ Pass
Performance XCTest (Metrics) Speed and memory over time 1 βœ“ Pass

Code Coverage: 51.87% (Improved from 26.68%!)

  • ApiClient: 88.89%
  • HomeView: 87.63%
  • AppSearchBar: 100%
  • SearchItem: 100%

All tests passing: 8/8 (100% success rate)

Quick Start

From Xcode, click Product β†’ Test (or press ⌘U) - it will run all test cases written inside:

  • github_repo_search_iOS_appTests - Unit tests for business logic and API calls
  • github_repo_search_iOS_appUITests - UI tests for user interaction flows

πŸ“– Complete Testing Documentation

docs/TESTING.md - Complete testing guide including:

  • All test cases with detailed explanations
  • Code coverage measurement and setup
  • How to run tests (Xcode, command line, CI/CD)
  • Test results interpretation
  • Best practices and troubleshooting

Code Coverage

Quick Setup:

  1. Edit Scheme (⌘<) β†’ Test β†’ Options β†’ Enable "Code Coverage"
  2. Run tests (⌘U)
  3. View results: Report Navigator (⌘9) β†’ Coverage tab

Coverage Goals:

  • Critical paths (API, business logic): 90-100%
  • View models: 70-90%
  • Overall target: 70%+

View Coverage:

  • Green = well tested (>80%)
  • Yellow = moderate (40-80%)
  • Red = needs tests (<40%)

For detailed coverage documentation, command line usage, and best practices, see docs/TESTING.md

Requirements

  • Xcode 15.0 or later (latest version recommended)
  • iOS 17.0 or later (minimum deployment target)
  • Swift 5.9 or later (includes modern concurrency and Observation framework)

How to run

  • Clone this repo
  • Open project in xcode
  • Select team signing and capability

Technology Stack

Language: Swift 5.9+ with modern concurrency

UI: SwiftUI with @main App lifecycle, AsyncImage, LazyVGrid, SF Symbols

Architecture: MVVM + Repository pattern

Networking: URLSession with async/await, type-safe ApiClient

State: @Observable macro (iOS 17+), @State, automatic change tracking

Features: Task-based debouncing, @MainActor, dark mode, accessibility, multi-language (EN/JP)

Project Structure

Modules/
β”œβ”€β”€ Data/
β”‚   β”œβ”€β”€ Remote/
β”‚   β”‚   β”œβ”€β”€ Model/           # SearchUser, UserProfile, UserRepository, SearchItem
β”‚   β”‚   β”œβ”€β”€ Request/         # API request definitions
β”‚   β”‚   └── Repository/      # GithubRepository
β”‚   └── Network/             # ApiClient
β”œβ”€β”€ Feature/
β”‚   └── UI/
β”‚       β”œβ”€β”€ UserSearch/      # User search tab
β”‚       β”œβ”€β”€ UserProfile/     # User profile detail
β”‚       β”œβ”€β”€ Home/            # Repository search tab
β”‚       β”œβ”€β”€ Favorites/       # Favorites tab with FavoritesManager
β”‚       └── Settings/        # Settings tab
└── Util/                    # Shared utilities

AppConfig/
└── MainTabView.swift        # Tab navigation

Platform Support

Languages: English, Japanese Themes: Light, Dark (adaptive) Devices: iPhone, iPad (universal) Orientations: Portrait, Landscape

API Endpoints Used

The app uses the following GitHub APIs:

  1. Search Repositories: GET /search/repositories
  2. Search Users: GET /search/users
  3. User Profile: GET /users/{username}
  4. User Repositories: GET /users/{username}/repos

All API calls use async/await with proper error handling.

Key Highlights

Modern iOS 17+ Features:

  • async/await throughout (no third-party frameworks)
  • @Observable macro for reactive state
  • Task-based debouncing and concurrency
  • @MainActor for thread-safe UI updates
  • SwiftUI @main App lifecycle

Architecture:

  • MVVM design pattern
  • Repository pattern for data abstraction
  • Type-safe networking with URLSession
  • Structured error handling
  • Clean separation of concerns

Recent Updates (July 2026)

Latest:

  • βœ“ Repository favorites with in-app navigation (repositories open in details screen, not browser)
  • βœ“ User favorites with profile navigation
  • βœ“ Segmented control in Favorites tab (Users/Repositories)
  • βœ“ Favorite button on repository details screen (not list cards)
  • βœ“ Favorite button on user profile screen
  • βœ“ Compact UI improvements (inline navigation, removed duplicate chevrons)
  • βœ“ 10 app screenshots (8 light mode, 2 dark mode)
  • βœ“ Documentation simplified (FEATURES.md, TESTING.md)
  • βœ“ Cross-references to Android master documentation

Earlier:

  • User search with 800ms debouncing
  • Repository search with 3-second debouncing
  • Settings screen with dark mode and language selection
  • 4-tab navigation (Users, Repositories, Favorites, Settings)
  • Debounce fix for smooth searching without cancellation errors
  • Legacy favorites migration support

TODO List

Completed:

  • Add repository favorites functionality (COMPLETED July 2026)
  • Add segmented control for Users/Repositories in Favorites tab (COMPLETED July 2026)
  • Move favorite button from list to details screen (COMPLETED July 2026)
  • Fix favorites navigation to open in-app (COMPLETED July 2026)
  • UI improvements: compact navigation, remove duplicate chevrons (COMPLETED July 2026)
  • Add app screenshots to documentation (COMPLETED July 2026)
  • Simplify documentation structure (COMPLETED July 2026)

Pending:

  • Add unit tests for FavoritesManager (repository favorites)
  • Add unit tests for new ViewModels (UserSearchViewModel, UserProfileViewModel)
  • Add UI tests for new features (User Search, Favorites with repositories)
  • Add CI/CD pipeline (Bitrise/Fastlane)
  • Implement comprehensive logging system
  • Add pull-to-refresh on all tabs
  • Implement search history
  • Replace placeholder app icon with custom design
  • Add animation transitions between screens

Meta

About

A modern iOS app built with SwiftUI and MVVM to search GitHub repositories, showcasing clean architecture, async networking, dependency injection, pagination, caching, and scalable app design

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages