Skip to content

Real-time public transport in Wrocław. With push notifications for all of the “tree is blocking the road, so the replacement bus was dispatched” events.

License

Notifications You must be signed in to change notification settings

LiarPrincess/Wroclive-client

Repository files navigation

Wroclive - Real-time public transport in Wrocław

This repository contains sources of Wroclive iOS app.

(Psst… server code is also open-sourced!)

About

Moving around Wrocław has suddenly become much easier!

Wroclive allows you to check the current location of public transport vehicles. This will help you decide whether it is worth rushing to a stop or to calmly finish your coffee.

If you are only interested in specific lines, you can use our filtering functionality. You can also save the most frequently used connections for easier access.

It will also send you push notifications with all of the sudden and unforeseen changes, like when the tree is blocking tram tracks and the replacement-bus was dispatched.

With Wroclive you will never miss your bus!

AppStore screenshots

Source map

  • Design - graphic assets

    • Icon - as .svg and png.

    • Design - all of the button/toolbar images. Use .svg files to edit and then export to pdf (Boxy SVG is an amazing tool for this).

    • AppStore images - AppStore screenshots (before and after framing). Requires fastlane.

  • Wroclive - iOS app. This dir contains only AppDelegate.swift and application icon, everything else is in WrocliveFramework.

  • WrocliveFramework - most of the Wroclive code. We use separate framework, so that our unit tests execute much faster (because now there is no need to launch the whole app).

    • Api - code to interact with wroclive.app api. DO NOT create new instances, use the one from Environment.

    • Assets - translations and images from Design/Images. DO NOT use directly! We use SwiftGen to generate static types (see Generated directory).

    • Coordinators - app navigation extracted from view controllers. There are a lot of good tutorials about this on the internet.

    • Environment - Environment contains wrappers for Apple frameworks, so we can mock them during unit tests (so basically a dependency injection). Most of the time we inject Environment in init (we do not use global AppEnvironment like kickstarter/ios-oss).

    • Extensions

    • Generated - code generated by SwiftGen from our Assets. Use make gen to regenerate.

    • Helpers - code that did not fit anywhere else.

      • Card panel - card is a container view controller that pops from the bottom of the screen. Most of our views (for example: lines, bookmarks and settings) are presented in cards.

      • MapUpdateScheduler.swift - every 5 seconds it will dispatch ApiMiddlewareActions.requestVehicleLocations to update vehicle loctions on the map.

      • DispatchStoreUpdatesFromAppleFrameworks.swift - will observe Apple frameworks and dispatch actions to update AppState. For example: after user granted location authorization it will dispatch UserLocationAuthorizationAction.set(authorization) action.

    • Models - main data structures (for example: Line, Vehicle, Bookmark).

    • Redux - code connected to ReSwift. It contains AppState struct that describes the state of the whole application. You should also check Actions and Middleware.

    • Theme - color scheme, fonts and text attributes.

    • View controllers - basically our views. We use ViewModels for testability. We also prefer SnapKit over storyboards.

      • Main - main view, basically MapViewController + toolbar.

      • Map - view controller responsible for map (duh…), nested in MainViewController.

      • Bookmarks card - view controller to manage bookmarks (heart icon on main toolbar)

      • Search card - view controller to select lines and create bookmarks (yes, the name is bad, but it is too much work to change it now).

      • Settings card - app settings

  • WrocliveTests - unit/snapshot tests

Recommended reading order

If you are new to the app, then following reading order is recommended:

  1. Wroclive/AppDelegate.swift - although, you do not need to understand everything
  2. WrocliveFramework/Models
  3. WrocliveFramework/Environment
  4. WrocliveFramework/Redux
  5. View controller of your choice (BookmarksCard is the simplest one)

Tooling

Before contributing to Wroclive you may want too read about following tools:

Special thanks

Special thanks to the maintainers of the following libraries:

  • ReSwift - Unidirectional Data Flow in Swift - Inspired by Redux
  • SnapKit - A Swift Autolayout DSL for iOS & OS X
  • mxcl/PromiseKit - Promises for Swift & ObjC
  • Alamofire - Elegant HTTP Networking in Swift
  • ivanvorobei/SPAlert - Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets
  • pointfreeco/swift-snapshot-testing - Delightful Swift snapshot testing
  • fastlane - App automation done right
  • SwiftGen - The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!
  • realm/SwiftLint - A tool to enforce Swift style and conventions

License

Wroclive is licensed under the Mozilla Public License 2.0 license. See LICENSE for more information.

About

Real-time public transport in Wrocław. With push notifications for all of the “tree is blocking the road, so the replacement bus was dispatched” events.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages