Overview
In this class, you will learn the data-driven nature of web applications. You will learn what an API is, how a user interface talks to a server, how data gets bound to what you see on screen, and how to store your own data.
What you will need:
- Cursor
- Netlify or a similar web hosting service
- Figma Design
- Supabase
- A selected API for the mini project
Data-Driven UIs and Data Binding
Think about a product page on Amazon or a feed on Instagram. The layout barely changes, but the content changes constantly because the design is a reusable template and the data is poured into it at runtime.
The core loop
- The UI shows data and collects user input.
- The data is the content: products, posts, users, bookmarks, and more.
- The server / database stores the data and sends it when the UI asks.
What data binding means
Data binding connects a piece of data to a piece of the interface so that when the data changes, the screen updates automatically.
- Static: text is typed directly into the design.
- Dynamic / bound: text comes from data.
You design one card. The app repeats it for every item in a data array.
States designers must design
Real data takes time and can fail. Every data-driven screen needs these states:
- Loading - a skeleton or spinner while data is on its way.
- Empty - a friendly message when there is nothing to show yet.
- Error - a clear, recoverable message when the request fails.
- Success - the actual content.
API and Data Formats
To work well with your AI agent, you need just enough literacy to describe what you want.
What is an API?
An API (Application Programming Interface) is the menu and the waiter of a restaurant. You (the UI) don't go into the kitchen (the server) to get the food. You ask the waiter for something on the menu, and they bring it back. The API defines what you can ask for and what you get back.
Every interaction is a request and a response. The most common request types (verbs) are:
- GET — read data ("give me the list of products.")
- POST — create data on the server ("save this new bookmark.")
- PUT / PATCH — update existing data on the server ("change this title.")
- DELETE — remove data from the server ("delete this item.")
Endpoint: the address you call
An endpoint is the specific URL you send your request to. For example, https://api.open-meteo.com/v1/forecast?latitude=42&longitude=-93 returns weather data for the location (latitude=42, longitude=-93).
An API can provide multiple endpoints: one to read data, one to create a record, one to update it, and so on.
What is JSON?
JSON is the format data travels in. It looks like a labeled list of values. In a web application, data is often exchanged in JSON format.
Example:
{
"title": "Inception",
"year": 2010,
"rating": 8.8,
"genres": ["Sci-Fi", "Thriller"]
}
When you call a endpoint of a API, you will receive data in JSON format. This is the data your application will use.
Examples of public API endpoints
Following are some examples of public API endpoints. You can explore what kinds of data you can get from them.
You don't need to know the endpoint URLs to use an API in vibe coding. You can just let your agent know the name of the API and what data you want to retrieve. But it's helpful to understand the structure of the API and the data it provides.
JSONPlaceholder
A fake REST API for testing and prototyping. Gives you ready-made sample posts, comments, photos, users, albums, and to-do items — no account or key needed.
- 5,000 sample photos (id, title, image URL): https://jsonplaceholder.typicode.com/photos
- 100 sample blog posts (id, title, body): https://jsonplaceholder.typicode.com/posts
- 500 sample comments (name, email, body): https://jsonplaceholder.typicode.com/comments
SerpAPI
Returns structured Google search results as clean JSON instead of raw HTML. Requires an API key — the free plan gives you 100 searches per month. Append &api_key=YOUR_KEY to use these endpoints.
- Google web results for "Coffee" in Austin: https://serpapi.com/search.json?q=Coffee&location=Austin,+Texas,+United+States&hl=en&gl=us&google_domain=google.com
- Google Images: https://serpapi.com/search.json?q=Coffee&tbm=isch
- Google News: https://serpapi.com/search.json?q=Coffee&tbm=nws
Open-Meteo API
Free, open-source weather API — no account or key required. Specify location (latitude/longitude) and variables directly in the URL.
- Current temperature & wind speed, plus hourly forecast for Berlin: https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t=temperature_2m,wind_speed_10m&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m
- Historical daily high/low temperatures and precipitation for Berlin: https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&start_date=2025-06-01&end_date=2025-06-07&daily=temperature_2m_max,temperature_2m_min,precipitation_sum
Open Food Facts
Free, crowdsourced database of food products from around the world. Look up any product by barcode, or search by category or ingredient.
- Full nutritional data by barcode: https://world.openfoodfacts.org/api/v2/product/737628064502.json
- Search for chocolate products (name and brand, first 3 results): https://world.openfoodfacts.org/api/v2/search?categories_tags_en=chocolate&fields=product_name,brands&page_size=3
Find more public APIs: publicapis.dev
Tip: prefer popular APIs when prompting your agent. Popular APIs appear frequently in AI training data, so your agent already knows their endpoints, parameters, and common patterns — your prompts can be shorter and results are more reliable. Less-popular APIs still work, but paste in a link to their documentation or show a sample response so the agent has something concrete to work from.
Public and Authenticated APIs
Using a Public API (Read-Only Data)
For public APIs, only GET is allowed — you can read data, but you cannot edit their data.
First, find the API you want to use. You can search online or ask your AI agent. For example:
I want to use a popular public weather API in this application. Help me find one and add it.
Then describe how your app will display the data:
Fetch the current weather for a city the user types in, using the Open-Meteo API, and display the temperature and condition in this card. Show a loading state while fetching.
Using an Authenticated API
For private APIs (also called authenticated APIs), all four verbs are available — but you need a credential (usually an API key or login token) to prove you are allowed. When you build your own app or connect to a service you have an account with, you are typically working with a private API. That is when POST, PUT/PATCH, and DELETE become useful — saving user data, updating a profile, deleting a record, and so on.
API Keys and Secrets
Most authenticated APIs require a key to identify you. For example, a Canvas API key lets a dashboard confirm the request comes from you, not anyone else — the server recognizes the key, not the person. So anyone who has your key can access your data or spend your money.
Here is the honest picture for the kind of app you are building:
- Your app runs in the browser, so any key it uses is visible to users. Putting a key in an .env file keeps it out of your code and out of a public repo, but it does not hide the key from someone who opens your published site. A true secret cannot be kept secret in a frontend-only app.
- Never put a paid or high-privilege key in frontend code. Those require a small backend to stay safe, which is beyond this week.
Note: Supabase is a special case. Its public "anon" key is designed to live in your frontend — you protect your data with database rules (Row Level Security), not by hiding the key.
Look at the Data Before You Build
The shape of the JSON determines what your UI can bind to. Always look at the data shape before you design the binding.
- Open the endpoint URL in your browser if the API supports it.
- Or ask your agent whether the API provides the fields you need.
Video: API examples
Key-protected API example: OpenRouter
Public API example: Open Food Facts
Databases and Backend Services
Reading someone else's data is great, but a real product stores its own data. For non-developers, the easiest path is often a managed backend instead of building a server from scratch.
What is a database?
A database is a spreadsheet your app can read from and write to.
- A table / collection is a sheet (e.g. "rooms").
- A row / document is one entry (one room).
- A field / column is one property (room number, image url, created date...).
Video: how data looks in a database
Recommended backend services
Use a Backend-as-a-Service that gives you a database, authentication, and an auto-generated API:
- Supabase — Postgres database, very vibe-coding friendly.
- Firebase — Google's BaaS, real-time database + auth.
Other beginner-friendly tools worth mentioning
- Airtable — REST API that lets you use Airtable as your database.
- NocoDB — REST API that lets you use a NocoDB table as your database.
- Cloudflare R2 — Object storage, 10 GB free.
- Cloudinary — Image and video hosting with transformation APIs.
- ImageKit — Image optimization and delivery CDN.
Assets Management
Assets — images, icons, videos, fonts — need a home. The right home depends on the type.
Static assets (decorative images, illustrations, fonts)
These ship with your app. Small files (icons, logos, a few
images) go in your project's public/ or assets/ folder. For class
projects, this is fine.
You have two options — no code editing needed:
- Drop files into the folder directly via Cursor's file explorer, then ask your agent to use them.
- Ask your agent to pull placeholder images from Unsplash
or use an API endpoint like
https://picsum.photos/400/300. For example:Please add woodshop images from Unsplash to the hero section.
User-uploaded assets (profile photos, user content)
These must go to a remote storage service. Supabase Storage and Cloudinary both offer generous free tiers and integrate well with AI-generated code. (See Project Demo 1, Video C.)
Icons
Use an icon library instead of image files — they scale perfectly and are easy to change.
Recommended: Lucide — clean, well-maintained, works in any framework. Most AI app builders like FigmaMake and Base44 use it by default.
Alternatives: Heroicons · Phosphor Icons
When initializing your project, ask your agent to include Lucide icons library.
When a specific icon is needed, go to lucide.dev/icons, find the icon and copy its name. Then ask your agent to use it on the place you want.
Videos
Videos are usually large. For background or demo videos, host on Cloudflare Stream (free tier) or simply link to a YouTube embed rather than storing video files in your project folder.
Ask your agent:
Embed this YouTube video to [section name]: [YouTube URL]Project Demo: From Plan to Database Integration
Important
Fully test the build application after uploaded to Netlify. While it may work well in Cursor preview, it might not work as expected in a production environment.
Project Demo 2: Food Factor Scanning app with Public API
The following application shows the integration of camera, barcode recognition, and public API usage. The project was completed in FigmaMake. But the same the approach can be used in other development environments. If you use any other tools like Cursor, pleas install Figma plugin or MCP server.
Note: If your app need access to device hardware, such as location or camera, you need to preview in a browser that supports this, such as Chrome or Safari. They might not be working in preview environments like FigmaMake and Cursor
App Overview and Basic Prompting
Polishment on Details
Extra: Visual Design for UI
What to Do
3 things to do this week.
- Complete a Mini Project.
- Start to Implement the Course Project.
- Schedule a meeting for week 6 with your instructor.
Mini Project - Week 5
- Select a new topic from "Mini Project Topics" section.
- Create a small web app (single page or multi-page) that is cool or fun.
- Implement the loading, empty, success and error states.
- Publish the app to Netlify or a similar service.
How to submit:
Submit a PDF file that includes:
- Talk about the API you used: what it does and how you used it.
- Show screenshots of your app in different states (loading, empty, success, error).
- Include the link to your published app.
Submission link: https://canvas.iastate.edu/courses/127779/assignments/2814321
Course Project - Week 5
You don't have to finish the entire project this week, but you should have enough to be reviewed.
- Create a new page in your existing Figma course project and name it Week 5. Implementation.
- Implement your course project following the process and prompts in Project Demos.
- Develop 2 - 3 core features for your course project and polish the details.
- Try to match the layout of sketches you created earlier.
- Schedule a meeting with me for June 22 - 24 at https://calendly.com/aaron-yang-isu/15min. I will review your course project and mini projects if time permits.
- Send 3 - 4 best screens of the generated designs to this week's page in your Figma Design Project.
- Here is how this week should look like in your Figma Design Project: Figma reference
Mini Project Topics
Here are 18 ideas for mini projects using public APIs that require no authentication:
- Weather Dashboard — Show current conditions and a 5-day forecast for any city using Open-Meteo (free, no key).
- Book Search App — Search books and authors and display covers, ratings, and descriptions using Open Library API (no key).
- Random Activity Generator — Suggest things to do when bored using the Bored API.
- Cat Fact Feed — Show random cat facts with images using catfact.ninja for facts and Cataas for photos (both free, no key).
- Joke of the Day — Display programming or general jokes using JokeAPI.
- Cocktail Recipe Finder — Search and display cocktail recipes using TheCocktailDB.
- Meal Planner — Browse recipes by ingredient or category using TheMealDB.
- Pokédex — Look up Pokémon stats, types, and sprites using PokéAPI.
- ISS Tracker — Show the real-time position of the International Space Station and current crew count using Open Notify (no key, two endpoints: ISS location + people in space).
- Public Holiday Calendar — Show holidays by country and year using Nager.Date.
- University Finder — Search universities by country using the Universities API.
- Fake Store Product Listing — Build a mock e-commerce UI using Fake Store API.
- Color Palette Explorer — Generate and display color palettes using TheColorAPI.
- Food Fact Search — Scan or search food products and display ingredients, nutrition scores, and labels using Open Food Facts API (no key).
- QR Code Generator — Turn any URL or text into a scannable QR code image using QR Server API — no JS needed, just an
<img>src. - Avatar Generator — Generate unique SVG avatars from usernames or seeds in a variety of styles using DiceBear API (no key).
- Name Nationality Predictor — Predict the likely nationality of any name and visualize the probability breakdown using Nationalize.io (no key).
- Music Search — Search songs, albums, and artists and display artwork and 30-second previews using the Deezer API (no key, CORS-friendly).