Giter Site home page Giter Site logo

ridetime's Introduction

DeepScan grade

RideTime

Plan a ride with your friends, meet new people to ride with or find a local to show you around!

Completed features:

  • Event comments/messages
  • Privacy
    • private event - only visible to invited & members
    • friends only - visible to friends & invited
    • public - choose whether to allow anyone to join or add a join request
  • A list of nearby locations and trails using Trailforks

In Progress:

  • Live tracking
    • Track your friends / shuttle vehicle while out on a ride

TODO:

  • Shuttle planning
    • Shuttle capacity! Each member can set whether he has a vehicle / with rack & capacity for people / bikes
    • Calculate a plan from people signed up with shuttle vehicles for big rides

Known issues:

  • Too many to list! It's very much a work in progress and many features aren't implemented yet, but the basic functionality is in and it's getting better!

ridetime's People

Contributors

kachnitel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ridetime's Issues

RideItem style throws Warning: Failed prop type: Invalid props.style key `0` supplied to `ForwardRef`.

A warning is produced by this code in RidesList

    <TouchableHighlight onPress={() => this.props.navigation.push(
      'RideDetail',
      item
    )}>
      <RideItem
        ride={item}
        style={index % 2 == 0 ? styles.listItemWhite : styles.listItemBlack}
      />
    </TouchableHighlight>

The error disappears by commenting out either the style, or <TouchableHighlight /> (and moving it to RideItem

Warning: Failed prop type: Invalid props.style key `0` supplied to `ForwardRef`.
Bad object: {
  "0": {
    "backgroundColor": "#fff"
  },
  "1": {
    "opacity": 0.85
  },
  "fontSize": 20.666666666666668
}
Valid keys: [
  "display",
  "width",
  "height",
  "start",
  "end",
  "top",
  "left",
  "right",
  "bottom",
  "minWidth",
  "maxWidth",
  "minHeight",
  "maxHeight",
  "margin",
  "marginVertical",
  "marginHorizontal",
  "marginTop",
  "marginBottom",
  "marginLeft",
  "marginRight",
  "marginStart",
  "marginEnd",
  "padding",
  "paddingVertical",
  "paddingHorizontal",
  "paddingTop",
  "paddingBottom",
  "paddingLeft",
  "paddingRight",
  "paddingStart",
  "paddingEnd",
  "borderWidth",
  "borderTopWidth",
  "borderStartWidth",
  "borderEndWidth",
  "borderRightWidth",
  "borderBottomWidth",
  "borderLeftWidth",
  "position",
  "flexDirection",
  "flexWrap",
  "justifyContent",
  "alignItems",
  "alignSelf",
  "alignContent",
  "overflow",
  "flex",
  "flexGrow",
  "flexShrink",
  "flexBasis",
  "aspectRatio",
  "zIndex",
  "direction",
  "shadowColor",
  "shadowOffset",
  "shadowOpacity",
  "shadowRadius",
  "transform",
  "transformMatrix",
  "decomposedMatrix",
  "scaleX",
  "scaleY",
  "rotation",
  "translateX",
  "translateY",
  "backfaceVisibility",
  "backgroundColor",
  "borderColor",
  "borderTopColor",
  "borderRightColor",
  "borderBottomColor",
  "borderLeftColor",
  "borderStartColor",
  "borderEndColor",
  "borderRadius",
  "borderTopLeftRadius",
  "borderTopRightRadius",
  "borderTopStartRadius",
  "borderTopEndRadius",
  "borderBottomLeftRadius",
  "borderBottomRightRadius",
  "borderBottomStartRadius",
  "borderBottomEndRadius",
  "borderStyle",
  "opacity",
  "elevation",
  "color",
  "fontFamily",
  "fontSize",
  "fontStyle",
  "fontWeight",
  "fontVariant",
  "textShadowOffset",
  "textShadowRadius",
  "textShadowColor",
  "letterSpacing",
  "lineHeight",
  "textAlign",
  "textAlignVertical",
  "includeFontPadding",
  "textDecorationLine",
  "textDecorationStyle",
  "textDecorationColor",
  "textTransform",
  "writingDirection"
]
    in ForwardRef (at RideItemDetail.js:43)
    in RideItemDetail (at RideItem.js:13)
    in RCTView (at View.js:44)
    in RideItem (at RidesList.js:12)
    in RCTView (at View.js:44)
    in TouchableHighlight (at RidesList.js:8)
    in RCTView (at View.js:44)
    in CellRenderer (at VirtualizedList.js:687)
    in RCTView (at View.js:44)
    in RCTScrollView (at ScrollView.js:977)
    in ScrollView (at VirtualizedList.js:1062)
    in VirtualizedList (at FlatList.js:662)
    in FlatList (at RidesList.js:23)
    in RCTView (at View.js:44)
    in RidesList (at RidesScreen.js:45)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in RidesScreen (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:478)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in AnimatedComponent (at screens.native.js:58)
    in Screen (at StackViewCard.js:42)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:507)
    in RCTView (at View.js:44)
    in ScreenContainer (at StackViewLayout.js:401)
    in RCTView (at View.js:44)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:49)
    in RCTView (at View.js:44)
    in Transitioner (at StackView.js:19)
    in StackView (at createNavigator.js:57)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at DrawerView.js:87)
    in RCTView (at View.js:44)
    in AndroidDrawerLayout (at DrawerLayoutAndroid.android.js:205)
    in DrawerLayoutAndroid (at DrawerView.js:84)
    in DrawerView (at createNavigator.js:57)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at SwitchView.js:12)
    in SwitchView (at createNavigator.js:57)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at App.js:36)
    in RCTView (at View.js:44)
    in App (at registerRootComponent.js:17)
    in RootErrorBoundary (at registerRootComponent.js:16)
    in ExpoRootComponent (at renderApplication.js:34)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in AppContainer (at renderApplication.js:33)
