A heatmap of your Strava data, designed for speed of loading. This is live at https://heatmapper.charding.dev/. Note that it probably requires a modern browser, and I have not tested it other than with versions of Chrome and Firefox from at least 2020.
Required software for developing: node and yarn.
Recommended: an IDE such as Visual Studio Code, tmux if you would like to use yarn serve
, and Docker with Docker Compose for deploying locally.
Please complete in full the .env
file, by copying sample.env
.
When you are ready to deploy, please also complete dist/.env
, by copying dist/sample.env
.
The following scripts are located at the root of the monorepo, and apply changes to both the frontend and backend.
Install all dependencies needed for developing and running the code locally.
Run both servers together, using tmux
.
Ctrl-C in either one will kill both.
See yarn serve
below for more information about how these servers work.
To leave this running in the background, the default shortcut to detach from a tmux session is ^b d.
It can then be reentered with tmux attach
.
The following scripts can be run in either the frontend or the backend projects.
Install packages for this one project.
Run a development server for this project. Note that the backend dev server will forward frontend requests to the latest local build of the frontend, and the frontend dev server will forward backend requests to the running backend server (on port 8080).
As this is a development server, the frontend will automatically recompile and reload on save. The browser’s dev tools will allow for Vue to be inspected, unlike when it is build for production.
Front
The server can be built to run in Docker using Docker Compose.
This will build both the frontend and backend, and place them together in the dist/
folder.
This is equivalent to running yarn build
in both projects.
Run the compiled Docker instance.
This will not reload the code; add the --build
flag to do so, or see yarn build-container
.
Add the -d
flag to run in the background.
Run docker-compose down -v
to stop the container permanently.
Run yarn build
followed by yarn container --build
, so recompiling both the frontend and backend, and updating and rerunning the container.
Note that if the container was previously left running with -d
, this will leave it running until it has been rebuilt, to minimise the downtime.
Deploy the container to a remote server, and (re)start it.
This will use the configuration in dist/.env
(see dist/sample.env
).
Run yarn build
followed by yarn deploy
, so recompiling both the frontend and backend, and updating and rerunning the container on the server.
Log in to your remote server.
If this fails, then yarn deploy
will also likely fail, so it is useful for testing.