One-time steps to get the website repo setup locally on your machine.
-
If you don't have a GitHub account already, create one.
-
Create and register an SSH key with GitHub following the instructions here.
-
Create a fork of the datacommons website repo by clicking on the “fork” button on the top right.
Open a new terminal window and enter the following commands into a shell:
-
Clone your fork.
git clone <your repository fork here>
-
Add the main repository as a remote named “dc”.
cd <your repo folder> git remote add dc https://github.com/datacommonsorg/website.git
-
Initialize
mixerandimportsubmodules.git submodule foreach git pull origin master git submodule update --init --recursive
-
Set your user name and email for git.
git config user.name "Your Name" git config user.email "your.email@example.com"
-
Set merge settings to “no-rebase”.
git config pull.rebase false
-
Install uv
- Easiest way to install is with brew:
brew install uv
- Easiest way to install is with brew:
-
Install Python at version 3.12 (3.13 or above has an unmatched torch version). For version control, we recommend installing python using pyenv.
-
Install
gcloudfollowing the instructions here: https://cloud.google.com/sdk/docs/install -
Install nvm following the instructions here: https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
-
Use nvm to install node at version 18.4.0:
nvm install 18.4.0 nvm use 18.4.0
-
Install protoc at version 3.21.12:
On macs, you can install via Homebrew:
# On Macs, install via Homebrew (https://brew.sh/) brew install protobuf@21 -
On Macs with ARM Processors (M series chips), you'll also need the following:
# Using Homebrew (https://brew.sh/) brew install pkg-config cairo pango libpng jpeg giflib librsvg -
Make sure you have Google Chrome installed and install chromedriver. Make sure the version of chromedriver you install matches the version of Google Chrome you have installed.
On Macs, you can install via Homebrew:
# On Macs, install via Homebrew (https://brew.sh/) brew install chromedriver -
[Optional] Install Google Cloud CLI
The Google Cloud CLI is required to make place search work locally. To enable place search locally:
First, install
gcloudfollowing the instructions here: https://cloud.google.com/sdk/docs/install-sdk.Next, ask the Data Commons team to grant you permissions to use a Google Maps API Key.
Once you have a Google Maps API Key, authenticate locally with this command:
gcloud auth application-default login
-
Setup all python environments
cd <your local repository> ./run_test.sh --setup_python
If everything is set up correctly, you should be able to run each of the following from the base directory in separate terminals.
# Terminal 1
# Will not terminate
# Should see 100% at the bottom of output
# Need to run this before first time running ./run_server.sh
./run_npm.sh# Terminal 2
# Will not terminate
# Should see "Debugger is active!" in output
./run_nl_server.sh# Terminal 3
# Will not terminate
# Should see "Debugger is active!" in output
#
# Note: Make sure ./run_nl_server.sh is running first (See Terminal 2 above)
# this script will fail if a local NL server is not online
./run_server.sh -m# Terminal 4
# All tests should pass on an up-to-date master branch
./run_test.sh -a