Lemmy Lite Save

A static, JSless, touch-friendly Lemmy frontend built for legacy web clients and maximum performance

Project README

lemmy-lite

A static, JSless, touch-friendly Lemmy frontend built for legacy web clients and maximum performance

This project is not intended for official use, but rather as a proof-of-concept for pre-rendering Lemmy. Eventually it will transition into a microservice that is ran alongside Lemmy, for example, under lite.lemmy.com or lemmy.com/lite. Ideally it will run on the same machine removing any extra latency in API calls.

Built With

Features

  • Open source, AGPL License.
  • Cross-instance support, get a lite version of any Lemmy instance.
  • JSless using pre-rendered HTML and CSS only.
  • Touch and mobile friendly.
  • Small screen support, as small as 320px.
  • Internet Exporer and NetSurf compatible.
  • High performance.
    • Written in rust.
    • Static, only one1 tiny request per page.
    • Supports arm64 / Raspberry Pi.

Installation

  • Symlinks won't work since nginx user (root) requires ownership of linked file
  • Pigz static to allow serving of compressed files for lower bandwidth usage
cd lemmy-lite
pigz -rk11f static
cp -rf static /etc/nginx/lemmy-lite
cp -f lemmy-lite.conf /etc/nginx/sites-enabled/
systemctl start nginx
cargo run --release

Pictures

Android Desktop iOS
android desktop ios

Notes

  1. As of 0.2.0 (Aug2020) worst case scenario (240 comment thread) takes 9ms to render on server.
  2. First load fetches a stylesheet, favicon, and svgs. These are cached so all subsequent pages require only a single HTML request.
  3. I use CSS Tables instead of FlexBox and Grid because Tables are faster, simpler, and have much better legacy support. Using CSS tables over HTML tables avoids excess DOM objects.
  4. Each page refresh is limited to API critical chain of 1 to limit the impact on instances and to keep page times fast.
  5. 1.0.0 is set for when account functionality is stabilized.
  6. Ideally, static content is served through a CDN to further improve server performance and response times.
  7. Strictly only uses characters from BMP for legacy font support.
  8. Catch me developing lemmy-lite on my streams at Twitch or YouTube
  9. SVGs hand optimized using Aydos SVG Path Editor

TODO

  1. Fix user and community links (change markdown interpretation for same-site links)
  2. Consider not supporting UTF-8 and only using ASCII characters for data size and better legacy font support.
  3. Consider switching from Maud to Sailfish to improve performance.

Quirks

  1. CSS word-spacing is broken on iOS and NetSurf

Update Script

killall lemmy-lite
git pull
rm static/*.gz
pigz -rk11f static
for i in static/*gz; do
  [ -f "$i" ] || break
  j="${i%.*}"
  if((`stat -c%s "$i"`>=`stat -c%s "$j"`));then
    echo "$i is larger than base, deleting"
    rm -f "$i"
  fi
done
sudo rm -rf /etc/nginx/lemmy-lite
sudo cp -rf static /etc/nginx/lemmy-lite
nohup cargo run --release &
Open Source Agenda is not affiliated with "Lemmy Lite" Project. README Source: IronOxidizer/lemmy-lite
Stars
80
Open Issues
4
Last Commit
9 months ago
License

Open Source Agenda Badge

Open Source Agenda Rating