ukparliament / psephology-datasette

3 stars 0 forks source link

Accessing the database via an in-browser datasette instance served from GitHub Pages #2

Open psychemedia opened 2 months ago

psychemedia commented 2 months ago

datasette-lite provides a datasette instance that runs entirely in the browser and that can be served using a simple HTTP server.

The demo server running at https://lite.datasette.io can present a datasette view over a SQLIte database published on a public URL (https://lite.datasette.io/?url=ESCAPED_DB_URL). The database in this repo can thus be accessed in the following datasette instance:

https://lite.datasette.io/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fukparliament%2Fpsephology-datasette%2Fmain%2Fpsephology.db%3Fraw%3Dtrue#psephology

I imagine the index.html/webworker.js script could be simplified, or perhaps even configured, to produce a datasette instance that runs in Github pages site and that only displays databases pulled from the local repo [ @simonw ?].

fantasticlife commented 1 month ago

Hi Tony,

Oops. Sorry. Missed this.

We've added a datasette lite link to the homepage of https://electionresults.parliament.uk/

We can look into adding the same from: https://psephology-datasette-f3e7b1b7eb77.herokuapp.com/

@robertbrook