diff --git a/README.md b/README.md index 71addeea..f97f6bf1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,18 @@ -### 🦜 PARAT: CSET's Private-sector AI-Related Activity Tracker +# 🦜 PARAT: CSET's Private-sector AI-Related Activity Tracker This repository contains the code that generates [PARAT](https://parat.cset.tech). -[company_linkage](/company_linkage) contains the code that generates the data behind PARAT: +* [company_linkage](/company_linkage) contains the code that generates the data behind PARAT: company resolution across datasets, publication counts, etc. -[web](/web) contains the code that generates the PARAT website from the company_linkage data. +* [web](/web) contains the code that generates the PARAT website from the company_linkage data. + + +## Setup The project python dependencies are listed in `requirements.txt`. Before running code in this repo: -1.) Make a new virtualenv: +1. Make a new virtualenv: ```bash python3 -m venv venv @@ -17,7 +20,10 @@ source venv/bin/activate pip install -r requirements.txt ``` -2.) `export GOOGLE_APPLICATION_CREDENTIALS=` - a service account json. You should have at +2. `export GOOGLE_APPLICATION_CREDENTIALS=` - a service account json. You should have at`` least BQ reader permissions, if you are a CSET user. If you are not a CSET user, then you will not be able to run some of this code as-is, since it depends on our internal BigQuery datasets. Please contact us if you are -interested in collaborating or spot any issues. \ No newline at end of file +interested in collaborating or spot any issues. + +3. [Install and run the web interface](/web/README.md#web-interface) + diff --git a/web/README.md b/web/README.md index 31c3f432..0d67b697 100644 --- a/web/README.md +++ b/web/README.md @@ -1,30 +1,41 @@ -### Web artifacts and data preprocessing code for PARAT +# Web artifacts and data preprocessing code for PARAT This directory contains the code that processes the data generated in [company_linkage](../company_linkage) for use in the PARAT website. It also contains a Gatsby project that contains the PARAT website generation code. +## Data updates + To update the text that is used in the various explanatory tabs, edit the markdown files in `raw_data/text/`. To update the tooltips, edit `src/static_data/tooltips.js`. To populate the necessary data from a raw clone of this repository, run: -1.) `python3 scripts/mk_tab_text.py`. This will read the markdown text files in `raw_data/text` and output them +1. `python3 scripts/mk_tab_text.py`. This will read the markdown text files in `raw_data/text` and output them as a javascript object containing html snippets in `src/static_data/text.js`. -2.) Grab the raw data and reformat it into a javascript object. You will need a service account with translation +2. Grab the raw data and reformat it into a javascript object. You will need a service account with translation and BigQuery reader permissions. To fully regenerate everything including images and Google Finance links (which take ~1.5 hours to generate), run: `python3 scripts/retrieve_data.py --refresh_raw --refresh_images --refresh_market_links`. Run `python3 scripts/retrieve_data.py -h` for more detail on what these parameters do. -Next, to run the site in development mode, do: + +## Web interface + +The new (v2) interface for PARAT is in the `gui-v2/` directory. + +### Development server +To start the development server: ```bash -cd parat -gatsby develop +cd gui-v2/ +npm install +npm run develop ``` -You should be able to view the site at `localhost:8000`. +The PARAT v2 interface will be available at `localhost:8550`. + +### Deploying release When any changes are ready for deployment, do: