This content originally appeared on DEV Community 👩💻👨💻 and was authored by Bryce Dorn
The news of the James Webb Space Telescope (JWST) being successfully deployed in orbit reminded me how fascinating outer space is. Hubble has already showed us how spectacular and unfathomably large the visible universe is, and now with JWST it's like Earth just received a much better glasses prescription!
If you haven't been following, here's a compelling side-by-side comparison of the same nebula as seen by both telescopes posted to NASA's Instagram:
Long before these pictures started being shared via social media however, Astronomy Picture of the Day (APOD) established itself as one of the first websites for this purpose. Every day since July 16 1995, a new picture (or video) with some accompanying information has been posted and it has cemented itself as the OG source of space-related content.
The archive is a trove of absolutely stunning images with otherworldly color palettes. The sheer amount of them and their easy accessibility, combined with my personal desire for a new side-project led to the thought: why not make the APOD image database searchable by color? 🎨
The finished product 👨🚀
With more images from JWST continuing to be transmitted back to us, I've been wanting to build something to do just that. Feeling inspired, I set out to build apod-color-search!
Do give it a try and let me know what you think. I've been putting time into it on & off over the past couple months but finally feel ready to release it to the public.
Part of this was to maximize the various free tiers of cloud services that it utilizes - only given so many hours for GitHub Actions to run to process almost two decades of images! Happy to say that I didn't spend a single cent on any cloud infrastructure, though that came at the cost of some additional complexity which I'll go into detail about later.
Here's the source if you want to poke around in the meantime:
apod color search 🪐
Search for APOD photos by color! Consists of four functional parts:
web
A Svelte app to provide search interface. Uses vanilla-colorful for color picker.
api
Deno-based API that retrieves APOD information from database for images that match the given hex value.
cache
Node server acting as reverse cache proxy to maintain persistent Redis connection. Aside from connection limits, benchmarks seem to indicate this is more performant than connecting directly to Redis via Deno for each request.
src
Rust utility to analyze and process images. Used to populate database with historical data, now scheduled to run monthly to process new APODs.
- Fetches APOD metatada via apod-api.
- Analyzes image to get highest-frequency non-grayscale colors.
- Saves result to Postgres.
Runs via GitHub Actions UI to then trigger additional workflows. This was used to leverage GitHub Actions to batch process a large amount of images concurrently & remotely.
This will be the beginning of a series of posts about how I built it consisting of multiple parts, including:
- Building a request handler and image processor in Rust
- Using GitHub Actions as a free cloud utility to batch process images
- Building an API to retrieve and cache search results
- Building a web application to display color-indexed images in a searchable interface
Stay tuned! 🔭
This content originally appeared on DEV Community 👩💻👨💻 and was authored by Bryce Dorn
Bryce Dorn | Sciencx (2023-02-18T21:04:49+00:00) Building an app to search the APOD archive by color 🪐. Retrieved from https://www.scien.cx/2023/02/18/building-an-app-to-search-the-apod-archive-by-color-%f0%9f%aa%90/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.