HACKER Q&A
📣 MrThoughtful

How about a Reddit alternative where every community is a Git repo?


When I look at all the Reddit alternatives that come up, the problem seems to be that they all intermingle data structure, data storage, moderation, federation and frontend.

How about we build a Reddit alternative which just defines the data structure?

If each community is simply a directory, we could run such a thing as a git repo. Say we run the "aww" community with cute animal photos. Then the repo cold look like this:

    2023-06-12/
        Look at this funny cat/
            content
            comments/
                very funny
                i like her eyes
        Our dog climbing stairs for the first time/
            content
            comments/
                go dog go!

    2023-06-13
        A parrot singing a poem/
            content
            comments/
                but can he sing a book?
Every line with a / is a directory, every line without a / is a text file.

This already would:

    - Let everybody browse the content
      For example via github, gitlab, codeberg etc.

    - Let developers write content
      Fork the repo, add a file, send a pull request
Then we could take it from there and build frontends on top of it.

What does everybody think?


  👤 rektide Accepted Answer ✓
I love this idea a lot. It has huge promise.

There's a constellation of ideas around returning to the file system & destructing data, using flatter data & the file system to file data that have so much promise and hope. Using git as a next layer to syndicate.

9p is a well known pointer into this universe. There's less discussion/clarity around how an app or how a network ought become file system oriented, about what flat data architectures would be, but these humble ideas you have here I think show exceeding promise, are clear & reasonable a start that any dev of any language can see & grok (which is huge) & follow a long with. The sense is self evident.

One other humble pointer I might drop might be Hull: the alternative to shell that I'll never have time to implement. https://250bpm.com/blog:153/

I love how such a community as these could form & if things take a turn badly, folks can fork. They can abandon one host & shift to another instance to bave discussions on.


👤 throwaway81523
You might look at gitit, which is a git-based wiki. For a discussion forum with a lot of dynamic views though, I don't think git really brings advantages. You have to support different sorting and styling options, block lists, and so on. You end up wanting something more like a document database, or just SQL with some in memory data structures to track the state of busy pages.

👤 LinuxBender
When people post illegal content how do you quickly scrub it from the git history? Would there be risk of corrupting the repo if many moderators are simultaneously scrubbing contents? Would this cause some type of lock contention or perhaps CPU load issues? I ask because I have ran into corruption issues with git enough times that I always use rsnapshot to create file/inode level snapshots of them. Would you use different branches or repos per sub-forum?

I think this would need to be load tested and I suspect it would not scale as well as using a some form of a database for the metadata that just links to file storage.