↓ Skip to main content

Exploring the universe from my GitHub profile

Table of Contents

How I built Webb Skyframe, a project that lets you interactively explore real observations from the James Webb Space Telescope in a GitHub README.

A while ago, while looking for ideas to customize my GitHub profile, I came across a project by Nathan Farlow, who had managed to run a playable version of Pokémon Red directly from his profile. What caught my attention was how he had created an interactive experience in a file that is static by nature.

Inspired by his project, I decided to apply the same idea to something completely different: astronomy.

The result was Webb Skyframe, a project that lets you explore real images captured by the James Webb Space Telescope, alongside a view of the region of the sky it observed and the positions of the telescope, Earth, and the Moon at the time of the observation.

What makes it interesting is that anyone visiting my profile can request another random observation with a single click, without making a commit, editing the README, or running a GitHub Actions workflow.

You can try it directly on my GitHub profile.

Webb Skyframe on my GitHub profile

The challenge of making a README interactive
#

GitHub lets you customize your profile with a README.md file. You can include images, links, and various HTML elements, but you cannot run custom JavaScript to build the kind of interactions you would find in a conventional web app.

There is an interesting alternative, though. Images in a README do not have to be static files stored in the repository. An external server can also host them and control what it serves dynamically.

That means the same URL can return different images over time without any changes to the Markdown file that references it.

With that in mind, I built a service that generates the astronomical cards and controls which one appears on my profile.

From the README’s perspective, I only need two things:

  • An image that points to /github/current.svg.
  • A link styled as a button that points to /github/next.

All of the application logic runs outside GitHub.

How does it work?
#

I built the service with Cloudflare Workers, which runs the card selection and rendering logic, and Cloudflare R2, where I store the images, the astronomical data, and the card currently displayed on the profile.

There are two scenarios: when someone visits my profile and when they request a new observation.

Visiting the profile
#

When someone visits my profile, GitHub renders the README and requests the image at /github/current.svg.

The Worker receives the request, retrieves the currently selected card from R2, and returns it as an SVG image.

At this point, there is no astronomical processing or selection of a new observation. The card has already been generated and is ready to serve.

Requesting another observation
#

When someone clicks the Explore another Webb observation button, something different happens:

  1. The browser visits /github/next.
  2. The Worker identifies the observation currently on display and randomly selects another one from the available catalog.
  3. It retrieves the photograph, metadata, sky map data, and data needed to draw the orbital view from R2.
  4. It generates a new SVG card with the photograph embedded in it.
  5. Once it verifies that the card is complete, it replaces the previous one in R2.
  6. Finally, it responds with an HTTP 302 redirect to my GitHub profile.

When the browser returns to the profile, GitHub requests the image again. The URL stays exactly the same, but the server can now return a different card.

The diagram below summarizes this flow, from a visitor opening the profile to requesting a new observation.

Diagram of the Webb Skyframe flow between GitHub, Cloudflare Workers, and R2

One notable feature of this implementation is that the profile card represents shared state. When someone selects a new observation, it also changes the one that subsequent visitors will see.

I also chose to store the complete card instead of rebuilding it on every profile visit. That way, if an error occurs while generating a new card, the previous one remains available.

A small complication: GitHub’s cache
#

When external images appear on GitHub, the visitor’s browser does not request them directly from the server. GitHub uses an image proxy called Camo, which adds another layer of caching between the user and the service.

This means the change may not be visible immediately, even after the Worker successfully generates and stores a new card.

To handle this behavior, the service uses HTTP cache control headers and an ETag derived from the card’s contents so the proxy can check whether the image has changed.

During the first prototype tests, I took ten measurements using synthetic cards. It took between 5.4 and 7 seconds for the update to become visible through Camo.

This delay reflects the behavior of the entire image delivery chain through the proxy, beyond the time the server spends generating the card.

It is one of the limitations of building an interactive experience on a platform that was not designed to support this kind of interaction.

Where do the observations come from?
#

So far, I’ve explained how the card changes, but one of the most interesting parts of the project was figuring out how to obtain and connect all the data needed to build it.

I wanted to go beyond showing James Webb images and answer three questions about each observation:

  • What was the telescope observing?
  • What region of the sky was it pointing at?
  • Where was it when it made the observation?

To answer them, I used two main sources of astronomical data: the MAST archive and the JPL Horizons ephemeris system.

The James Webb image
#

The images come from the Mikulski Archive for Space Telescopes (MAST), which provides access to scientific data from several astronomical missions, including the James Webb Space Telescope.

Specifically, I use calibrated exposures from NIRCam, one of the telescope’s instruments for observing the universe in near-infrared light.

These observations are distributed as FITS (Flexible Image Transport System) files, a format widely used in astronomy to store scientific data alongside its metadata.

