/fithub-swift-client

Computer Science bachelor's degree app that helps the user monitor their health and training related data.

Primary LanguageSwift

Fithub

Bachelor's degree thesis at University of Gdansk, faculty of Mathematics, Physics and Information Technology.

Getting Started

Fork this repo, run pod install and build the app on the desired device/simulator!

What's used

  • MVVM+Router
  • Store
  • Protocols
  • UIKit (programatically)
  • Basic HealthKit integration
  • Alamofire networking
  • Simple reactiveness with RxSwift to propagate data
  • Basic CommonCrypto usage (password hashing)
  • DIY Chart using UIKit and UIAnimation
  • Unit tests (Quick / Nimble)
  • Cocoapods (EasyPeasy, Alamofire, RxSwift)

Prerequisites

  • Xcode
  • Cocoapods
  • Macbook (to build and run the project on either a simulator device or real device)
  • iPhone X, XR, XS, XS Max, iPhone 11, iPhone 11Pro, iPhone 11 Pro Max (in order to run the app on a real device)

Installing

JSON Server

  1. Install JSON Server according to the official instructions.
  2. Open terminal and navigate to the directory of the db.json file.
  3. Run json-server --watch db.json or json-server --watch db.json --port [insert desired localhost port numer]. Omitting the --port parameter results in running port 3000 by default.

NGROK Localhost porting to online through SSH tunnels.

  1. Install NGROK according to the official instructions.
  2. Open terminal and make sure you are in the root (~) directory.
  3. Check which port you run the json server on (3000 by default, if not set otherwise).
  4. Run ./ngrok http port [insert port number here].
  5. You should get some info about the sucessful tunnelling and a new HTTP URL on which you localhost is accessible through online connection.

Xcode project

  1. Open terminal and navigate to the project directory on your machine.
  2. Run pod install, if necessary, run pod install --repo-update.
  3. Open the .xcworkspace file in the project directory in Xcode.
  • In this section choose whether you want to run the app using a localhost API (simulator only) or NGROK ported, online API (both simulator and real device).
  • In both cases make sure that in NetworkingClient.swift the urlBase constant is set to the right String value, which should be either the localhost or NGROK provided URL.
  1. Make sure you've got the fithub-swift-client build schema selected.
  2. Choose the desired simulator or other device you want to build on. (iPhones only, iPhone X or newer, iOS 12.4 or newer).
  3. Build or run the app.

Running the tests

To run the tests simply use the keyboard shortcut CMD+U. This will trigger a new build and automated tests.

Tests, explained.

Built With

  • Xcode - iOS IDE from Apple.
  • Swift 5 - iOS development language
  • Cocoapods - Dependency manager in iOS development
  • Alamofire - HTTP networking library
  • Easypeasy - Swift Autolayout Framework
  • RxSwift - Reactive Programming in Swift
  • JSON Server - JS REST API framework (for both local and online dev environment) (outside this repo)
  • NGROK - SSH tunnels tool for exposing local APIs in mobile development testing (outside this repo)

Contributing

As this is a university project, no contribution is desired nor allowed.

Authors

License

This project is licensed under the exclusive university license.

Acknowledgments

Useful resources used in the development of this project: