Sep 18, 2021

PodRex

https://getpodrex.com

About

I built PodRex for two reasons. One, it is hard to discover new podcasts. Two, I wanted to use the ListenNotes API in a project.

PodRex is a Google Chrome extension, with a Golang backend. I used Gin and the ListenNotes API to power the podcast recommendations, SendGrid to send emails, postgres for the database and Render for the infrastructure. https://getpodrex.com is built using Vue.

Since the ListenNotes API is not a free API I needed to limit a users access on how many searches they could perform a day. This means the project needed users accounts, a signup process, a login process, and a way to limit users search requests.

I used the fixed window counter algorithm to rate limit search requests. Each day has a fixed-time window that lasts for 24 hours. If the user does not have an active fixed-window, then on the first request, the user's fixed-time window is created and will expire in 24 hours. If there is an active window then the request is added to the existing count and we check to make sure the count is not greater than the quota.

For example: John sends a request at 10:30AM. He has no previous requests in the past 24 hours. So we create a new time window (10:30AM - 10:30AM the next day) with a count equal to 1. Each subsequent request in this time window, increments the count by 1. If the request would exceed the quota then the request is dropped.

Fixed Window

The downside of this approach is that a user could make double their search requests quota in a 24 hour time span. See the below diagram:

Fixed Window Double

This could be avoided by using a sliding window counter approach, however the simple fixed window counter satisfies my requirements.

Try the extension out here: https://getpodrex.com and let me know what you think!

Screenshots

PodRex Screenshot

PodRex Screenshot

PodRex Screenshot

PodRex Screenshot