{"id":13623917,"url":"https://github.com/tmcw/stickshift","last_synced_at":"2025-04-15T20:32:45.296Z","repository":{"id":27008176,"uuid":"30472297","full_name":"tmcw/stickshift","owner":"tmcw","description":"A clean \u0026 modern SQL data interface.","archived":true,"fork":false,"pushed_at":"2017-04-10T21:31:10.000Z","size":871,"stargazers_count":369,"open_issues_count":0,"forks_count":30,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-04-11T19:05:05.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmcw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-07T22:19:03.000Z","updated_at":"2025-03-22T22:28:53.000Z","dependencies_parsed_at":"2022-07-17T20:46:59.483Z","dependency_job_id":null,"html_url":"https://github.com/tmcw/stickshift","commit_stats":null,"previous_names":["mapbox/stickshift"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcw%2Fstickshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcw%2Fstickshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcw%2Fstickshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcw%2Fstickshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmcw","download_url":"https://codeload.github.com/tmcw/stickshift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249148190,"owners_count":21220495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T21:01:36.935Z","updated_at":"2025-04-15T20:32:44.866Z","avatar_url":"https://github.com/tmcw.png","language":"JavaScript","readme":"# stickshift\n\nA clean \u0026 modern data interface: SQL queries into JSON, CSV, and charts,\ndone simply.\n\n![](screenshot.png)\n\n## Features\n\n* **Export** query results to JSON \u0026 CSV\n* **Visualize** some query results automatically\n* **Share** and save queries\n* **Responsive** on lil' screens\n\n## Installation\n\nThis project is meant to be run as a server. See [Stickshift.app](https://github.com/mapbox/stickshift-app) for a\nversion that works as a desktop application.\n\n```sh\n$ npm install\n$ npm start\n```\n\nOpen up `http://localhost:3000/` and play around: the testing server\ncreates three tables:\n\n**`fake`: random time-series data**\n\n```sql\nselect * from fake;\n```\n\n**`cats`: random categorical data**\n\n```sql\nselect * from cats;\n```\n\n**`places`: points in france**\n\n```sql\nselect * from points;\n```\n\nThen you can configure the server by editing configuration in [site.js](site.js).\n\nThe example in [example_server.js](example_server.js) talks to SQLite,\nbut you can swap in Postgres/RedShift using the `pg` module,\nMySQL using the `mysql` module, and so on. Or you can even just point\nstickshift at any URL that accepts queries over POST and returns\nresults as JSON.\n\n## Configuration\n\nStickshift exposes a JavaScript API of the form:\n\n```js\nvar Stickshift = require('stickshift');\n\nStickshift(element, {\n    // the http(s) endpoint to POST queries to and get results back\n    endpoint: '',\n\n    // GitHub access_token, used for saving queries\n    token: '',\n    // GitHub username, repo, and branch for saving queries.\n    username: '',\n    // Mapbox public token for maps\n    mapboxToken: '',\n    repo: '',\n    branch: ''\n});\n```\n\nCalling `Stickshift` props up the full interface and router within the given\nelement.\n\n## Architecture\n\n`stickshift` is built with [React](http://facebook.github.io/react/),\n[Flux](https://facebook.github.io/flux/),\nand [React-Router](https://github.com/rackt/react-router). It's written\nin CommonJS \u0026 ES6 and cross-compiled with [browserify](http://browserify.org/)\n\u0026 [babelify](http://babeljs.io/). Query storage is powered by [hubdb](http://github.com/mapbox/hubdb).\n\nStructure:\n\n* `src/components`: UI components, like the chart, table, and query interface\n* `src/stores`: Flux stores for saved queries \u0026 transient table information\n* `src/constants`: Constants for actions, like 'received table results'\n* `lib/` d3 \u0026 vega, for now, until [vega builds are sorted](https://github.com/trifacta/vega/issues/235)\n\n## Bring your own auth\n\nThere's no user login system built into `stickshift`: like your choice of\ndatabase, this is likely to be specific to your purpose, company, usage,\nand so on. Some common approaches include:\n\n* Running it locally or behind a firewall\n* Ditching `example_server.js` and integrating with a server that does\n  authentication, like through passport. This is what we do at Mapbox.\n\nIf you run this on anything but a `localhost`, it's really best practice\nto **create a read-only user**, since this is an interface for doing analysis\nthat should not have permissions to modify data.\n\n## Charts\n\nStickshift automatically creates charts for applicable queries: those\nthat\n\n* Have at least one column that is parseable as numbers.\n\nThe supported chart types are:\n\n* **Time series**\n  * Lines\n  * Stacked bars\n* **Categorical**\n  * Grouped bars\n* **Geographical**\n  * Points\n\nThese charts are rendered with [Vega](https://github.com/trifacta/vega).\nThey're designed for exploratory data analysis, so are relatively simple.\n\nMaps are rendered by [Mapbox.js](https://www.mapbox.com/mapbox.js/) with\n[Mapbox](https://www.mapbox.com/) tiles.\n\n## Development\n\n* Run `npm run develop` to continously rebuild source and run Stickshift\n  without a node server.\n\n## See Also\n\n* [re:dash](https://github.com/EverythingMe/redash) is a similar open source project\n* [airpal](https://github.com/airbnb/airpal) is similar but works with Presto instead of SQL servers\n","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmcw%2Fstickshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmcw%2Fstickshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmcw%2Fstickshift/lists"}