kcranky / recrun Goto Github PK
View Code? Open in Web Editor NEWA meteor app for generating and storing running/cycling routes. Used to teach myself meteor and some more JS.
A meteor app for generating and storing running/cycling routes. Used to teach myself meteor and some more JS.
User should be able to:
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.
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
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:
If the geolocation times out, show another form with the option to turn on GPS (for mobile). Perhaps use meteor.isCordova?
Need to genereate a how to/ help page, for how to use the app
Need to enable this functionality
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:
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).
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
Add avoid highways to directions request, for safety
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.
Need to add test cases
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.
Users should be able to delete old runs. Look at button on browser, press and hold/swipe on mobile
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.
The mobile app can take quite a while to generate a route. Add a loading bar while we wait for the map to load
Add viewports to properly display on all devices
Needs redesign - currently using default form in a modal. Looks terrible.
It seems that geolocation will only work over secure origins (goo.gl/Y0ZkNV). Need to look into SSL and HTTPs packages, or a workaround
The map should re-size to fit the window as the browser is adjusted/dragged.
Remove unimplemented features, such as stats and account settings. Leave this for a future update.
The log out button in the side nav appears to be broken.
There is no statistics functionality
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.