GraphQL-GitHub-Reader - Simple sample project that demonstrates how to connect with GitHub's API using GraphQL + Apollo

Overview

Header

GHPViewer

A beatiful way to see your GitHub Profile

File Selection Screen

File Selection Screen


Installation

  • The project is splitted in two folders:
    • GHPViewer: Contains the iOS Application related files.
    • Packages: Contains the three local packages from which the application depends on. For more details about these packages, please check their respective README files.

Usage

Before you run the application be sure to update the GitHubService.swift with the correct Authorization Token.

Once the token has been set to the additional headers of the service, the application will build and run as any other iOS project without any further changes required.

Note: For the sake of simplicity, the project has hardcoded one username to fetch the profile from github. if you wish to search for a different one be sure to update the parameter in ProfileSummaryPresenter.swift at the loadData() function.


Features

  • Connects to GitHub's GraphQL API to retrieve the profile of the specified user. From the profile it will retrieve:
    • Basic user information (Name, Username, Email, Total Count of Followers and Following)
    • The first 3 pinned items.
    • The top 10 repositories.
    • The top 10 starred repositories.
  • The client uses a SQLite DB to cache the data fetched from the server. The current max age for this cache is one day.
  • Beautiful UI in both Light and Dark mode.
  • Localized into two languages: English(default) and Dutch.

Note: It is possible for users to pin Gists to their profiles. With the current implementation of the project, the app will fail to render the profile if the user has a gist pinned. This is a known issue and will be improved in a future release.

Roadmap

  • ❒ Add support to search for different profiles within the app.
  • ❒ Add support for Dynamic Font Sizing while respecting the Design Guidelines.
  • ❒ Allow the user to view all the items in a section. (Pinned, Top and Starred Items)
  • ❒ Allow the user to see the details of an item.
  • ❒ Add support for pinned Gists.
  • ❒ Improve cache to not depend on Apollo for it. Currently it has several limitations that compromise the functionality of the app.

Project

Architecture

  • The project was build making use of the MVP design pattern.
  • The dependencies are injected in the standard way through initializers. For reference of how this is done, please check the *Builder classes.

Dependencies

  • The project is powered by Apollo for an explanation on how this is used, please check the README of the GraphQLClient package.
  • The GitHub GraphQL API Docs.

Structure

  • Packages: Contains the local SPM packages. MockingHelpers, CommonUI & GraphQLClient. For more details about these packages, please be sure to check their respective README files.
  • GHPViewer: Contains all the files related to the iOS Application.
    • Common: Contains the files that are not specific to any section of the app. In case this project needed to support multiple scenes. The SceneDelegate would also fall under this folder.
      • LaunchScreen: Contains the LaunchScreen.storyboard
      • AppDelegate: Contains the AppDelegate.swift.
      • UI: Contains the files related to UI customization, theming and reusable views.
    • Screens: Contains the files for each screen available in the application.
      • The structure of these folders, depending on their respective needs, could be as follows:
        • Model
        • View
        • Presenter
        • Components (If needed)
        • Builder
    • Repositories: Contains the repositories files and their protocols.
    • Service: Contains the Apollo GraphQL generated API file and the Service to connect to GitHub's GraphQL API.
    • Supporting Files: Contains the info.plist file.
    • Resources: Contains the files for multiple purposes. Localization Files and the Assets catalogue.
    • GHPViewerTests: Contains the files corresponding to the tests of the different sections of the app.

Navigation

The project at its current state doesn't have any sort of navigation. Nontheless, once the items in the roadmap related to it start being implemented, the Coordinator pattern would be the preferred option.

Unit Tests

The project at its current state only contains a set of tests for the main actors (Presenter, Repository).

The packages also provide their own suit of tests.

The tests follow the Given/When/Then format.

UI Tests

The project at its current state doesn't contain any UI Tests.

The plan was to do them by making use of the KIF Framework and following the Robot Pattern.

