Tightbeam - Week 2
This week went fast and much happened in terms of Tightbeam development. If you're just here for the new feature list, scroll to the bottom. for the novel, continue reading.
This week pretty much started with the continuation of my REST api -- a small ssb-plugin -- that could be used to query messages, likes and replies from a running ssb-server. It was super basic, but the POC got the job done. You can find the (now old) backend service here. If you ever feel like building something simple, take the code ;)
I managed to get markdown working too in the app itself, which was pretty nice!
And then Thursday happened.
After @mix had put out his Patchbay patchqll branch I had to try. It went south fast with new features and functionality exploding into the app.
All of a sudden I had access to pagination, threads, private messages, the whole shebang! I pretty much spend the next few days after that integrating graphQL queries and data until I was forced into some refactoring on Saturday.
It was then I realised that I needed some extra stuff. Stuff like being able to pull images from the server and making actual posts. So I left Patchbay behind and started working on an "improved POC" of "Tightbeam Hub". This hub would need to do 3 things to begin with:
- Host one or more SSB servers with PatchQL for the posts & a REST api for the rest.
- Be able to proxy incoming signals to the right ssb-server (added bonus: token based "authentication").
- Combine the ports of the Graphql end-point and the REST end-points into a single HTTPS signal for convenience.
on the other side, the hub would need to be
- Inneficient enough to not advertise big ammounts of people all "creating accounts" on a single provider, we're DWEB here.
So the "hub" sketch ended up to be something like this:
I put the code for the new hub on my gitlab server. It works pretty decently, but it obviously needs a better (JWT-based) authentication system as tokens are pretty unsafe. It's also just a POC. If you roll this anywhere, make sure your firewall is up, when calling for the service from a distance, setup HTTPS (instructions not included in the readme of the repo).
So that wraps this week up.
On the list of things that now started working:
On the hub
- Fetching posts, threads, likes, private messages, private threads and profile information through graphQL on
POST http://localhost:4000/graphQL
- Creating new Messages (posts, votes, abouts, private posts, etc.) through a REST end-point on
POST http://localhost:4000/posts/
On the phone app
- Start page with latest markdown parsed posts, with dates, likes, etc. paginating to infinity (or the end of your database).
- Thread views upon clicking on a post.
- Private message list with pagination ofc.
- Threads upon clicking on a private message.
- Working web-links (internal links, references and pictures aren't working yet).
- Ability to set the server-address of your hub as well as pasting in a token.
Other random videos created earlier this week:
- first patchql shenanigans
- thread are rad (IOS baby!)
- Music + code + vim = life (random older video)
Todo list for the coming week.
- Get blobs working.
- Fiddle around with the settings to allow continuous functioning of the app after changing server and token (need to restart now).
- Start using the already integrated feature on the hub side to post messages and go from a read-only app to a full blown app.
- fetch threads when clicking on post references in the markdown content of posts.
- Continue to research good practices and strategies to keep data-sets on the device for offline access.
- Cool things I didn't account for yet that will somehow be awesome and make me code all night.
Longer-term
- Profile pages & the ability to change one's profile information.
- Integrate features from desktop clients into the app (Who doesn't want to play chess "the nerd way" on the bus?).
Thanking some people
- The people behind #sunrisechoir. You folks are rock(et)stars!
- @piet and @mixmix for the amazing graphql stuff, code examples and pointers!