What it does

NASA provides a wealth of invaluable online data, featuring captivating imagery of remote and unexplored landscapes on Mars, freely accessible to application developers. The objective of this project is to harness the NASA Mars Rover API to build an application capable of sending emails and receiving random pictures from Mars in return. Leveraging Twilio SendGrid as the email sender and receiver adds an element of simplicity and efficiency to programmatically manage emails. As such, the primary focus of this project is to illustrate the implementation of the email generator app using Java and Twilio SendGrid, detailing the challenges encountered and overcome throughout the development process.

Building the Project

The project can be divided into three relatively separated parts: Part 1. Send email with Twilio SendGrid and NASA's Mars Rover Photo API (Coding) Part 2. Write an incoming email endpoint (Coding) Part 3. Configure the SendGrid Inbound Parse webhook (Setting)

Part1 **I found the tutorial here might be helpful: Java: link Python: link Step1. Create a SendGrid account Step2. Access the NASA API from link Step3. Set up the environment variable in Java IDE (Eclipse for example) Create a project convert it to a Maven config and add the necessary dependency in the pom.xml file Step 4: Write code with Java SendGrid helpers library and HttpURLConnection library to extract info from JSON file through the API URL.

Part2 **A useful tutorial for Part2 and Part3: link I realize this part by creating an Express application, but there are many other ways like using Flask. It is worth noticing that installing the node modules for Express and the multimiddleware is necessary for constructing the node index.js.

Part3 Step 1: Install ngrok to create a “tunnel” from the public Internet into port 3000 in our local machine. Thus, we can get a publicly accessible URL. Step 2: Add the Host and URL into the Inbound Parse webhook in Twilio SendGrid. For this step, the Domain authentication in the Twilio SendGrid is the prerequisite.

Problems I met

This was my first time dealing with an application development project, so I was not familiar with terms, such as API keys, Maven project, Node, and JSON file. Thus, the first challenge I ran to is to know each of the concepts. Especially for converting the url to the JSON file, took me tons of time. Another problem that drove me crazy was setting up the environmental variables and using the terminal to install stuff. At the very beginning, I tried several methods to set up the API keys as an environment variable, but the console always gave an error: The provided authorization grant is invalid, expired, or revoked. Moreover, as I used the npm command to create the npm package in the terminal, it could not work properly. After several checks, I found the Path for node.js is incorrect and located on my PC.

What I learned

  1. How to use Twilio SendGrid to manage email and use API keys to build an application. Working with real data is a nice experience that gives me a better understanding of the basic concepts, commands, usages, etc.
  2. Hone my coding skills using Java and made me explore more on the IDE setting. App development is a new field for me!
  3. Online tutorials and help from friends are important and useful learning resources and problem solvers. When I need to deal with consistently occurring errors, collaboration and help from others is the most efficient way to solve the difficulties.

Overall Summary

This is the first integrated project I finished in my first hackathon, which is challenging but fun. Engaging in a hackathon was an exhilarating and insightful experience that broadened my skills and perspectives in the world of technology and innovation. The collaborative and competitive atmosphere fostered a sense of creativity. The adrenaline of the condensed coding fueled a heightened focus and determination, leading to a tangible sense of accomplishment when overcoming challenges.

Built With

Share this project:

Updates

Submission history