Skip to content

Latest commit

 

History

History
150 lines (127 loc) · 5 KB

README.md

File metadata and controls

150 lines (127 loc) · 5 KB

Requirement - Github repository search

Features:

  • Please implement incremental search
  • Please do not use any libraries
  • Please add API request throttling
  • The design can be as simple as you like

Demo -

Various screen shots on different devices - dark mode, japanese language set on phone etc.

Folder structure

Screenshot 2024-02-04 at 20 56 26 Screenshot 2024-02-04 at 20 56 41

Main GUI

  • Search name -

Search Screen Light Mode

- Search name dark mode

Search Screen Dark Mode

- Search name iPAD

Search Screen Dark Mode

Implemented Features:

  • Splash
  • Home - show the search feature in gitHub repository names
  • Search items details
  • Unit Test case
  • UI Test cases

Testing From xcode click product-> Test - it will run all test case wrote inside below

  • github_repo_search_iOS_appTests
  • github_repo_search_iOS_appUITests

Requirements

  • xCode 12.3 (Developed)
  • iOS 13 (minimum support version)
  • Swift 4.0

How to run

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

Code

  • MVVM design pattern
  • SwiftUI - used for UI development
  • Swift - used for logical part

Usages

  • Follow below folder structure and use the files

App - All features and data

  • UI - screens UI
    • Splash
    • Home
    • Search Items Details
  • Util - utils file reusable
  • Data - Model class and data to be used in app, Network, Repository api calls etc.
  • Resources - Image and localization files

AppConfig - basics configuration launch time of app

MEMO / NOTES

Assumptions

  • Need to check search result api all keys validations eg. if nil then need to change the declaration of variable as nil/?

Env type

  • Debug - for development purpose
  • Inhouse - for testing purpose
  • Release - release on app store

Multi Language

  • English
  • Japanese

Theme Support available

  • Light
  • Dark

Screen rotation handling implemented

  • Design UI to handle / display UI on both portrait and landscape mode properly

Multiple screen size implemented - Iphone, iPad

  • Verified app on iPAD and different small and big size screens

Verification of app performance / Profile

Documentation and code commenting for understanding other developer

API handling -

API documentation

As per documentation :

You need to successfully authenticate and have access to the repositories in your search queries, otherwise, you'll see a 422 Unprocessible Entry error with a "Validation Failed" message. For example, your search will fail if your query includes repo:, user:, or org: qualifiers that request resources that you don't have access to when you sign in on GitHub.

Error handling of api

Use below for error handling, if not passing any query

https://api.github.com/search/repositories?q=
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Search",
      "field": "q",
      "code": "missing"
    }
  ],
  "documentation_url": "https://docs.github.com/v3/search"
}

https://api.github.com/search/repositories?q=%20in:name
{
  "message": "Validation Failed",
  "errors": [
    {
      "message": "None of the search qualifiers apply to this search type.",
      "resource": "Search",
      "field": "q",
      "code": "invalid"
    }
  ],
  "documentation_url": "https://docs.github.com/v3/search/"
}

error handling for invalid url, not found, search/repositories/ not valid url, valid is search/repositories

https://api.github.com/search/repositories/?q=%22swiftui%22
{
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest"
}

TODO

  • Complete all unit test case
  • Complete all ui test cases
  • Add CI/CD - bitrise/deploygate/fastlane
  • Remove all prints statements
  • Implement some logger to write logs on file, don't write logs in release mode
  • Check gitHub api response format - check for all nil fields
  • Implement search items details screen with more info
  • Replace attractive app icons

Meta