diff --git a/.gitignore b/.gitignore index 55a6fe8..e492ab1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,12 @@ building_data/ .env .DS_Store .netlify + +# IDEA IDEs +.idea/ +*.iml + +# VS Code IDE +.vscode/* +.history/ +*.vsix \ No newline at end of file diff --git a/README.md b/README.md index 1b3102a..dbc6f78 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ https://api.nycmesh.net/v1/kml ## Running locally -Clone the repo: `git clone git@github.com:olivernyc/nycmesh-api.git` +Clone the repo: `git clone git@github.com:Andrew-Dickinson/mesh-api.git` Install dependencies: `yarn install` Run the local server: `yarn start` @@ -58,8 +58,29 @@ OSTICKET_API_KEY= ACUITY_USER_ID= ACUITY_API_KEY= + +SPREADSHEET_APPS_SCRIPT_WEBHOOK_URL= +``` + +### Dev Database Setup + +A simple dev database can be configured by running + +``` +docker run -d -p 5432:5432 \ + --name meshcenter-test-db \ + -e POSTGRES_USER=meshdb\ + -e POSTGRES_PASSWORD=meshdb \ + -e POSTGRES_DB=meshdb \ + postgres ``` +Add these credentials to the `.env` file using a connection URL: +`postgres://meshdb:meshdb@127.0.0.1:5432/meshdb?sslmode=disable` + +Finally, initialize the database tables by running +`yarn migrate up` + ## Schema Currently, we use node numbers to represent join requests, members, and nodes. This schema is an attempt to detangle our data and create a common definition of the various components of the mesh. diff --git a/scripts/import-spreadsheet.js b/scripts/import-spreadsheet.js index 6ad746c..dcf3f83 100644 --- a/scripts/import-spreadsheet.js +++ b/scripts/import-spreadsheet.js @@ -7,7 +7,7 @@ importSpreadsheet().then(() => process.exit(0)); async function importSpreadsheet() { console.log("Fetching spreadsheet..."); - const spreadsheetRes = await fetch(process.env.SPREADSHEET_URL); + const spreadsheetRes = await fetch(process.env.SPREADSHEET_APPS_SCRIPT_WEBHOOK_URL); const { nodes: rawNodes, links, sectors } = await spreadsheetRes.json(); const nodes = rawNodes .filter((node) => node.address)