Macrostrat's map interface is web portal to a geologic model of the Earth's crust.
Version 5 of the application transitions to using Vite for bundling and Vike for server-side rendering. We are working on updating this version for performance and stability.
- Clone the repository
- Pull down submodules (
git submodule update --init --recursive
) - Create and populate a
.env
file with the appropriate environment variables (See.env.example
for more information.) - Verify that you have access to recent versions of Node.js and the Yarn package manager (
node >= 16.0.0
andyarn >= 4.0.0
; runnode -v
andyarn -v
to check) - Run
yarn install
to update packages - Start the live-reloading development server with
yarn run dev
. The server will be available athttp://localhost:3000
by default.
Please see the Contributing guide for information on how to contribute to this codebase.
Spins up a instance of the website for development on the same node image used for prod.
docker run -it -p 3010:3000 -v $(pwd):/app -w /app node:20 git config --global --add safe.directory /app && yarn run dev
This is mainly here for reference, the actual prod image is built via Github CI.
docker build -t macrostrat:latest --build-arg PUBLIC_URL=/map/ --build-arg MAPBOX_API_TOKEN=<> .
If for some reason you want to run the prod image locally you can do it like so.
docker run -d -p 8089:80 macrostrat:latest
To deploy to kubernetes there is two steps.
-
Tag the image
You do this by
git tag <semver-tag>
andgit push --tag origin
-
Update the deployment in Kubernetes
You do this by updating the image tag here to whatever you tagged above: https://github.com/UW-Macrostrat/tiger-macrostrat-config/blob/main/manifests/development/web/deployment-patch.yaml
If you are developing locally and need to test authentication, you can
use a browser extension like CookieSync to automatically pull cookies from the production or development
site into your local environment. This will allow you to use the same session
information locally. The cookie that must be copied is called access_token
.
We will eventually build an enhanced authentication service to allow for easier local development.
MACROSTRAT_API_PROXY_DOMAIN="https://dev2.macrostrat.org"
VITE_MACROSTRAT_API_DOMAIN="http://localhost:3000"