Hello, friends! Today is all about setting up the project infrastructure for likes.fyi. My main task is to prepare code hosting and publish what I have.
tl;dr
official repo: github.com/likes-fyi
mirror repo: tangled.org/likes.fyi
code license is MIT, docs are CC BY-SA 4.0
likes.fyi is deployed to Cloudflare Pages
next up: some demos of what you can do with likes.fyi
Planning
I need to make a few decisions:
which license(s) to use
how to structure the repo(s)
where to host the code
where to host the website(s)
Licenses
For the code it's the MIT License1. I don't like to put restrictions on how people use my code. If I didn't want you to use it I wouldn't be sharing it.
For the documentation I'm going with CC BY-SA 4.02. My intent here is to keep the documentation open and to encourage people who build on top of it to share what they've built. If this license is a problem for you please get in touch.
Repo Structure
I've been considering a monorepo for this project. I've always been a multirepo kind of guy but I've been wanting to try the other way and see how it feels. I was thinking it would be nice to be able to make atomic commits that touch multiple projects especially during early development when the schema is in flux. It would also be convenient for the user to be able to download a single repo and have everything they need to start building.
On the other hand, figuring out how to work in a new repo structure brings a lot of cognitive overhead along with the need to adapt existing tools and practices. I want to reduce friction as much as possible and I think right now that means going with the old and familiar.
Final decision: multiple repos. It's easy enough to consolidate them later anyway.
Code Hosting
My default is always GitHub. Like many open source developers I'm very familiar with it and I expect most of my audience is as well. But GitHub has been struggling lately and it has me exploring alternatives.
Tangled is a source hosting app built on atproto. It's simple and clean and it has some interesting features around self-hosted workers that I might like to explore. Projects on GitHub are more discoverable3 than projects on tangled though.
I think the best option is to publish to both. GitHub will be the authoritative repo because for better or worse it's still where the action is. Repos will be mirrored to tangled.
Web Hosting
Normally I'd start with GitHub Pages but as I mentioned above I'm exploring alternatives. Tangled has their own website hosting system but the lack of custom domains4 is a dealbreaker and so I didn't look any further into it.
I'm already using Cloudflare for DNS and their Pages product looks pretty good. Workers also looks interesting if we need serverless in the future. I think I'll move likes.fyi to Cloudflare.
enough talk
Okay, let's get to work. I started by creating the likes-fyi organization on GitHub and the likes-fyi/website (github) and likes.fyi/website (tangled) repos. This entire process took less than ten minutes, including creating new accounts on tangled.org, creating the org on github, creating the repos, setting up permissions, and pushing.
Cloudflare Pages
Next up is trying out Cloudflare Pages. So far I've been interacting with Cloudflare exclusively via Terraform but for this one I'm going through the console. I'm just not at all familiar with the Pages product and I find that you're more likely to be successful if you use the console at least once to get the hang of it before you start automating.
Cloudflare Pages has an integration available for GitHub so we'll use that. The setup process was super easy. When going through the setup flow for the integration I limited its access to just the website repo. I had to restart the setup flow in the Cloudflare dashboard several times but that's probably my fault.
I had to configure the Cloudflare builder for Astro and tell it to use pnpm but aside from that it was just a couple of clicks. After it built and deployed I verified that it was visible at its .pages.dev URL. At this point I was feeling good enough about this to commit so I used the Custom Domains tab in the Pages UI to tell it I wanted to use likes.fyi. Since the DNS is also hosted at Cloudflare that's all I had to do. Five minutes later and likes.fyi is on Cloudflare Pages.
Repo Mirroring
I'd like to have the repos on GitHub automatically mirror to tangled without user intervention. I found a workflow action that should work so let's give it a shot. First I'm going to generate a new SSH key:
$ ssh-keygen -f /tmp/tangled -C "likes.fyi git mirroring key" -N ''I added the public key to tangled and saved the private key to my password manager. Then I added the private key as a organization secret on GitHub. Finally I added this workflow to the repo:
name: mirror to tangled
on:
push: {}
workflow_dispatch: {}
permissions:
contents: read
pull-requests: read
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: gwennlbh/to-tangled@v0.5
with:
repo: likes.fyi/website
ssh-key: ${{ secrets.TANGLED_MIRROR_KEY }}I pushed the change to GitHub and waited about 10 seconds before verifying that the commit made it to tangled. Like most of the process so far this was surprisingly easy.
What's Next?
That's all I had on my list for today. My next big task is to build some demos that show off the core features of likes.fyi. I also need to spend some time migrating these blogs to the website and writing more about what likes.fyi is and what it does.
At some point I'll come back and add what we did today to the terraform code. It also needs to be cleaned up and published but that project is probably going to be on the back burner for a while.
Anyway, thanks for hanging out with me today. Hopefully we'll be out of the boring stuff soon and onto interesting new developments. Happy Tuesday!