Skip to Content
TutorialsVibe Coder Series2. Describe Your Data

2. Describe Your Data

Every app stores information. Your Event Manager needs to remember things like event names, dates, and who has RSVPed. In Tutorial 1 you wrote the spec; now you’ll run the first three tasks from tasks.md and watch your live backend take shape.

By the end you’ll have:

  • An events collection storing each event you create
  • An rsvps collection tracking each registration
  • Server-side validation hooks that enforce the rules from your spec

Time: About 15 minutes.

Prerequisites

What’s a collection? Think of it as a spreadsheet tab — each row is one record (one event, one RSVP), and each column is a piece of information (title, date, location). Your AI will set this all up for you.

Open Your Tasks File

In Kiro’s file tree, open .kiro/specs/event-manager/tasks.md. This is the build order your AI generated in Tutorial 1.

Above each task you’ll see a Run task button. Above grouping headers you’ll see Run all tasks. You can step through tasks one at a time, or run a whole group.

Kiro showing the Run task button above each task in tasks.md

Heads up: Kiro may ask follow-up questions while running a task. Answer based on the task description, or accept its default — the spec already captures the answers.

Run Task 1 — Set Up Your Collections

Click Run task above Task 1.

Your AI will create two tables on your live backend:

  • events — title, description, date, location, max_attendees, status (draft or published), plus standard bookkeeping (id, date_created, date_updated, user_created)
  • rsvps — event_id, name, email, plus id and date_created, and user_created: the attendee’s account that made the RSVP

Wait for Kiro to mark Task 1 complete.

Run Task 2 — Add the Validation Hooks

Click Run task above Task 2. It has four sub-tasks; running the parent runs them all.

Hooks are rules that run on the backend whenever data changes — they can’t be bypassed by clever browser tricks. Your AI is wiring up four of them:

  • Validate events on create — reject past dates and max_attendees less than 1
  • Validate events on update — same rules, plus refuse to shrink capacity below the current RSVP count
  • Validate RSVPs on create — require a non-empty name and a real email format, reject duplicate emails for the same event, reject when the event is full
  • Cascade-delete RSVPs — when an event is deleted, remove its RSVPs too

On a Buildpad Engine project, your AI writes the hooks with the extensions tool of the daas MCP server. If it says it cannot find that tool, open your project’s DaaS page on app.buildpad.ai , click Update version and choose the newest version. When the update is done, run Task 2 again. See The DaaS Page.

Reach Checkpoint 3

Click Run task above Task 3 — the verification gate. Kiro confirms every collection exists and every hook is registered. This is your stopping point for this tutorial.

Verify in the Studio

Open your project on app.buildpad.ai . On the project’s Details page, under Services & Integrations, find the Studio card and click Open Studio. Buildpad signs you in to the Studio as your project’s administrator — you don’t type a password. See Opening the Studio.

Open your project on app.buildpad.ai . On the project’s Details page, under Services & Integrations, find the DaaS Studio card. Click the Open in new tab icon next to the Studio URL.

Go to Data Model. You should see events and rsvps in the list. Click events to see the fields from Task 1: title, description, date, location, max_attendees, status, plus the bookkeeping fields. Click rsvps to see event_id, name, email and user_created.

The events collection's fields in the Studio's Data Model

What Just Happened?

You ran the first checkpoint of your spec. Your live backend now has:

WhatWhere it lives
events collectionYour Buildpad EngineYour DaaS database
rsvps collectionYour Buildpad EngineYour DaaS database
4 validation/cascade hooksEngine hooksDaaS extensions, running server-side

Your backend automatically exposes REST API endpoints for both collections — your app will talk to them in the next tutorial.

Peek under the hood (optional)

The Buildpad EngineDaaS stores collection metadata so the API at /api/items/events and /api/items/rsvps is immediately available without writing a single route by hand.

The field types map to real database column types:

  • title, location, name, email (string) → varchar
  • description (text) → text
  • date, date_created, date_updated (dateTime) → timestamptz
  • max_attendees (integer) → integer
  • id, event_id, user_created (uuid) → uuid

The hooks are JavaScript functions registered on the Engine’s item events — an item created, updated or deleted in events or rsvps. They run inside the Engine, not in the browser, so the rules can’t be skipped. Only an administrator can write a hook; your AI’s daas connection is an administrator’s.

The hooks are JavaScript functions registered against DaaS event triggers (events.items.create, rsvps.items.create, etc.) — they run inside the backend, not in the browser, so the rules can’t be skipped.

What’s Next

Your data layer is live. In the next tutorial, you’ll run Tasks 4–13 — the API plumbing, auth, and every page of your app.

Continue to 3. Build Your Pages →

Last updated on