Surveying internet and telecommunications companies on user privacy and freedom of expression
Make sure to have a recent version of NodeJS. This project is developed using NodeJS 14.
Once NodeJS is setup install all dependencies:
npm install
There are a few common tasks that developers and administrators of this website want to commonly do. This is a summary of each of these tasks and recipes on how to them. All of those tasks are executed on the terminal. Please see Setup Development Environment and make sure the environment and dependencies are set up.
- Update the site data
- Update HTML meta tags
- Fetch the latest version
- Commit data changes
- Deploy website
- Run the local development server
- Verify code quality
- Fetch the latest version.
- Run
yarn data
to regenerate the complete data structures for the website. See below for more information. - Commit data changes.
- Optionally: Run the local development server to verify the changes are working as expected.
- Deploy website.
The yarn data
commands regenerates the complete data structure for the website. This is usually the command you want to call. The yarn data
command is a wrapper for several more specialized commands that each generate a different aspect of the website data.
- The index raw data are stored in different CSV files in
./csv
. Theyarn data:csv
command generates JSON data that can be used by the website. - Narrative content is stored on Google Docs. To only update the narrative content run
yarn data:google
.
Calling yarn data
is equivalent to calling each of the specialized data commands individually.
- Fetch the latest version.
- Edit
data/html-meta.json
and update fields as needed. The file is in JSON format and consists of keys and values. Each key generates one entry in the HTML<head>
section in the form of<meta name="<key>" content="<value>" />
. The only required keys in this file aretitle
anddescription
. The other keys are taken as they are. - Commit data changes.
- Optionally: Run the local development server to verify the changes are working as expected.
- Deploy website.
git pull
yarn install
git add data
git commit -m "update website data"
git push
The website can be deployed to staging or to production. The deploy works such that it builds the complete website locally on your own computer and then copies your version of the website to the remote server.
yarn deploy
Use the -p
flag to deploy to production instead.
yarn deploy -p
yarn dev
Open http://localhost:3000/index2022 with your browser to see the result.
yarn verify
This will run yarn lint
and yarn type-check
.
There is a Storybook for UI component development.
yarn storybook
The Storybook is accessible at http://localhost:6006
.
The bin/indexctl.ts
script provides operational support for the index 2020. The command can be invoked with yarn indexctl
. See all available commands by calling yarn indexctl -h
.