liveBook · Manning

Chapter 7: Building user interfaces with ChatGPT

What you will learn in chapter 7 of Coding with AI

The chapter introduces AI-assisted UI design as a way to turn a working backend into a usable application and explains why chat-based tools can help plan the frontend.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduces AI-assisted UI design as a way to turn a working backend into a usable application and explains why chat-based tools can help plan the frontend.

Key terms: generative AI tools, best practices, templates, design patterns, smart customization, chat-based interfaces, general approach, context, limited access to our code

7.1 Getting our strategy from our AI tools

The section explains how to write a detailed prompt to get useful AI guidance for a Flask quiz interface.

Key terms: brief prompts, detailed prompts, role, objective, details, data, functionality requirements, code production

7.1.1 ChatGPT Results

The section reviews ChatGPT’s proposed quiz-app plan and keeps the frontend steps that fit a project whose backend is already complete.

Key terms: Jinja template, routing, redirects, backend, SQLAlchemy, frontend setup

7.1.2 Gemini Results

This section reviews Gemini’s proposed Flask quiz interface and identifies what would need to be adapted to the existing backend.

Key terms: Flask templates, quiz.html, quiz route, answer route, AnswerForm, Flask-WTF, WTForms, existing backend, database logic

7.1.3 Blackbox AI results

The section evaluates Blackbox AI’s proposed quiz frontend and shows how a more specific prompt can steer AI-generated UI suggestions.

Key terms: Flask’s routing system, quiz route, results route, templates, store_answer, objective, prompt refinement, specific examples, active verbs

7.2 Creating our templates

This section explains how Flask templates assemble dynamic quiz pages, adapts AI-suggested templates to an existing index page, and outlines where AI tools can help in UI design.

Key terms: Flask templates, placeholders, base html, Jinja2 template engine, quiz.html, results.html, base.html, index.html, extends statements, early conceptualization

7.3 Describing the flow of our application

The section maps the practice-test user flow, uses ChatGPT to turn it into a diagram and a written description, and emphasizes reviewing AI-generated design materials.

Key terms: entry page, Submit Answer, End Test, Results Page, Return Home, ChatGPT, Mermaid, Excalidraw, flowchart, accompanying document

7.3.1 Creating an overall design

The section uses a context-rich ChatGPT prompt to turn the quiz’s UI requirements into design guidance and wireframes for its three main pages.

Key terms: prompt, context, UI Description, beginner users, style guide, entry page, question pages, results page, consistent elements, wireframes

7.3.2 Drafting HTML based on our wireframes

The section shows how to turn wireframes into a Flask interface by using ChatGPT to draft HTML and CSS for shared layout elements and individual pages.

Key terms: index.html, header, footer, content block, route, wireframes, content wrapper, inner HTML, CSS, Flask templates

7.3.3 The final UI for our application

The section recaps how AI-assisted planning and generated code led to the application’s finished user interface.

Key terms: prompts, Mermaid flowcharts, wireframes, user flows, HTML, CSS, Flask templates, design partner

7.4 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 6: Generating a software backend with Tabnine Chapter 8: Building effective tests with generative AI →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.