friendship ended with social-app. php is my new best friend
PHP 85.6%
SCSS 1.4%
JavaScript 0.2%
Hack 0.2%
Other 12.5%
192 1 0

Clone this repository

https://tangled.org/veryroundbird.house/smallbird-social
git@nest.veryroundbird.house:veryroundbird.house/smallbird-social

For self-hosted knots, clone URLs may differ based on your setup.

README.md

smallbird social#

i'm sure you have a question and that the question is this:

why would you do this.#

to test my abilities.

also, for some reason social-app's dependency install situation is fucked for me and rather than try and fight node's gdawful ecosystem i decided to just see how much i could accomplish in php with as few dependencies as possible and as little javascript as possible because i'm so fucking tired of dependency chaining where i'm instaling 80384498549320934 packages and don't know what 90% are.

i also just think it's funny to write things in php in this day and age.

similarly to red dwarf, my approach is to try and use data from outside the core bsky servers as much as possible (so, getting DID info directly from their DNS/.well-known, pulling info from plc.directory and constellation, etc) to reduce reliance on a singular entity. you can set a default fallback public API to try and resolve information; by default it's set to the bsky api. if another public API comes into being i might switch it to that.

is it going to have [x] feature#

maybe! i'm not sure if i can or will go for 100% feature parity but i'm going to try my darndest

the idea is

  • no javascript components just straight vanilla javascript (except the compilation tools)
  • only the javascript required to load new posts and set settings
  • use as much native html functionality as possible (popovers, details/summary)
  • work around the central bsky servers whenever possible
  • keep it runnable on a potato
  • maintain admin flexibility with respect to data sources and themeing

tdl#

  • Move profile rendering to bskyRenderer lib file (and also fix the rendering)
  • Unmove profile rendering and then move it to template files
  • Implement feeds page (still dependent on bsky)
  • Implement search (still dependent on bsky)
  • Make settings page???
  • Create account page
  • Hashtag feed page (still dependent on bsky)
  • Move interaction stuff to the renderer
  • Apply facets to text
  • Templating engine??
  • Make login page actually work
  • Figure out how to do threading (never mind threading sucks)
  • User authentication (:C)
  • Fetch next set of items when user hits bottom of container
  • ?? how to get following count ??
  • Make the interaction buttons work
  • Posting box
  • Figure out how to run Constellation server despite build time for rocksdb being FOREVER
  • More color themes? (i have priorities)
  • Figure out why pages cut off loading halfway (why)
  • Find out how to implement a better concurrency version of sqlite
  • Add more exception handlers so it 500 errors less

thanks to#

  • pdsls.dev for helping me figure out what API endpoints to call from the network tab
  • constellation and slingshot for a lot of data fetching to reduce load on PDS + dependence on bsky.app
  • plc.directory and plc.parakeet.at for plc lookups
  • red dwarf for being inspirational (and also helping me figure out what API endpoints to call)
  • bailey townsend because i stared at your rust oauth code for several hours trying to divine how to make PHP work. thank you

dependencies#

  • guzzle (for http requests)
  • monolog (for logging; mostly just a dev thing)
  • flight (for routing)
  • latte (for templating)
  • opengraph (for what you'd expect)
  • php-oauth (also for what you'd expect)

suppose i am someone who wanted to install this#

ok wowee!! just so you know this isn't fully cooked yet so there's a lot of features missing. there's a lot of stuff that goes into one of these things as it turns out. but if you really want to:

  • edit the values in config.php. if you don't have a pds you're willing to let people sign up with or don't have a favorite (or don't know what that is) just leave it set as-is. you'll need to graph the atURIs of feeds to use for your frontpage/favorite feeds area; you can look those up using pdsls.dev.
  • copy .env.example to .env and add your secret values to it.
  • copy the files in the data folder and remove the .example suffix. these are for globally banning/suspending people at the client level (e.g. if you just don't want anyone to be able to see jsse sngal on your client).
  • get composer if you don't have it and then do composer install in the folder
  • install a javascript runtime if you don't have one (e.g. node.js, bun, deno) and a package manager if you're using regular node.js (e.g. npm, pnpm, yarn) and then do [runtime/pkg manager] vite build to build the files. (you can also run [runtime/pkg manager] vite dev if you want to run a local server to check it out.)
  • make a jwks.json file (can generate one here; use ECDSA, ES256, and Signature as your options. delete the "d" key from the file before using) and put it in your root folder.

if you want the pretty urls you will want to run this on a server with rewrites, configure them, and set that to "on" in your config. it's not required! i feel like the ugly urls are part of the charm honestly

i think this is neat and i want to give you money#

my ko-fi is here and if you have, like, real jobs definitely hit me up