An open API service indexing awesome lists of open source software.

https://github.com/cablehead/stream-of-snippets

a personal stream of snippets
https://github.com/cablehead/stream-of-snippets

cross-stream denoland event-sourcing localfirst microblog solidjs vitejs xs

Last synced: over 1 year ago
JSON representation

a personal stream of snippets

Awesome Lists containing this project

README

          

A personal microblog that allows you to share a 'stream of snippets'—fragments of Markdown that you can append from the command line.

## a stream of snippets

a women projecting a 'stream of snippets', notes she's curated, kung fu cartoon styled, seemingly to save the world

### overview

This is a lightweight, static [SolidJS](https://www.solidjs.com) app that tails an [`xs`](https://github.com/cablehead/xs) event stream. It publishes frames with the topic 'snippet' and displays them as Markdown fragments.

### dev

```bash
$ git clone https://github.com/cablehead/stream-of-snippets.git
$ cd stream-of-snippets

# run the event stream in one window
$ xs serve ./store —expose :3021

# run vite in another window
$ deno task dev

# append a snippet in a 3rd window
$ echo "my first post" | xs append ./store snippet
```

![image](https://github.com/user-attachments/assets/ffcb4947-209f-407a-81b7-653d24d01eff)

[vite.config.ts](https://github.com/cablehead/stream-of-snippets/blob/main/vite.config.ts#L9-L14) is configured to proxy `/api/*` to localhost:3021, to expose the event stream


http://your-stream-of-snippets...
┌───────────────────────────────────────────────────┐
│ # proxy /api to xs │
│ # /api/* ◀─────────────────────────────────────┼────────┐
│ │ │
│ # otherwise serve the static SolidJS built dist │ │
│ # /* -> ./dist/* │ │
└───────────────────────────────────────────────────┘ │
┌─────────────────────────────┴─────┐
│ `xs serve ./store --expose :3021` │
└────────────────────────────▲──────┘
to publish: │
$ bp | xs append ./store snippet ]───────────────────┘

### screencasts and screenshots

https://github.com/user-attachments/assets/fba60beb-c5ae-42ba-97b4-e9564a74b722

image