- node_modules/prop-types/checkPropTypes.js:19:20 in printWarning
- node_modules/prop-types/checkPropTypes.js:83:12 in checkPropTypes
- node_modules/react/cjs/react.development.js:1501:19 in validatePropTypes
- node_modules/react/cjs/react.development.js:1590:22 in createElementWithValidation
* components/RideItemDetail.js:43:9 in render
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:10563:21 in finishClassComponent
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:14091:21 in performUnitOfWork
- ... 22 more stack frames from framework internals

Multiple friend requests glitch

If more than 1 friend request is displayed on FriendListScreen and the first one is accepted/rejected, the correct item is removed from API but requests list still shows the first item, rather than the second that was not deleted/accepted

Friends management

Display

  • fetch details for signedInUser's friends
  • Add a screen showing list of friends in the drawer
    • Add Friend button
      • Might be better in header top right - must be consistent with Events
      • Navigate to screen described below
    • Message / createRideWith(auto invites) / deleteFriend
  • Pending requests
    • Show only incoming pending
    • Accept button

Add

  • Reuse friendlist screen
  • List users from API
    • Filter by search term &q=name=threePlusLetters (- [ ] API support)
    • Disable add button for existing friends
  • Displayed list should allow both [Add] and [Detail]

Receive Trail entity

  • Add TrailStore / Part of LocationStore(Location.trails)?
    • References
      • Location
      • Route (child of Event)

Proper SVG use

https://github.com/kachnitel/RideTime/blob/288308de05083fcfadd24ec5e011a02576756ccc/components/icons/DifficultyIcon.js
Seems like an overkill to create a font out of SVGs, import it and have to use the HtmlEntities library to be able to use it at all.
Would be nice to use SVG directly but it doesn't appear to be supported by react-native unless ejected from EXPO and using react-native-svg with some platform-specific code.

Create Location

A create location screen,
required: name, map
optional: private, pic(cover split w/ map?)

Light / Dark theme

Option to select between light/dark would be ideal. Setting in drawer -> Settings. Should replace all <Text> with custom component to switch default font color, then just return set of styles (background, text color, tintColor) depending on the setting

Receive Route entity

let trails = Event.getRoute().getTrails();

Contains trails array if available.

Fields:
id,title,description,trails(*),profile(*)
(*) = optional
TF Url?

  • Add RouteStore
  • References
    • Trail

Edit User

Editable text items in Profile Header (incl. Summary) should transform into inputs (dropdowns for skill etc).
Ideally the "business card" would animate to expand to accommodate inputs etc, with other inputs below.

Search suggestions

Use elasticsearch or appbase.io to feed a list of results. Enter could do a query to the API server, which would update elastic every $time

Use Expo MapView

Switch to MapView.
1 - See if it can use OSM
2 - Update once current location is retrieved

Profile retains values from prev. profile

When navigating between profiles, if an user doesn't have a value set (ie Favourites), value from previously displayed profile is retained in this.props.navigation.state.params

Jest is broken

jest.log

Jest encountered an unexpected token
      This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

Drawer navigator error when switching with NewRideNavigator open

Steps to reproduce:

  • On the home screen tap New Ride (+)
  • Use the drawer to navigate to Profile
  • Use the drawer to navigate back to "Home"

Error output

[00:07:34] Error: Error: Error: Error: Error: There is no route defined for key Rides.
Must be one of: 'SelectLocation','CreateRide','RideDetail'

