--:--:--

~/blog/why-i-built-aniwhere

· 4 min read

Why I built Aniwhere

Three ads, a few redirects, and a late-night idea turned into a self-hosted anime app I wanted to use every day.

  • Aniwhere
  • Self-hosting
  • Open source

Aniwhere exists purely out of irritation.

I opened my laptop one night wanting to start a project before bed. I figured I'd put some anime on my iPad while I worked. I'd been meaning to rewatch Bleach and actually finish it this time, so that seemed like a good place to start.

Then I opened 9anime and immediately got hit with three ads and multiple redirects. I hadn't even started an episode.

On my laptop, I'd normally have an ad blocker running. On the iPad, setting one up wasn't something I'd even considered. Instead, that annoyance sent me down a completely different path: what if I built my own anime viewing app and hosted it on my server?

That became the project for the night.

The idea was already halfway there

I'd come across ani-cli a while before this. It's a tool for finding and watching anime from the terminal, and I thought it was interesting. I just didn't have much reason to use a command-line interface for watching shows.

What I hadn't considered was separating the useful part from the interface. What if I used ani-cli to find the stream sources, then built a proper web app around it?

The server could handle finding the streams, and I could browse and watch from the iPad. I wouldn't need to interact with a terminal every time I wanted to put something on.

Getting it onto my server

I created an LXC container in Proxmox, added it to my Tailscale network, and started building. The container gave the app its own environment on my server. Tailscale let my devices reach it over a private network, including when I was away from home.

I also knew I wanted to spend time on the interface. Getting a video to play was the starting point, but I wanted something I'd actually enjoy using. Crunchyroll and Netflix were the standard I had in mind for browsing and playback: something that felt like a streaming app, with the convenience I'd expect from one.

Within about 30 minutes, I had a working version. I could browse for shows, play streams, and keep track of what I'd watched and what I planned to watch.

That was enough to solve the original annoyance. It also made it much easier to see what I wanted to add next.

Finding something to watch

About an hour and a half later, I'd added more features, including collections.

Collections group shows and movies by franchise or animation studio. Studio Ghibli was an obvious example: put its films together so I could browse them in one place. The same idea works for a series with multiple seasons, movies, or related shows.

I wanted finding the next thing to watch to happen inside the app. If I liked something from a studio, I could look through its other work without leaving to Google recommendations.

That's where Aniwhere started growing beyond a way to play an episode. I was building the browsing experience I wished I'd had in the first place.

Making the next episode ready

Once the basics worked, I started improving playback performance.

Playing an episode directly from an external source means depending on that source while you're watching. I already had a server sitting there, so I wanted it to do some of that work ahead of time.

I added advance downloads based on the shows I was watching. The server could fetch upcoming episodes and keep them locally, ready for when I wanted to watch. Once an episode was downloaded, playback could come from my own server instead of fetching the video from an external service as it played.

It still needs the external source to get an episode in the first place. The improvement is moving that wait ahead of the moment I press play.

Why I made it open source

Eventually, I decided to release the app publicly.

I'd been seeing more developers share the software they built for themselves, and my reaction was pretty much: why not? I already had something I liked using. Other people with a home server might want the same thing.

Making Aniwhere public meant sharing the code so people could run their own instance. The app on my server could stay personal, while someone else could install it on theirs and make it part of their own setup.

I thought it would be pretty cool to have something out there that other homelab enthusiasts could use, change, or build on.

A project I keep wanting to improve

I went into that night looking for a project to work on before bed. A few ads gave me one.

What kept me working on Aniwhere was having a use for it. Each time I watched something, I had another chance to notice what was slow, what was awkward, or what would make choosing the next show easier. The feature ideas came from using the app myself.

If you want to try it on your own server, the Aniwhere project page has an overview and installation links. The code is on GitHub.