gem install
bundle install
npm install
bundle exec rails db:setup
-to create database files and seed the databasenpm start
The project should then be available at the address localhost:3000
in your browserRuby version 2.5.1
, NodeJS
, and PostgreSQL version 10
installed on your machine
Requires Install of NodeJS
for node-package-manager (npm
)
The frontend is compiled with webpack
that generates a bundle.js
file from the entrypoint file /frontend/scout_my_skate.jsx
.
webpack.config.js
filesetUsersPosition(map) {
let pos;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(position => {
pos = {
lat: position.coords.latitude,
lng: position.coords.longitude,
};
map.setCenter(pos);
});
}
}
initMap() {
let map = new google.maps.Map(this.refs.map, mapOptions);
this.setUsersPosition(map);
this.directionsDisplay.setMap(map);
this.map = map;
this.map.addListener('click', event => {
this.addMarker({ lat: event.latLng.lat(), lng: event.latLng.lng() });
this.calcAndDisplayRoute(this.directionsService, this.directionsDisplay);
});
this.addLocationAutocomplete();
}