OK so full disclosure: this wasn’t initially going to be a stardance project. To be perfectly honest, I’d forgotten hackclub existed until I got their weekly email, and then I realised I could retroactively submit this here.
So, here it is: a custom rust server that supports not just the custom & kinda funky website I built, but also runs a multiplayer server for my as-yet unfinished game Particles, a boardgame I built based on a (no offense) kinda crummy mobile app, a writeup from the two thousands for a now inaccessible windows game, and a footnote of a game in one of those ad-riddled ‘unblocked games’ websites that my sister showed me. I may go into more depth about that game as another project, but for now I’ll only talk about the server.
It’s pretty simple, to be honest: since I made it for me and my close friends, I felt no need whatsoever to try and verify the integrity of the game. There’s no anticheat, no simulation of results: all it does is handle lobbies (plaintext json files with a uuid for a name) and players (single-use UUIDs assigned on joining a lobby). All exploration of state, validation of moves, and win checking is handled on the client side.
If one of my friends exploits this system, it’s going to be very funny, and I can’t wait to see how they do. Until then, everything else can happen on the client side. All the server needs to do is manage https requests.
The static site is, amusingly a little more complex.
Inspired by friends like circulars, carmine cassie, and ravarcheon whose websites are relatively simple and yet, it seems to me, contain a piece of their souls that feels unique and delightful, the core purpose of this site is to incite a single moment of delight.
Or amusement.
I’d take a raised eyebrow, to be honest.
Look, I’m not a frontend developer. I kinda suck at visual design, and my website isn’t going to be labeled ‘pretty’ or ‘elegant’.
What I am is creative, and a bit of a sneak. I’m someone who likes puzzles. I’m someone who likes surprising my friends. And I’m someone who’s willing to offer an objectively worse experience to the masses in order to create a cool experience for the people who found it.
I’m not going to go into depth about what my ‘trick’ is here. It’s hardly a challenging riddle (in fact, I might revise it at some point to increase the challenge), but it is Neat and it provides the little jolt of excitement i’m looking for. And, crucially, while I didn’t want to use a full web framework like Actix, it required more complexity than just serving the path requested.
Thus, I designed a system based around a manifest.json file. It contains a dictionary, where each key is the path requested, and each value is another dictionary containing a few pieces of information such as filepath, Mime type, and… well, if you’re curious take a peek for yourself! (Do try and figure out the trick with the website before you look at the answers, though.)
anyways: i use the tiny_http crate to handle incoming requests, partially because i don’t wanna figure out certificates on my own, and partially because having requests as a struct is really handy.
Then there’s the final element of the trick: the HTML part. Without saying too much, it’s two similar pages with different css and then an SVG clipping mask :3
Hope people like it !!
This is kind of big for my first log, because I wasn’t initially planning on putting this on stardance.
Essentially, a few years ago I came across a video I’m not going to link where the youtuber detailed their troubled search for a good tag-based filesystem, before ultimately resorting to implementing their own. I thought that seemed pretty cool, and despite the fact I’ve never used nor felt a need for a tag-based system, I downloaded the project to try it out.
I was immediately struck by two things:
Look. There’s nothing wrong with python. It’s a useful language with many valid applications.
At the same time.
REALLY?
This is the best we can do?
IDK there was something that struck me as so lackluster about it that my immediate reaction was ‘I could do better than that.’
So here I now am to do just that.
The lightbulb moment that brought me back to the project a week or so ago was that I could probably implement the whole thing with directories and symlinks.
Basically, if I create a directory tree in which each directory is a tag and each file that has a symlink in that directory has that tag, then I have the capacity to apply as many tags as I want to a given file, I have the ability to nest tags, and searching these tags should be as easy as navigating a typical filesystem.
At a very basic level, this first log contains all those functions. You can add tags, remove tags, tag files, and search the tags, though each one of these functions has issues.
Things I plan to resolve in the future include, but are not limited to:
Tag adding/management:
There are also other bugs and behaviours I need to fix/improve. This project is also an experiment with test driven development for me, something I’ve heard much about yet not really played with much. Currently, all tests pass; I expect that to change soon.
I wanna make my code a lot less ugly rn too because I don’t like it rn.
Once the CLI is in a stable state, I plan on implementing a UI in iced-rs, which will really just be a frontend that calls the CLI. (Also considering figuring out how to rewrite the CLI as a library that I can use directly, but CLI functionality is a priority.)
uuh yeah that’s it for now don’t forget to like and subscribe for more epic tagging content.
Also if anyone actually thinks a tagging system would be useful for them please reach out with suggestions because I doubt im ever actually gonna use this system lol it just seemed fun to make.
okibaii