Benefits:

  • KIF: The benefits of this framework are several, among which I could highlight:
    • Allows you to perform functional tests on your views instead of integration tests.
    • The framework runs on the UnitTests target, which gives you the possibility to perform white box testing by mocking the dependencies. Something that it's not possible to do with the UITests targets.
    • Because it runs on the UnitTests target, we can skip the navigation to specific parts of the app, and directly load the screen in its required state.
  • Robot Pattern: The pattern is focused on splitting the What from the How Meaning that you have 2 entities responsable to run the set of tests. The first one is the XCTestCase which knows What to test and the second would be the Robot that knows how to execute the actions.
You might also like...
This project is an application that lets users learn about the missions and astronauts that formed NASA’s Apollo space program.

This project is an application that lets users learn about the missions and astronauts that formed NASA’s Apollo space program.

Sample iOS project built by SwiftUI + Flux and Combine framework using GitHub API
Sample iOS project built by SwiftUI + Flux and Combine framework using GitHub API

SwiftUI-Flux Flux enables us to have unidirectional data flow and make it testable. It's used to be implemented using RxSwift or ReactiveSwift in the

Sample iOS project built by SwiftUI + MVVM and Combine framework using GitHub API
Sample iOS project built by SwiftUI + MVVM and Combine framework using GitHub API

SwiftUI-MVVM One of the biggest idea for having MVVM is that most of data flow can be testable. Data binding in view layer by SwiftUI is awesome. Howe

Automatically generate GraphQL queries and decode results into Swift objects, and also interact with arbitrary GitHub API endpoints

GitHub API and GraphQL Client This package provides a generic GitHub API client (GithubApiClient) as well as Codable-like GitHub GraphQL querying and

Nasa's Apollo missions summary, with astronauts and mission details
Nasa's Apollo missions summary, with astronauts and mission details

Moonshot Nasa's Apollo missions summary, with astronauts and mission details Screenshots Missions Mission highlights Mission astronauts Astronaut deta

Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime.
Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime.

Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime. This texture can be used to create a simple textured 3D face model.

A sample app demonstrates how to use Atlantis on Swift Playground (iOS/macOS)
A sample app demonstrates how to use Atlantis on Swift Playground (iOS/macOS)

Atlantis with Swift Playground A sample app demonstrates how to use Atlantis on

A sample project exploring MVVM pattern with SwiftUI/Combine, using Unsplash API (via Picsum.photos API)
A sample project exploring MVVM pattern with SwiftUI/Combine, using Unsplash API (via Picsum.photos API)

CombineUnsplash A sample project exploring MVVM pattern with SwiftUI/Combine, using Unsplash API (via Picsum.photos API) with detail example. Resource

This is swift project example to connect VNPTSmartCA SDK using Swift Language.

Example source code to integrate with VNPTSmartCA iOS SDK To run the example project, clone repository, and run pod install Requirements Installation

This is a simple mobile app which is connect to the Twitter API
This is a simple mobile app which is connect to the Twitter API

Project 3 - My Twitter My Twitter is a basic twitter app to read your tweets. Time spent on two parts: 8.5 hours spent in total Twitter - Part II This

Tutorial GraphQL + Node Express + MySQL, and sample for Android / iOS client

GraphQL-tutorial Tutorial for GraphQL + Node Express + MySQL, and sample for Android / iOS client Blog NeoRoman's GraphQL-tutorial (Korean) Materials

GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample
GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample

GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample

This is an example project of SwiftUI and Combine using GitHub API.
This is an example project of SwiftUI and Combine using GitHub API.

SwiftUI-Combine-Example This is an example project of SwiftUI and Combine using GitHub GET /search/users API. 📋 Requirements Swift5.1 Beta Xcode11.0

This is an example project of SwiftUI and Combine using GitHub API.
This is an example project of SwiftUI and Combine using GitHub API.

SwiftUI-Combine-Example This is an example project of SwiftUI and Combine using GitHub GET /search/users API. 📋 Requirements Swift5.1 Beta Xcode11.0

Managing Pull Requests and Issues For GitHub & GitHub Enterprise

Trailer For maintained binaries and/or more info: Latest macOS version Latest iOS version Trailer CLI for Mac, Linux and Windows Trailer for Android N

