I've been an avid Reddit user since I discovered the website about 5 years ago. So, I've always wanted to build something with the Reddit API. There are a plethora of Reddit clients out there, but I am surprised that none of them have tried to style Reddit like a blog. Having recently joined Medium and noticing some similarities between the structure of both platforms, I thought it would be a fun project to browse Reddit through the Medium interface.
Reddium is a Medium-themed Reddit client. The Reddium interface converts
Reddit posts, discussions, and memes into well-crafted articles. Medium's
layout feels a little more readable than Reddit's, removing all distractions
and clutter. It also bypasses Reddit's frustrating mobile browser.
I was really excited about working on this project, as it was an idea I got really passionate about and I took the opportunity to try developing with new technologies such as NextJS and TailwindCSS. After sharing it on Reddit, the app received a peak of 15k users in a day.
Try Reddium here, or view the code.
Reddit and Medium share various similarities: both are blogging platforms that allow users to make posts and interact with them. The main difference between them is that Medium focuses on longer articles (3-7 minute read time) while Reddit has many different types of posts, with most of them being short sentences or containing no text.
With that said, the problem statement is:
How do we build an app that adapts all Reddit functionality into the current Medium interface?
This application would be built upon the Reddit API. For the rest of the tech stack, I chose NextJS, a React framework focused on performance and the developer experience, and TailwindCSS, a class-based CSS wrapper. This minimizes the amount of CSS I would need to write to recreate the Medium interface. I had a really positive experience using Vercel, and that was the reason I was tempted to try out NextJS, which is also developed by the Vercel team.
The Reddit API documentation was a mess. Visiting the official documentation
site, it would seem that the only way to use the API is to make the user
sign in into their Reddit account to obtain an OAuth token. However, there
is a hidden public API that does not require the token (although it is
slower and rate limited) which involves adding
.json to the end
of any Reddit URL.
With this knowledge in mind, the rest was straightforward. I recreated the Medium interface using Tailwind and, using my experience working with React, created reusable components. This made my code MUCH cleaner than my previous projects (my code management in Reddium is my proudest so far).
A minor issue I ran into was Private mode in Firefox blocking any XHR request done on the frontend after initial load because of CORS. This issue is prominent on some other Reddit web clients like unim.press. I found that creating custom server API points in NextJS (or any framework) that calls the Reddit API and calling those endpoints instead of the Reddit API directly, solves this problem.
I deployed Reddium at the end of November 2020. Intending for it to be a
joke project, I made sure there were no jarring bugs and shared it on
r/InternetIsBeautiful with a quirky title. Reception on its usefulness was
mixed, but the site reached a peak of 15K daily users and continues to
receive around 2K monthly users.
This project prompted some nice discussions about GDPR, the Reddit API, and NextJS (the CEO of Vercel even commented on it!) A few other developers have also forked the repository to look at the inner workings of such an app.