Stampy UI is an interface for aisafety.info, a questions and answers site about AGI safety, built with Remix and Cloudflare Workers. When reading about existential risks becomes "too serious", we also have a more playful version of the site: stampy.ai.
Contributions are welcome, the code is released under the MIT License. If you'd like to join the dev team, drop by our Discord and post in #stampy-dev!
<input placeholder=...>
of the search boxpreferred-color-scheme
system setting)Requirements
Clone the Repo
git clone https://github.com/StampyAI/stampy-ui.git
Setup in Cloudflare Dashboard
Workers
: Overview
, note your Cloudflare Account ID
on the rightWorkers
: KV
, create a KV (key-value store) namespace STAMPY_KV
STAMPY_KV
Namespace IDwrangler.toml.template
to wrangler.toml
{CLOUDFLARE_ACCT_ID}
and {STAMPY_KV_ID}
in wrangler.toml
Setup in Coda.io
4.1 (Required) Setup read access to the API view in Coda
Note: Content in Coda comes from parsing Google Docs (so that site visitors can make suggestions that will be reviewed by our editors). The parser lives in the GDocsRelatedThings repo.
When logged in to Coda, Generate API token
in your Account settigns
Add restrictions: Doc or table
, Read only
, for the doc with url https://coda.io/d/_dfau7sl2hmG
(you need access to the doc of course, which you can request on the Discord)
Replace the value for {CODA_TOKEN}
in wrangler.toml
4.2 (Optional) Setup write access to the API write view in Coda
Note: This step is only needed for incrementing counters (helpful, etc.). There isn't a test environment, so any changes there will also effect the live site, so think twice before using them.
Generate API token
in your Account settingsDoc or table
, Read and Write
, for the table with url https://coda.io/d/_dfau7sl2hmG#_tutable-eEhx2YPsBE
{CODA_WRITES_TOKEN}
in wrangler.toml
4.3 (Optional) Setup write access to the "Incoming questions" table in Coda
Note: This step is only needed if you want to add new questions to Coda, or you want to mark answers as helpful. Seeing as they will then go live, it would probably be better to only set this if you are working on those specific component, in order to not mess up the list of incoming questions.
Generate API token
in your Account settignsDoc or table
, Read and Write
, for the table with url https://coda.io/d/_dfau7sl2hmG
{CODA_WRITE_TOKEN}
in wrangler.toml
Create stampy-ui Remix environment
cd stampy-ui
npm install
to install all the dependencies required to run the current version of stampy-ui.Once that's done, you should be able to test and deploy your app!
$ npm run dev
$ npm run lint
$ npm run test
Tests may rely on cached data from coda. This data can be refreshed by running:
$ npm run refresh-test-data
$ npm run deploy
Production domains are deployed via GitHub Actions.
If the same CF worker should be reachable from another domain:
Add a site
button on homepage, choose the Free plan
Add record
for 2 new CNAME records:CNAME @ stampy-ui.stampy.workers.dev
CNAME * stampy-ui.stampy.workers.dev
Add route
with the new domain (e.g. example.com/*
and select the zone to the just-added site)