Node.js app that imports the top ~1000 shower thoughts from reddit, and displays the most amusing ones (per redditors' opinions) that match a given topic.
https://shower-thoughts-weaviate.dandv.me/
-
Set up the project:
git clone https://github.com/dandv/shower-thoughts-weaviate cd shower-thoughts-weaviate npm install
-
Optionally update the shower thoughts JSON file. The
shower-thoughts.json
from the repo is up-to-date as of 2023-July-12.npm run reddit # updates shower-thoughts.json from reddit.com
-
Create a Weaviate instance. This can be as simple as running the binary from the latest release, or signing up for a free Weaviate Cloud Services sandbox, or running a Docker container locally.
-
Create a
.env
file in the project directory with the following keys:OPENAI_APIKEY=...get this from https://platform.openai.com/account/api-keys... # The following two keys are only necessary if you use WCS; not if using Docker WEAVIATE_HOST=...sign up at https://console.weaviate.cloud... WEAVIATE_API_KEY=...get the Admin key from Weaviate Cloud Services... GRAPHQL_URL=http://localhost:3000/v1/graphql
-
Take note of the Weaviate cluster hostname, e.g.
localhost:8080
for Docker orshower-thoughts-ctv1de32.weaviate.network
if using WCS. Store this in the.env
file as theWEAVIATE_HOST
. -
For WCS, click on the cluster Details then the key 🔑 icon and copy the Admin key. Store it as
WEAVIATE_API_KEY
in the.env
file.
-
-
Create the Weaviate schema and import the data from the JSON file
npm run ingest
-
Launch the app server (a simple proxy necessary to protect the OpenAI key from being exposed on the client).
npm run server
-
Launch the web app
# in a new terminal... npm start