DEV Community

Deeptej
Deeptej

Posted on

Fusing NASA Data with AI: How I Built CosmoDex and Won the MLH Data Hackfest!

Built with Google Gemini: Writing Challenge

This is a submission for the Built with Google Gemini: Writing Challenge

What if tracking near-Earth asteroids felt less like reading a spreadsheet and more like commanding a starship? That was the exact question that led to the birth CosmoDex!πŸͺπŸš€πŸš€

stargazing

What I Built with Google Gemini

Space is fascinating, but astronomical data is usually presented as dry, intimidating pages of text or raw JSON files. I wanted to change that! I wondered, What if you could instead just, TALK to the data!!!

Details about an asteroid and Quackstronaut analyzing it

So with a clear goal in mind and a weekend to spare, I built CosmoDex! πŸ₯ΉπŸš€ an interactive, highly visual dashboard that tracks Near Earth Objects (NEOs) using real-time data from NASA's API, allows you to ask questions about what you're seeing with the power of Gemini and unlock shiny badges while doing all this! I didn’t just want to build a data table, I wanted to build an experience ✨ I heavily drew inspiration from sci-fi movies like Intersteller (my favorite btw) and Gravity, utilizing glowing neon accents 🌟, deep space backgrounds 🌠, and a head up display style aesthetic to make users feel like they are stationed at a futuristic command center πŸ›°οΈ

Oh and psst...(whispers) "You think I'd let you be stranded in space like that? Well Ohhh boyy" I bring to you
Mandalorian
drumrollssπŸ₯ "QUACKSTRONAUT" πŸ¦†

Quackstronaut is your friendly AI (Always Intriguing) sidekick that gives you:

  • Daily briefings about cool space facts!!
  • Information about any asteroid you're currently seeing, powered by Gemini, we can simply ask it a question in our natural language, just like you'd ask your pal! πŸ¦†

Quackstonaut briefing

And finally to gamify it even further we have ✨Achievements!✨. Interactions on the site such as favoriting near earth objects, asking quackstronaut for more information etc unlocks cool achievements that are visible on your profile!!

Achievements

What role did Google Gemini play?

While the NASA API provided the raw numbers (velocity, distance, estimated diameter), I fed the raw asteroid data into Gemini and prompted it to generate dynamic, gamified threat assessments and sci-fi lore for each specific space rock. Instead of just seeing "(2012 FU35): 0.05 AU away," users get an immersive briefing about an incoming celestial body, making the data highly engaging and accessible.

Demo

You can find the source code for the project here: DeeptejD/data-hackfest

The homepage

Asteoroid info

Achievements

vault containing favorited near earth objects

What I Learned

Building CosmoDex was a massive learning experience spanning both code and design:

  • Designing for Immersion (UI/UX): I learned that good UI isn't just about making things look "cool" it’s about visual hierarchy. I had to balance the intense, futuristic sci-fi aesthetics with actual readability so the NASA data which was the star of the project didn't get lost in the design.

  • Speaking in a video (Soft Skill): Gosh I had to do like 6-7 takes to get the video right and realised its sooo hard to speak in front of the camera! But I eventually did it and feel much more confident about it now.

  • Working with GenAI: This was the first time I worked with GenAI so my technical skills were pushed to the limit. I had to reliably pass data fetched from NASA into an LLM prompt (Gemini) and parse the response back into our frontend without breaking the immersion. I also learnt a little bit about prompt engineering and how to structure good prompts!

  • State Management & Async Loading: Waiting for an AI to generate a story takes a few seconds. I learned a lot about handling asynchronous data streams and creating sleek loading states like animations so the user stays engaged while Gemini did its thing.

Google Gemini Feedback

Working with Gemini was a new and really cool experience. Seeing raw data turn into a lore was honestly super cool. But like all things it came with its own set of pros and cons...

What worked well?

  • I was literally building a persona that was in my head "Quackstronaut" and Gemini was really adaptable to the persona I exactly imagined. It perfectly captured the astronaut side-kick and sci-fi vibe I was going for!
  • Something that really impressed me was its ability to take cold hard numbers like velocity and come up with some creative lore or story.

What caused friction

  • Gemini worked well as long as the prompt was well structured. Nailing that prompt was a bit difficult for me since this was my first time.
  • Since I was dealing with scientific data it became more important that Gemini didn't hallucinate which it did sometimes by throwing in random numbers here and there
  • latency was something that made the platform feel a bit slow, but this was mainly because I was using the Gemini flash models instead of the pro models

Thanks for reading so far!! Will see you in another post explorer!
bye

Top comments (2)

Collapse
 
renegade2432 profile image
Guillermo

This looks really cool ✨

Collapse
 
astrodeeptej profile image
Deeptej

Do you like the project? React to this post and drop in your comments! <3