Build the Web Layout to Finish the App

Finish the Twitter tweet generator project implementation by adding an HTML web page to make the app more accessible.

Create an HTML page for our app

Let’s add an HTML page where we’ll have a text input box where user can provide the topic for the tweet generation and two buttons:  

  • One that generates only the tweet based on the topic.

  • Second that generates the tweet and an image based on the tweet and the topic.

We’ll also render the output on the same HTML page so that we don’t lose our output. We will also add one more button (which is by default hidden until we get the answer back from the /generate-tweet and /generate-tweet-with-image APIs). This button will call the /post-tweet API to take the tweet and image (if generated) and post them to the Twitter account using the credentials generated. Let’s take a look at the HTML and CSS for a simple design of our HTML page.

Get hands-on with 1200+ tech skills courses.