From 3b09102f8536d1a3d61a96c058a565f58b50978e Mon Sep 17 00:00:00 2001 From: Andrew Dickinson Date: Tue, 7 Feb 2023 19:50:44 -0500 Subject: [PATCH 1/4] Add database setup instructions to README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 1b3102a..5ee5444 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,25 @@ ACUITY_USER_ID= ACUITY_API_KEY= ``` +### 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. From 0724171c0c406c2000dc979f6fbb88bead067e98 Mon Sep 17 00:00:00 2001 From: Andrew Dickinson Date: Tue, 7 Feb 2023 20:20:35 -0500 Subject: [PATCH 2/4] Rename SPREADSHEET_URL env variable (#2) Co-authored-by: Andrew Dickinson --- README.md | 2 ++ scripts/import-spreadsheet.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ee5444..60e9471 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ OSTICKET_API_KEY= ACUITY_USER_ID= ACUITY_API_KEY= + +SPREADSHEET_APPS_SCRIPT_WEBHOOK_URL= ``` ### Dev Database Setup 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) From a7536d9ae7d9fec93b48228f15fc503c67151c94 Mon Sep 17 00:00:00 2001 From: Andrew Dickinson Date: Tue, 7 Feb 2023 20:21:58 -0500 Subject: [PATCH 3/4] Add VS code and IDEA folders to .gitignore (#3) Co-authored-by: Andrew Dickinson --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) 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 From 8df03aff84a81719c340229f7c0f628d5d5d82b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=84=D9=84=D9=A2=D8=AC?= <40523414+ll2jwork@users.noreply.github.com> Date: Tue, 7 Feb 2023 21:30:59 -0500 Subject: [PATCH 4/4] Update README.md Updated clone source to point to this current project. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60e9471..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`