Clone the repo. In RStudio, run `library(targets)` and `tar_make()`. This will require `tidycensus` credentialing to run, see instructions below.
Clone the repo. In RStudio, run `library(targets)` and `tar_make()`. This will require `tidycensus`and `sciencebase`credentialing to run, see instructions below.
To access controlled ScienceBase items, an additional step must be completed to authenticate a ScienceBase session before the targets pipeline is run.
1. Ensure `.gitignore` includes a line for ".Renviron" to prevent credentials from being committed the the repository by git.
2. Run the entire contents of `00_config.R` either (1) interactively (i.e., line by line) or (2) by running `source("00_config.R")`.
3. You will be prompted to enter the token text by R/Rstudio. A browser window should pop-up directing you to <https://sciencebase.usgs.gov/manager/> to login.
4. Once logged in, copy your API token: click the account drop down button (person shaped icon) and click **Copy API Token**.
5. Paste the API token into the RStudio popup.
Once the above steps are complete, `initialize_and_cache_sb()` will cache your username and token into the .Renviron file. From here, the pipeline should be able to use those cached credentials to re-initialize and refresh ScienceBase sessions in different R sessions for up to 10 hours.
## Building the website locally
Clone the repo. In the directory, run `npm install` to install the required modules. Once the dependencies have been installed, run `npm run dev` to run locally from your browser.