Aplicación SwiftUI para visualizar datos de Github dados un usuario y un token (Github token), implementa autenticación biométrica mediante FaceID.
Aplicación SwiftUI para visualizar datos de Github dados un usuario y un token (Github token), implementa autenticación biométrica mediante FaceID.

ios-app-swift-gitapp Aplicación SwiftUI para visualizar datos de Github dados un usuario y un token (Github token), implementa autenticación biométric

Xcode plugin to let you jump to GitHub History, Blame, PRs, Issues, Notifications of any GitHub repo with one shortcut.
Xcode plugin to let you jump to GitHub History, Blame, PRs, Issues, Notifications of any GitHub repo with one shortcut.

Reveal-In-GitHub Xcode plugin to let you jump to GitHub History, Blame, PRs, Issues, Notifications of current repo in one second. My company work on G

This app demonstrates how to use the Google Cloud Speech API and Apple on-device Speech library to recognize speech in live recorded audio.

SpeechRecognitionIOS This app demonstrates how to use Google Cloud Speech API and Apple on-device Speech library to recognize speech in live audio rec

Swift Xcode Project that demonstrates how to set up a microphone input via AudioKit verions 5.

AudioKit Mic Input Swift Xcode Project that demonstrates how to set up a microphone input via AudioKit verions 5. Be sure to plug in headphones in ord

Owner
Andrés Pesate
Andrés Pesate
🏁 make QRcode and QRcode Reader Tutorial

QRCodeReaderTutorial-iOS ?? make QRcode and QRcode Reader Tutorial QR코드와 리더기를 만드는 오픈 라이브러리가 있지만 자체 라이브러리를 활용해서 만들어보기로 했다. 목차 QR코드 만들기 QR코드 Reader 만들기

Hyungyu Kim 5 Dec 9, 2021
QRCode Scanner using Apple in build Vision framework.

?? iOS13 DKQRReader Example A quick example showing how to use the Vision system-framework in iOS 13 and Swift 5. Prerequisites Xcode 13 and later Get

Dineshkumar Kandasamy 3 Jun 22, 2022
:mag_right: A simple and beautiful barcode scanner.

Description BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience. Barco

HyperRedink 1.6k Dec 30, 2022
🔍BarcodeScanner – simple & easy application that helps you to scan both EAN8 and EAN13 barcodes.

?? Simple & easy application that helps you to scan both EAN8 and EAN13 barcodes.

Tamerlan Satualdypov 16 Apr 22, 2022
A simple Safari web extension that displays a QR code for the webpage in focus.

QR Pop ?? QR Pop is a simple iOS & MacOS app and Safari extension built to make displaying QR codes easy. The Safari Extension is inspired by the quic

Shawn 9 Dec 11, 2022
Simple application for creating QR code with a background

BeautifyQR Импортирует исходный QR-код из галереи Накладывает его на выбранную картинку с фоном Полученную картинку можно вынести виджетом на домашний

Dmitry Demianov 1 Nov 28, 2021
QR code detector. Simple usage, you can get recognition results via delegate or callback.

SPQRCode QR code detector. Simple usage, you can get recognition results via delegate or callback. Installation Swift Package Manager CocoaPods Manual

Sparrow Code 58 Jan 6, 2023
A Simple iOS QR code scanner that allows users to enable their camera and local Photo Library accesses to scan the contents of the input QR codes.

iOS QR Code Scanner A Simple iOS QR code scanner using Swift UI. Jump to: ContentView.swift screenshot 1.1.5 NOTE: be aware of the new horizontal line

Krystal Zhang 0 Jan 1, 2023
AnimeSearch - A simple app that shows how to use Anilist GraphQL based API with Apollo

AnimeSearch A simple app that shows how to use Anilist GraphQL based API with Ap

Pedro J Fernandez 1 Apr 26, 2022
Github iOS Client based on Github REST V3 API and GraphQL V4 API

ZLGithubClient Github iOS 客户端 by Existorlive Objective-c 2.0 Swift 5 Cocoapods 1.9.1 iOS >= 11.0 基于 Github REST V3 API 和 Github GraphQL V4 API 开发的iOS客

朱猛 55 Dec 29, 2022