This error is located at:
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:478)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in AnimatedComponent (at screens.native.js:58)
    in Screen (at StackViewCard.js:42)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:507)
    in RCTView (at View.js:44)
    in ScreenContainer (at StackViewLayout.js:401)
    in RCTView (at View.js:44)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:49)
    in RCTView (at View.js:44)
    in Transitioner (at StackView.js:19)
    in StackView (at createNavigator.js:57)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at DrawerView.js:87)
    in RCTView (at View.js:44)
    in AndroidDrawerLayout (at DrawerLayoutAndroid.android.js:205)
    in DrawerLayoutAndroid (at DrawerView.js:84)
    in DrawerView (at createNavigator.js:57)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at SwitchView.js:12)
    in SwitchView (at createNavigator.js:57)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at App.js:36)
    in RCTView (at View.js:44)
    in App (at registerRootComponent.js:17)
    in RootErrorBoundary (at registerRootComponent.js:16)
    in ExpoRootComponent (at renderApplication.js:34)
    in RCTView (at View.js:44)
    in RCTView (at View.js:44)
    in AppContainer (at renderApplication.js:33)

ListView deprecated in SignInScreen

Error:

Warning: ListView is deprecated and will be removed in a future release. See https://fb.me/nolistview for more information
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- node_modules/react-native/node_modules/fbjs/lib/warning.js:30:18 in printWarning
- node_modules/react-native/node_modules/fbjs/lib/warning.js:51:23 in <unknown>
- node_modules/react-native/Libraries/Utilities/warnOnce.js:29:10 in warnOnce
- node_modules/react-native/Libraries/react-native/react-native-implementation.js:70:6 in ListView
- node_modules/react-native-modal-filter-picker/src/index.js:15:14 in ModalFilterPicker
- node_modules/react-proxy/modules/createClassProxy.js:94:29 in instantiate
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:7324:26 in constructClassInstance
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:11479:6 in updateClassComponent
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:17276:21 in performUnitOfWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:17316:41 in workLoop
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:17417:15 in renderRoot
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:18423:17 in performWorkOnRoot
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:18324:24 in performWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:18285:14 in performSyncWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:18169:19 in requestWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:17969:16 in scheduleWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:6934:17 in enqueueSetState
- node_modules/react/cjs/react.development.js:335:31 in setState
- node_modules/@react-navigation/native/src/createAppContainer.js:377:22 in dispatch
- node_modules/@react-navigation/core/lib/module/getChildNavigation.js:1:1529 in <unknown>
* screens/SignInScreen.js:88:37 in maybeSignUpOrError
* screens/SignInScreen.js:40:48 in <unknown>
- node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:25 in <unknown>
- ... 8 more stack frames from framework internals

Small header when scrolling down

When scrolling down eg a profile, it could shrink into a header with little profile pic and maybe cover as a background?
Same with ride detail and map?

Trail scrolling/pagination

Pagination should be considered / API currently returns 20 items and doesn't support pagination. Whistler BP has >100 trail entities so pagination is necessary here.

  • Location.trailsLoaded = { completed: bool, loaded: int }
    • Using loaded for offset, which is passed onto the API.
    • completed is false until all items are loaded
  • Location.trailsLoading (see UserStore.loading) for list components to display "loading more" while displaying trails already known
  • API Provides "total_trails_mtb": "62",, load until such number is reached? (same applies for total_routes)
    • number seems to be off, ie location #21 returns total_trails: 62 and 66 items

Originally posted by @kachnitel in #60 (comment)

Search / filter within location trails

  • Show filtered result while doing a bg request GET /locations/{id}/trails/filter that adds results to store
  • Location.trailsLoading should indicate whether everything's loaded or still loading
    • show spinner below/above(?) list while waiting for request

Originally posted by @kachnitel in #60 (comment)

Push notifications

Resources:

Expo Notifications class
Handling notifications

Implementation:

Tokens DB:

user token
1 a1s2d3
1 1a2s3d

Friends:

Send request:

  • UserStore.requestFriend
    • (NotificationsProvider?).post(userId) where userId = requested friend
  • Server receives the notification and sends to Expo with token(s) from tokens DB and requested ID in data

Receive request notification:

  • Notifications.listener data contains requester ID
  • Requester ID is added to UserStore.friendRequests

File upload isn't working

Log:

[22:32:21] POST api/users/123/picture picture Object {
[22:32:21]   "cancelled": false,
[22:32:21]   "height": 2448,
[22:32:21]   "type": "image",
[22:32:21]   "uri": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540kachnitel%252FRideTime/ImagePicker/c409f676-8093-4908-875c-23a1c30d2501.jpg",
[22:32:21]   "width": 2448,
[22:32:21] }
[22:32:21] FormData {
[22:32:21]   "_parts": Array [
[22:32:21]     Array [
[22:32:21]       "picture",
[22:32:21]       Blob {
[22:32:21]         "_data": Object {
[22:32:21]           "blobId": "6ef34134-166a-41db-ab89-bd470ae35a29",
[22:32:21]           "lastModified": 0,
[22:32:21]           "name": "c409f676-8093-4908-875c-23a1c30d2501.jpg",
[22:32:21]           "offset": 0,
[22:32:21]           "size": 4309834,
[22:32:21]           "type": "image/jpeg",
[22:32:21]         },
[22:32:21]       },
[22:32:21]     ],
[22:32:21]   ],
[22:32:21] }

Error:

Multipart body must have at least one part

The file uri from POST ... output is turned into a blob using XHR:

const urlToBlob = (url) => {
  return new Promise((resolve, reject) => {
    var xhr = new XMLHttpRequest()
    xhr.onerror = reject
    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4) {
        resolve(xhr.response)
      }
    }
    xhr.open('GET', url)
    xhr.responseType = 'blob' // convert type
    xhr.send()
  })
}

...and appended to request like this:

  let blob = await urlToBlob(file.uri)

  let formData = new FormData()
  formData.append(key, blob)
  let options = {
    method: 'POST',
    body: formData,
    headers: getHeaders(ApplicationStore.accessToken, 'multipart/form-data')
  }

  let result = await fetch(url, options)

Located at Connection::postFile

Invite Friends to ride

  • Get list of Friends of signed in User
  • Display a FriendList
    • showing level badge
    • Filter by ride level?
  • Submit to send invites
    • Count badge
  • Display somewhere with accept/dismiss

Distribute related entities to other stores

Distribute received entities to other stores (user receives locations, events in detail)

  • Should "primary" stores reference each other to be able to populate other type entities?

  • Should there be a store "Above" primary stores (not ApplicationStore) that would spread the goods, allowing for separation of stores

  • EntityManager - Sort of between both worlds

    • EventStore is currently receiving userStore (from singleton) prop in constructor
    • which would be instead imported in EntityManager along with other 2 collection store singletons and an EntityManager instance would be created, passed into each store's constructor?
      • Causes circular reference when same store is available within itself through the Manager
    • Each store would have EntityManager prop with all 3 primary stores, which would then be used to handle data with matching name (event => EventStore etc..)
      • In which case populateRelated could simply be moved into the mgr and stay clear of the BaseCollectionStore or individual stores, use the "key" to distinguish destination
      • EventStore would of course switch to EntityManager from using UserStore directly

Originally posted by @kachnitel in #51 (comment)

User not found on SignUpScreen

Determining user's existence is poorly designed.

Rewrite AuthController::signIn() on API to return a non-error message on 404 with an object indicating status, and userDetail on success.

SignInScreen then can simply read the status in response in authenticate and determine course of action depending on response.status (&& response.statusCode?), leaving error handling out of the decision making.

  • maybeSignUpOrError would just be signUp then

Rewrite SignInScreen::authenticate

Instead of API creating user and returning 201 on POST /signin, it should return 404 and then App would navigate to SignUpScreen with userInfo prop, which would submit to POST /signup

Deprecated `ListView` message on SignUp

Warning: ListView is deprecated and will be removed in a future release. See https://fb.me/nolistview for more information
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
...
...
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:6934:17 in enqueueSetState
- node_modules/react/cjs/react.development.js:335:31 in setState
- node_modules/@react-navigation/native/src/createAppContainer.js:377:22 in dispatch
- node_modules/@react-navigation/core/lib/module/getChildNavigation.js:1:1529 in <unknown>
* screens/SignInScreen.js:88:37 in maybeSignUpOrError
* screens/SignInScreen.js:40:48 in <unknown>
- node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:25 in <unknown>
- ... 8 more stack frames from framework internals

Publish app

Run a publish service after versioned commits.
Set api url and version for the release.

User profile friends do not show properly

Only an empty circle without a name is shown in the Friends list of an user's public profile

see ridetime-server#22

Update lists to return thumbnails for friends. Show list items using thumbnails, and when the list is displayed, run a 'populate' on background for IDs shown

Sign up

  • Style focused input
  • Home Locations setting
  • Select bikes
    • (multiple might happen in the future with better "bikes" support)
  • Select level
  • Include all fields in request
    • populate from store / UserStore.getUserObject() or so (depends on #28 )
  • Hide keyboard on [Next]

API errors on sign up

Need a better way to sign and handle requests sent during the sign up, before an user exists

Refactor stores Constructors

The store knows its own entity type, singleton doesn't need to know it and pass it back in constructor.

constructor (provider, EntityClass, applicationStore: ApplicationStore) {
    super(provider, EntityClass)
constructor (provider, applicationStore: ApplicationStore) {
    super(provider, User)

Working, but jest fails:

should move ID from requests to friends

    Trying to get entity User:undefined before it is initialized

getting currentUser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.