Code Monkey home page Code Monkey logo

recrun's People

Contributors

brydonleonard avatar kcranky avatar

Watchers

 avatar

recrun's Issues

Maps API Key

Google maps needs to be loaded client side, but we don't want to share the API key. Find out how we can load google maps with an API key, without sharing the key on the client.

Some notes

Lib folder:
Move router.js and startup.js into client folder
Move the publication in "tasks.js" into the server folder
Exporting the collection like you do in the tasks folder will work, but I prefer to have 2 separate scripts for the client and server

In mapElements.js:
It might be easier to make modular templates which you display conditionally, instead of generating the components with JS

Template.newrun.events['click #saveRunBtn']:
line 98 is interesting. (name: name = $("#runName").val(),). The "name = " could cause problems. JS scope is confusing

oldRun.js:
Try defining the formatDate and getDistance helpers with the runs() helper.
Create 2 methods that'll do the actual calculations in another script and import them into oldRun.js
Something like:
Template.oldrun.helpers({
runs(){},
formatDate(d){return formatDateFunction(d)},
getDistance(r){return getDistanceFunction(r)}
});

General
I'd recommend using "let" instead of "var". Scope is more predictable
Add event.preventDefault(); as a first line of any onclick events for elements. It saves a lot of unexpected bugs.
You can use JSDoc documentation for your methods. Just type /** and press enter on the line before one of them.
It'll allow your IDE to give code hinting for your methods.
This is for WebStorms, which I use

Branches/Spurs on routes

Oftetimes the API returns a route that requires a user to go halfway down a road, then turn around. Not very practical as a runner. Look into removing these branches, either by:

  1. Creating a new request by adjusting waypoint markers
  2. Editing the response returned from the API

Mobile - Turn on GPS

If the geolocation times out, show another form with the option to turn on GPS (for mobile). Perhaps use meteor.isCordova?

Type of run

I suggest that a user should be able to request the "type" of route they would like to run (basically by dictating the number of sides in the polygon used to generate the initial waypoints). My suggestions are:

  • There and back (2 sides)
  • Regular (3 sides)
  • Roundabout (4, 5 sides)

Check if route already saved

Should functionality be added to see if a route is already saved? Would need to do this by comparing requests - but the likelihood of these being exactly the safe is very slim (considering they contain randomly generated elements).

Option to go on a run

The user has a route - but what about actually giving them directions as they run? This should be added on the floating button menu. Possibly have a shortcut on the old runs page

Toasts on saving runs

Save run function was copy pasted to a method. I need to rewrite the code as to let notifications, etc happen client side, so the client knows their run is saved.

UserID on opening the app if logged in

If a user opens the app and they are logged in from the previous session, the oldruns tab shows they have no runs - likely from the Meteor.userId() not returning anything.

Delete old runs

Users should be able to delete old runs. Look at button on browser, press and hold/swipe on mobile

Map controls

The method of having controls on the map is not required, as this is only when the map is a pre-determined size (i.e you want controls ON the map).

Because the map is full screen size, consider moving to materialize buttons.

Viewport

Add viewports to properly display on all devices

Make useable app

Remove unimplemented features, such as stats and account settings. Leave this for a future update.

No stats

There is no statistics functionality

Map loading bar

Implement a loading bar into the map while we wait for the API to respond in onCreated() methods and when the user requests a new route.

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.