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
- Host: GitHub
- URL: https://github.com/cablehead/stream-of-snippets
- Owner: cablehead
- Created: 2024-11-09T16:06:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T16:49:57.000Z (over 1 year ago)
- Last Synced: 2025-04-02T22:54:21.008Z (over 1 year ago)
- Topics: cross-stream, denoland, event-sourcing, localfirst, microblog, solidjs, vitejs, xs
- Language: TypeScript
- Homepage: https://ndyg.streamofsnippets.com
- Size: 109 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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

### 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
```

[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
