Skip to content

bikeindex/bike_index_ios

Repository files navigation

BIKE INDEX GitHub License iOS Test Suite iTunes App Store

iOS client for bikeindex.org

Download

App Store TestFlight
Download on the App Store
Bike Index is available on the iOS App Store. The public beta for pre-release builds is available at https://testflight.apple.com/join/TVaDioGl. Pre-release builds may not always be available.

Quick Start

To get started:

  1. Copy the BikeIndex-template.xcconfig file into BikeIndex-development.xcconfig and BikeIndex-production.xcconfig files.
    1. BikeIndex-development is used for the Debug Project Configuration in Run, Test, and Analyze builds.
    2. BikeIndex-production is used for the Release Project Configuration and for Profile and Archive builds.
    3. Both config files should include Default.xcconfig.
  2. Follow the instructions in BikeIndex-template.xcconfig and these steps to register your own OAuth application with bikeindex.org/oauth
    1. Sign in to the OAuth admin page at https://bikeindex.org/oauth/applications and create an new application
    2. (or sign in to your localhost instance and create an API key)
    3. Add a Redirect URI / callback URL with value bikeindex:// to the application on the oauth admin page.
    4. (You could customize the redirect URI and you'll need to escape the forward-slashes the same way that the URI in Default.xcconfig does.)
    5. Copy the application ID from the OAuth admin page and paste it into your .xcconfig file API_CLIENT_ID value.
    6. Copy the secret from the OAuth admin page and paste it into your .xcconfig file API_SECRET value.
  3. If building for a device you will need to provide a bundle identifier and your development team
  4. Build and run!

Config Validation

To validate that your xcconfig files have all required keys with non-empty values:

./scripts/validate-xcconfig.sh development

# Optional for local development
./scripts/validate-xcconfig.sh production

# Optional, recommended for running test suite
./scripts/validate-xcconfig.sh test

This same script is used in CI to catch missing configuration before builds. Run it locally after setting up your xcconfig files from the templates to verify everything is configured correctly.

Development

  • Requirements: Xcode 26.4.1
  • Target deployment: iOS 17.2

This project uses SwiftUI and SwiftData. At this time iPhone and iPad are the primary targets with a goal to include Mac support.

Set up suite of tools
  1. Install brew
  2. brew bundle install

At this point the fastlane tools should be installed and available.

Git hooks

Git hooks are in the local .githooks directory and can be connected with git config --local core.hooksPath .githooks/. These files should be marked executable already.

Swift Format

Formatting is done with swiftlang/swift-format

Lint with:

  • ./scripts/lint.sh or
  • swift format lint --recursive BikeIndex/ UnitTests/ UITests/

Format with:

  • ./scripts/format.sh or
  • swift format --in-place --recursive BikeIndex/ UnitTests/ UITests/

The configuration will be loaded by default from .swift-format

Tests

Test-driven development is an important tool for this project. In your local environment run the tests with Xcode, or set up the local suite of tools to install fastlane and run fastlane ios tests.

UI Test configuration

Running UI Tests from Xcode may cache logged-in state. Set up a credentials xcconfig file to ensure UI tests are always able to log-in and proceed (for both Xcode and fastlane invocations).

  1. Copy the Test-credentials-template.xcconfig file to Test-credentials.xcconfig.
  2. Edit the source to add a test username and password that are valid credentials for the server configured by corresponding build scheme (see: BikeIndex-development.xcconfig) you'll be using.
    • This test account must have already authorized the Bike Index OAuth app used in your corresponding build scheme's .xcconfig.
  3. In the simulator erase all content and settings to clear out any previous credentials.
  4. Run the UI tests through Xcode or fastlane scan --only-testing "UITests"!
Run an individual test case

Fastlane scan can run a single test case such as: fastlane scan --only-testing "UITests/ManufacturerKeyboardUITestCase".

Sponsorship

Bike Index is a 501(c)(3) nonprofit: https://bikeindex.org/why-donate

License

AGPL-3.0 License

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages