Giter VIP home page Giter VIP logo

alscotty / mapmyrunclone Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 89.98 MB

Fullstack web app inspired by MapMyRun; featuring Google Maps integration, likes/following, user-auth, activity feed, and workout downloads as GPX files

Home Page: https://rapmymun.herokuapp.com/

Ruby 0.77% JavaScript 98.47% CoffeeScript 0.01% CSS 0.63% HTML 0.12%
activity-feed distance workouts roads dashboard

mapmyrunclone's Introduction

RapMyMun

RapMyMun

RapMyMun is a fitness web application inspired by MapMyRun that allows for user running route creation. Users can log workout details, including duration, distance, and the route traveled. The app was created with React.js and Redux on the frontend, and Ruby on Rails/PostgreSQL on the backend.

The project was designed and built in a week, with some additional improvements added later on.

Highlights

  • Integrates Google Maps API to create run routes and enable distance tracking based on geolocation
  • Adheres to React and ES6 best practices to generate a true single page reactive web app experience
  • Developed a fluid UI to mimic the original website using SASS and HTML5
  • Implemented user authentication with BCrypt password encryption

home page

Features

Route Creation

create route

  • using Google Maps directions for rendering route and calculating distance:
    calcAndDisplayRoute(){
        let waypts=[]
        for(let i=0; i<this.state.coordinates.length; i++){
            waypts.push({
                location: this.state.coordinates[i],
                stopover:false
            });
        }
        
        const {coordinates,directionsService,directionsRenderer}=this.state;
        directionsService.route({
            origin: coordinates[0],
            destination: coordinates[coordinates.length-1],
            waypoints:waypts,
            optimizeWaypoints: false,
            travelMode: 'WALKING'
        }, (response, status)=> {
            if(status === 'OK'){
                directionsRenderer.setDirections(response);
                //calc miles
                var route=response.routes;
                let dist=route[0].legs[0].distance.value;
                let routeInfo = { ...this.state.routeInfo };
                routeInfo.miles = (dist * 0.00062137).toFixed(2);
                this.setState({ routeInfo })
            } else {
                window.alert('Directions request failed due to' + status)
            } 
        });
    }
  • Adding Google Roads API to keep the route on roads and prevent route from going through buildings, etc.
    snapPoint(lat,lng){
        let posArr=[lat,lng]
        $.get('https://roads.googleapis.com/v1/snapToRoads', {
            interpolate: true,
            key: window.googleAPIKey,
            path: posArr.join(",")
        },(data)=>{
            this.processSnappedPosData(data)
        });
    }

Activity Feed

  • Map rendering for routes on activity feed:
    renderIndMap(coordinates){
        let ren= new google.maps.DirectionsRenderer();
        let dir= new google.maps.DirectionsService();

        let map= new google.maps.Map(document.getElementById(`index-map-${this.props.route.id}`), {
            center: { lat: 37.773972, lng: -122.431297 },
            zoom: 13,
            maxZoom: 15,
            disableDefaultUI: true,
            gestureHandling:'none'
        });
        ren.setMap(map);

        let waypts = []
        for (let i = 0; i < coordinates.length; i++) {
            waypts.push({
                location: coordinates[i],
                stopover: false
            });
        }

Dashboard for Workouts

workouts

  • Workout dashboard dynamically renders depending on information provided (saved with a route, miles, time, etc.)
      {workout.time !=0 && workout.miles ? (
                    <span>
                    <br/>
                    Time:{workout.time} min.
                    </span>
                    )
                    : ''}
                    <br/>
                    {workout.route ? (
                    (<span>
                        {`${workout.route.miles} miles`}
                    </span>)
                    ): 
                    (<span>
                        {`${workout.miles} miles`}
                    </span>)
                }

Additional Resources

mapmyrunclone's People

Contributors

alscotty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

angelgomez144

mapmyrunclone's Issues

FSP To-Do List

Wiki Page Home

  • Is the first page you see upon entering the wiki
  • Contains a welcome message
  • Contains a link/placeholder for a link to the live page
  • All links in the right sidebar should contain each wiki page and link to the correct page
  • Correctly formatted
    • each wiki page is listed in bullet points
    • all links route the correct page

Comments


MVP List

  • Should have 7 MVPs.
    • 3 of those are User Auth, Heroku, and Production README.
    • The other 4 are from the MVP List or they have clarified them with you
  • Contains a description sentence of the app
  • Includes two to three detailed bullets on functionality and presentation of feature
  • At least one CRUD feature, which states what CRUD operations are planned (creation, reading, updating, deletion)
  • Estimates how long it will take the code each MVP
  • Correctly formatted
    • MVPs are listed in an ordered list
    • Each MVP is broken down into bullet points

Comments


Database Schema

  • Contains correct datatypes
  • Contains appropriate constraints/details
    • primary key
    • not null
    • unique
    • indexed
    • foreign key
  • Contains bullet points after the table that state which foreign keys will reference to which table, or references to the associations which will be made
    • foreign key and table name are lowercased, snake_cased and back_ticked
  • Correctly formatted
    • schema is written in a table format
    • the table's name are lowercased, snake_cased and back_ticked
    • the table header column names are bolded
    • columns names are lowercased and snaked_cased and back_ticked

Comments


Sample State

  • State shape is flat!
  • State's keys are camelCased
  • All keys within the values in the state are accessible in the schema
  • Correctly formatted
    • Sample state is rendered with triple backticks, and the language ```javascript...```). This will display the state as a code block instead of a giant line of text
    • Top level slices
      • entities
      • session
      • errors (here or in ui)
      • ui (if needed)
    • Should NOT have nested slices, aka comments inside of posts
      • Some info from other tables is ok, for instance:
        • the author username and imageurl for a post. basically any info that the user can't change
        • like count and a boolean on whether the user likes the post instead of a likes slice

Comments


Backend Routes

  • Contains the following sections: HTML, API Endpoints(Backend)
  • Each route has a description
  • API Endpoint routes contains wildcard variables written in snake_case
  • Routes does not contain superfluous routes
  • Have API routes that will allow the front end to get all info it needs and does not have unneeded routes:
    • probably doesn't need a GET likes api endpoint because that info comes through the post show

Comments


Frontend Routes

  • Frontend routes contains wildcard variables written in camelCase
  • Correctly formatted
    • Routes are displayed with inline coding text (backticks)

Comments

User Auth

  • Backend: DB, model, controller, views
  • Redux Loop: ajax, actions, reducer
  • Presentational Components
  • Styling
    • When errors are displayed, the form adjusts properly
    • Login and Signup looks as close to actual site as possible
  • Smooth, bug free navigation
    • Login errors clears when switching from login form to sign up form (and vice-versa)
    • Errors should display for both /signup and/login.
  • Adequate and appropriate seeds
    • Demo Login Works

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.