🏠 Home / Hub

AI Vibe 08 — Capstone: Build an App with AI

This capstone walks through building a small full-stack app using AI assistance at every phase — from planning to deployment-ready code — applying everything from lessons 01-07.

1. Capstone Project: Task Manager App

What we're building: A simple task manager with Vue 3 frontend + Laravel API backend. Features: create/list/complete/delete tasks, user authentication, responsive UI.

Tech stack:
- Frontend: Vue 3, Composition API, TypeScript, Pinia, Tailwind CSS
- Backend:  Laravel 11, Sanctum auth, MySQL
- Testing:  Vitest (frontend), PHPUnit (backend)

Structure:
frontend/
  src/
    api/tasks.ts          # API service
    stores/tasks.ts       # Pinia store
    composables/useTasks.ts
    pages/TasksPage.vue
    components/TaskCard.vue, TaskForm.vue
backend/
  app/Http/Controllers/Api/TaskController.php
  app/Models/Task.php
  database/migrations/...

2. Phase 1: AI-Assisted Planning

Prompt to get architecture suggestion:

"I'm building a task manager web app. Stack: Vue 3 + TypeScript
 frontend, Laravel 11 REST API backend, MySQL database.

 Features needed:
 - User registration and login (Sanctum token auth)
 - CRUD tasks (title, description, due date, priority, status)
 - Filter tasks by status (pending/completed)
 - Responsive layout for mobile and desktop

 Give me:
 1. Database schema (tables and columns)
 2. API endpoint list (method, path, description)
 3. Vue component list with their responsibilities
 4. Pinia store structure
 5. Any potential pitfalls to watch for"
Use the AI's architecture plan as a starting point, not gospel. Adjust based on your actual requirements and your team's conventions.

3. Phase 2: AI-Assisted Frontend

Generate the Pinia tasks store:

"Write a Pinia tasks store in TypeScript with:
 State: tasks (Task[]), loading (boolean), error (string|null),
        filter ('all'|'pending'|'completed')
 Getters: filteredTasks (applies filter to tasks array)
 Actions:
   fetchTasks() → GET /api/tasks
   createTask(data) → POST /api/tasks
   updateTask(id, data) → PUT /api/tasks/{id}
   deleteTask(id) → DELETE /api/tasks/{id}
   toggleComplete(id) → PATCH /api/tasks/{id}/toggle

 Use the axios instance from src/api/client.ts.
 Handle loading state and errors in each action."

Generate TaskCard component:

"Write a Vue 3 TaskCard component (TypeScript, Tailwind).
 Props: task: Task (id, title, description, dueDate, priority,
               status: 'pending'|'completed')
 Emits: 'toggle', 'delete', 'edit'
 Design: white card, rounded, shadow
          checkbox to toggle completion (strikethrough when done)
          priority badge (red=high, yellow=medium, green=low)
          due date shown, red if overdue
          edit and delete icon buttons"

4. Phase 3: AI-Assisted Backend

Generate the migration:

"Write a Laravel migration for the tasks table:
 - id (bigint, primary)
 - user_id (foreign key → users.id, cascade delete)
 - title (string, 255, required)
 - description (text, nullable)
 - due_date (date, nullable)
 - priority (enum: 'low','medium','high', default 'medium')
 - status (enum: 'pending','completed', default 'pending')
 - timestamps

 Add index on user_id and status."

Generate the controller:

"Write a Laravel 11 API controller TaskController with methods:
 index()  → return authenticated user's tasks (paginated 20/page)
            Support ?status= filter
 store()  → create task for auth user (validate: title required,
            priority in [low,medium,high], due_date date|nullable)
 update() → update task (same validation, owned by auth user)
 destroy()→ delete task (owned by auth user)
 toggle() → toggle status between pending/completed

 Use: Auth::user(), TaskResource, Form Request, Policy for ownership.
 Return 403 if task belongs to another user."

5. Phase 4: AI-Assisted Testing

Frontend unit tests:

"Write Vitest tests for the tasks Pinia store.
 Test these scenarios:
 1. fetchTasks() sets tasks array on success
 2. fetchTasks() sets error string on API failure
 3. createTask() adds task to the array
 4. deleteTask() removes task by id
 5. filteredTasks getter returns correct subset for each filter value
 Mock the axios calls using vi.mock."

Backend feature tests:

"Write PHPUnit feature tests for TaskController.
 Use RefreshDatabase. Test:
 1. Unauthenticated user gets 401 on all endpoints
 2. User can create a task (assert in DB)
 3. User can only see their own tasks (not other users')
 4. User gets 403 trying to delete another user's task
 5. Toggle changes status pending→completed→pending"

6. Phase 5: AI-Assisted Review

Security review prompt:

"Review my TaskController for security issues.
 Specifically check:
 - Is every action scoped to the authenticated user?
 - Is there any way a user could access another user's tasks?
 - Are all inputs validated?
 - Could any input cause SQL injection?
 - Are there mass assignment vulnerabilities in the Task model?
 [paste controller code]"

Code quality review:

"Review the TasksPage.vue component for:
 - Any performance issues (unnecessary re-renders, missing keys)
 - Accessibility (aria labels, keyboard navigation, focus management)
 - Missing loading/empty/error states
 - Any TypeScript type safety issues
 [paste component]"

7. Best Practices Learned Across All Lessons

LessonKey takeaway
01 IntroYou are the engineer. AI is the assistant. Review everything.
02 PromptingSpecific prompts with constraints outperform vague ones every time.
03 ContextCLAUDE.md + selective file sharing = consistent, on-brand output.
04 AgentsAgentic tasks need clear scope, stopping conditions, and post-run review.
05 FrontendDescribe layout, props, emits, and styling system — don't leave it to AI's imagination.
06 TestingAsk AI for tests at the same time as features. It saves review cycles.
07 SecurityNever share secrets. Review all AI code. Prompt injection is real.

AI Vibe Coding Complete!

You've finished all 8 lessons: intro, prompting, context management, agents & tools, frontend design, testing & review, security & privacy, and this full capstone project.

You now have a complete framework for using AI as a force multiplier in your daily development work — faster, safer, and with full understanding of the risks.


Back to AI Vibe Index  |  Start n8n Automation Course

📌 Study Checklist