Unlike a conventional photograph, these files contain arrays of intensity values recorded by the detector. Those values need some processing before they can be displayed as images.

I built a Python pipeline that uses libraries such as Astropy, NumPy, and Pillow to read the files, discard invalid pixels, adjust the contrast, and generate a grayscale image.

During development, I also found that some exposures were more visually interesting for this project than others. Some had overly bright backgrounds or bands and patterns that were difficult to make out.

After analyzing a range of images, I developed a selection criterion based on background brightness and intensity variations across rows and columns. This helps automatically filter out images that are less suitable for the cards. The criterion concerns how the images look on the cards, independently of their scientific quality.

Where was Webb pointing?
#

In addition to the intensity values recorded by the detector, the FITS files contain information that maps pixel positions to celestial coordinates.

Using a transformation called GWCS (Generalized World Coordinate System), I obtain the celestial coordinates of the image’s center and corners.

With this information, I can identify the constellation that contains the observed field and show where it lies in the sky.

The card shows an overview of the constellation and, when applicable, a more detailed local reference that makes it easier to see where the telescope was pointing.

The small purple square on the map marks the center of the observed field. Its size does not necessarily match the instrument’s actual field of view.

Where was the telescope?
#

The last component of the card uses data from JPL Horizons, a system from NASA’s Jet Propulsion Laboratory that provides information about the positions and motions of celestial bodies and spacecraft.

I use the midpoint of each exposure to look up the positions of Earth, the Moon, and the James Webb Space Telescope.

These data let me draw a view of the system and indicate the direction the telescope was pointing.

One challenge in this visualization is the enormous difference in scale between Earth’s orbit around the Sun and the distances between Earth, the Moon, and Webb. Drawing everything to scale would make several of these elements difficult to distinguish on a small card.

That’s why I show the distances and trajectories schematically, using the astronomical data for the time of the exposure to determine the positions.

The goal is to give the observation visual context. A scale orbital simulation would serve a different purpose.

Separating observation processing from visualization
#

Downloading a FITS file, processing its data, determining its celestial coordinates, and looking up the telescope’s ephemerides can be time-consuming and resource-intensive.

Doing all that work every time someone clicked the button would have introduced a considerable delay and a direct dependency on external astronomy services.

I therefore divided the project architecture into two independent processes.

Preparing and publishing observations. A Python pipeline retrieves the astronomical data, processes the images, builds the data needed for the visualizations, and verifies that each observation meets the project’s requirements.

I use GitHub Actions to run this pipeline, generate previews of the new cards, and publish approved observations to a catalog stored in Cloudflare R2.

The catalog publishing process also prevents an interrupted run from exposing incomplete observations to visitors. It first stores and verifies the necessary assets, then updates the reference to the new catalog version.

Selecting and rendering cards. The Cloudflare Worker reads this catalog and uses a TypeScript renderer to combine the prepared assets into a single SVG image.

This way, when a visitor requests another observation, the Worker can reuse all the prepared data without downloading the original files again or querying MAST or JPL Horizons.

The published catalog can keep working even if one of these external services temporarily becomes unavailable.

As of December 1, 2026, the project had a catalog of 809 observations to explore, with images from different points in the James Webb mission.

A second way to explore the observations
#

After integrating Webb Skyframe into my GitHub profile, I also added it to my personal website.

Here, I can use JavaScript to handle interactions directly in the browser, free from the restrictions of a README.

Both interfaces use the same catalog and card renderer, but they behave differently.

On my website, when a visitor requests another observation, the browser sends a request to /api/random and indicates which observation it is currently showing.

The Worker selects another observation and returns its identifier, description, and a versioned URL for the card.

The browser loads the new image in the background and replaces the previous one only when the new one is ready to display.

This makes it possible to switch observations without reloading the page, losing the scroll position, or leaving an empty space while the new card is generated.

Another important difference is that each tab keeps its own selection in this version. On the website, visitors can change their observation independently of what other people are viewing.

Final thoughts
#

What started as an idea for customizing my GitHub profile became a project that combines scientific data processing, astronomical visualization, object storage, serverless services, and automation.

One part I found especially interesting was how a seemingly simple limitation, being unable to run JavaScript in a README, led to an architecture that could deliver an interactive experience using only images and links.

It was also a chance to explore real astronomical data and discover how information from several sources can be combined into a visual representation that puts a scientific observation in context.

Now, whenever someone visits my GitHub profile, they have the chance to explore a different little corner of the universe.

If you’d like to try the project or learn more about how it works, you can use these links:

Finally, thank you to Nathan Farlow for sharing his project and the idea that inspired this implementation.

The astronomical data used in Webb Skyframe come from NASA/ESA/CSA, the scientific teams responsible for the observations, MAST at STScI, and JPL Horizons.