Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updaterepo #131

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ building_data/
.env
.DS_Store
.netlify

# IDEA IDEs
.idea/
*.iml

# VS Code IDE
.vscode/*
.history/
*.vsix
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ https://api.nycmesh.net/v1/kml

## Running locally

Clone the repo: `git clone [email protected]:olivernyc/nycmesh-api.git`
Clone the repo: `git clone [email protected]:Andrew-Dickinson/mesh-api.git`
Install dependencies: `yarn install`
Run the local server: `yarn start`

Expand Down Expand Up @@ -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:[email protected]: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.
Expand Down
2 changes: 1 addition & 1 deletion scripts/import-spreadsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down