Skip to main content
This is Part 2 of 3. If you haven’t completed Part 1, start there: Part 1: Introduction & Architecture
  • Time to complete: 20-25 minutes
  • What you’ll build: Understanding of how GAIA Code generates complete applications
  • What you’ll learn: Schema generation, API creation, React components, MVP approach
  • Platform: Runs locally on AI PCs with Ryzen AI (NPU/iGPU acceleration)

Generating Your First App

Let’s walk through creating a movie tracking app to understand each component.

The Prompt

This single command triggers a complete generation pipeline.

Component 1: Database Schema Generation

The agent’s first task is creating the database schema via Prisma.

How Schema Generation Works

Generated Schema

From our movie tracker prompt:
prisma/schema.prisma
What happened:
  • title, genreString fields
  • dateWatchedDateTime field
  • score out of 10Int field
  • Auto-added: id, createdAt, updatedAt (standard fields)

Schema Features

Every model gets:
  • id Int @id @default(autoincrement()) - Auto-incrementing primary key
  • Ensures unique records
Automatic tracking:
  • createdAt DateTime @default(now()) - When record was created
  • updatedAt DateTime @updatedAt - Auto-updates on changes
LLM intelligently maps:
  • Text → String
  • Numbers → Int or Float
  • Dates → DateTime
  • True/False → Boolean
  • Optional fields → String? (nullable)

Component 2: API Route Generation

Next, the agent creates REST API endpoints with validation.

API Structure

For each model, the agent generates two route files:

GET All Movies

src/app/api/movies/route.ts

POST Create Movie

src/app/api/movies/route.ts

PUT Update Movie

src/app/api/movies/[id]/route.ts

DELETE Movie

src/app/api/movies/[id]/route.ts

API Features

Validation

Zod schemas validate all inputs before database operations

Error Handling

Try-catch blocks with appropriate HTTP status codes

Type Safety

Full TypeScript integration with Prisma types

REST Standards

Proper HTTP methods and status codes

Component 3: React Component Generation

The agent generates four types of pages for each resource.

Generated Page Structure

List View

src/app/movies/page.tsx

Create Form

src/app/movies/new/page.tsx

Component 4: Styling with Tailwind CSS

The agent applies consistent styling using Tailwind CSS.

Generated Styles

src/app/globals.css

Styling Features

  • Consistent color scheme
  • Responsive design
  • Form styling
  • Button states
  • Loading states
  • Error messages

The MVP Creation Process

Understanding how the agent determines what to build:
1

Analyze Prompt

LLM parses the user’s request and extracts key information
2

Identify Core Entities

Determines main models needed (e.g., “Movie”)
3

Extract Fields

Lists specific fields mentioned (“title, genre, date watched, score”)
4

Determine Types

Maps fields to appropriate types (String, DateTime, Int)
5

Generate Minimal Schema

Creates MVP schema without extra features
6

Build Full Stack

Generates API routes, React components, and styling

Working Examples

Here are verified prompts that generate complete applications:

Movie Tracking App

Workout Tracking App

Restaurant Rating App

AI Tool Rating with Leaderboard

Simple Todo Tracker


What’s Next?

Part 3: Validation & Building

Learn how TypeScript validation works, the build process, and how the agent iterates to fix errors