{"id":28780533,"url":"https://github.com/nlesc/spot-server","last_synced_at":"2026-04-29T15:02:13.069Z","repository":{"id":20242868,"uuid":"89229046","full_name":"NLeSC/spot-server","owner":"NLeSC","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-30T23:48:45.000Z","size":777,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T18:07:27.949Z","etag":null,"topics":["database","filter","javascript","spot","sql","visualization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NLeSC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T10:45:50.000Z","updated_at":"2020-05-12T08:58:26.000Z","dependencies_parsed_at":"2023-01-11T20:46:28.397Z","dependency_job_id":null,"html_url":"https://github.com/NLeSC/spot-server","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NLeSC/spot-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLeSC%2Fspot-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLeSC%2Fspot-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLeSC%2Fspot-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLeSC%2Fspot-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NLeSC","download_url":"https://codeload.github.com/NLeSC/spot-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLeSC%2Fspot-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32430803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","filter","javascript","spot","sql","visualization"],"created_at":"2025-06-17T18:07:12.017Z","updated_at":"2026-04-29T15:02:13.063Z","avatar_url":"https://github.com/NLeSC.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spot-server\n[![Build Status](https://travis-ci.org/NLeSC/spot-server.svg?branch=master)](https://travis-ci.org/NLeSC/spot-server)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fd4e2ef5897943ddb1c41a44a5943e8f)](https://www.codacy.com/app/NLeSC/spot-server?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=NLeSC/spot-server\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/fd4e2ef5897943ddb1c41a44a5943e8f)](https://www.codacy.com/app/NLeSC/spot-server?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=NLeSC/spot-server\u0026amp;utm_campaign=Badge_Coverage)\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\n\nPart of the spot-framework, spot-server provides a connection a to a database (currently PostgreSQL) instead of the default crossfilter backend.\nIt will also host a static website fi. [spot](https://github.com/NLeSC/spot) using Express.\n\nAPI documenation [can be found here](https://nlesc.github.io/spot-server).\n\n## prerequisites\n- [PostgreSQL](https://www.postgresql.org) v9.5 or higher\n\nSpot requires either a local or a remote service to run. Commutication between the client and the database server is achieved by using [web socket](https://github.com/socketio/socket.io).\nBefore running the scripts, make sure that the Postgres server is up and running.\n\n - **Hint**: You may want to use [PostreSQL Docker image](https://hub.docker.com/_/postgres) for quick testing, if you don't have postgress installed on your system\n - make sure your postgres user does not need a password\n - [pg_isready](https://www.postgresql.org/docs/9.3/static/app-pg-isready.html) command might be useful to check the server status.\n\n## scripts\n\n### spot-server\n\nCombines this library with Express to host a website.\nIt uses a session file to keep track of database tables to serve.\n\nUsage:\n```bash\nnode scripts/spot-server.js -c 'postgres://USER@localhost/DATABASE' -s 'session_file.json' -w \u003cSPOT_DIST\u003e\n```\n\nHere, `SPOT_DIST` should be an absolute path to the directory with the built version of [spot app](https://github.com/NLeSC/spot). You can either use the pre-built [dist directory](https://github.com/NLeSC/spot/tree/app/dist) or build it yourself using `npm run dist`.\n \nrun following command to see available options:\n```bash\nnode scripts/spot-server.js --help\n```\nYou can get a bit more performance using the native PostgreSQL bindings (turned off by default to make travisCI easier). Just install the pg-native package:\n```bash\nnpm install pg-native\n```\nThis in only tested on linux, could work on other OSs.\n\n\n### spot-import\n\nImport files (CSV, JSON) into the database.\nIt also creates a session file. Usage:\n\n```bash\nnode ./scripts/spot-import.js -c 'postgres://USER@localhost/DATABASE' \\\n-t 'data_table' \\\n-s 'session_file.json' \\\n-u 'http://DATA_URL' \\\n-d 'Dataset description' \\\n--csv -f 'test_data.csv'\n```\n\nrun following command to see available options:\n```bash\nnode server/spot-import.js --help\n```\n\n\n# Notes\n\n## heap out of memory\n\nIf node crashes with `heap out of memory`, increase it using `node --max_old_space_size=4096`.\n\n# Security concerns\n\n## sql injection via `facet.accessor` and `dataset.datasetTable`\n\nFacet accessor can be set by the client, and is used unchecked in the query.\nRecommended to limit spot-server PostgreSQL privilege to read only.\nSee for instance [this blog post](https://blog.ed.gs/2016/01/12/add-read-only-postgres-user/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlesc%2Fspot-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlesc%2Fspot-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlesc%2Fspot-server/lists"}