Skip to content

jacobpatterson1549/macro-measure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macro-measure

Docker CI

measure large distances with device gps

Dependencies

  • Node and npm are used to build the code
  • React is the javascript library that makes the site functional
  • Testing-Library is for testing
  • Workbox generates the service worker that allows users to install the site as a progressive web application and function offline
  • geolocation-utils is used for geographic coordinate distance and heading calculations

Building

The scripts in the package.json file perform build tasks.

  • npm install downloads build dependencies
  • npm run build compiles a production build to the build/ folder
  • npm start serves a development version of the site
  • npm test runs the tests in interactive mode, run CI=true npm test -- --coverage to generate test coverage to the coverage/ folder. To debug tests in Visual Studio Code, run npm test in a separate terminal and then run the command Debug: Attach to Node Process. The attach command can be searched for with ctrl+shift+p. If
  • npm clean removes dependencies, the production build, test coverage reports, and generated code, excluding user certificates and environment configuration files
  • npm eject removes react plugins that manage the majority of dependencies

HTTPS

The app must be run with TLS so the device location can be accessed. Use a fake certificate when running in development. Generate and install the public and private certificates using mkcert. Move the certificates to the project root directory and create an environment configuration file named .env with the contents below.

To create the certificates, the commands below are useful. This will create public and private certificates, localhost.pem and localhost-key.pem. Move them to the project root directory.

commands to create certificates:

mkcert -install
mkcert localhost

.env file contents:

HTTPS=true
SSL_CRT_FILE=localhost.pem
SSL_KEY_FILE=localhost-key.pem