This video tutorial showcases the process of "Vibe Coding" a full-stack collaborative envelope budgeting application. The presenter leverages AI assistance, specifically Cursor with Gemini 2.5 Pro, in conjunction with the Wasp framework for full-stack capabilities and ShadCN UI components for the front end. The core objective is to demonstrate a realistic, iterative, "vertical slice" approach to AI-assisted development, building a production-ready application that supports user authentication, budget management, transaction tracking, and multi-user collaboration.
Key Workflow Steps π οΈ
The development methodology is characterized by an iterative, AI-guided "vertical slice" approach, emphasizing incremental feature development across the entire stack.
- Foundation Setup: The process begins with a robust starter templateβa Wasp project pre-integrated with ShadCN UI admin components. This provides a rich UI kit and full-stack capabilities (e.g., authentication) out-of-the-box, significantly accelerating initial setup and boilerplate reduction. π
- AI Rules Configuration: Extensive AI rule files (
.mdcfiles) are provided to Cursor, detailing Wasp documentation, project conventions, preferred coding styles, and troubleshooting guidelines. These rules ensure the LLM operates within the project's established ecosystem and understands the framework's specifics. These rules can be passed into the LLM context either manually or automatically, depending on the need. π - Product Requirement Document (PRD) & Plan Generation: The LLM is tasked with evaluating the project template and generating a comprehensive PRD and an actionable, step-by-step implementation plan. This plan adheres to the "vertical slice" pattern, focusing on developing single, full-stack features from client to database in order of increasing complexity. The PRD and plan are continuously created and revised with LLM assistance throughout the development cycle. π
- Iterative LLM Interaction & Assumption Testing: A crucial aspect involves constant dialogue with the LLM. The presenter frequently prompts Gemini 2.5 Pro to:
- Evaluate proposed solutions and provide rationales for the best approach.
- Test assumptions about feature implementation or design choices.
- Suggest modifications or improvements to the plan or code, such as refactoring or adding missed functionalities (e.g., envelope terminology, security review tasks). π€
- Agent-Assisted Coding & Error Resolution: Cursor's agent mode allows the LLM to directly implement code changes, including creating new files, modifying existing ones, and integrating features. When errors arise (e.g., compilation failures, runtime exceptions), the LLM is provided with the error message and often leverages its understanding of the Wasp framework and project rules, or consults documentation via auto-search, to propose and apply fixes. This significantly reduces manual debugging efforts. π
- Database Management: The
wasp db migrate devcommand is manually executed following database schema changes (entity additions/modifications), demonstrating the necessary interaction with the underlying PostgreSQL database. The LLM often suggests migration names. πΎ - Intermediate Documentation: Periodically, the LLM is instructed to summarize implemented phases into dedicated documentation files within an
AI/docsdirectory. This serves as a concise reference for both humans and the LLM itself, improving context recall for subsequent development phases. π - Context Management for LLM: Recognizing that long chat sessions can lead to context overload and slower performance, the presenter occasionally initiates new LLM chats, providing key summary documents and the current plan to maintain efficiency. π¬
- Ad-Hoc Feature Integration: While following the plan, the workflow allows for deviations to implement urgent or critical features (e.g., logout functionality, UI header fixes, dashboard graphs) that might improve user experience or address immediate needs, reinforcing the "vibe coding" flexibility. π
- Deployment Planning: Towards the end, the LLM generates a detailed deployment plan, outlining prerequisites (e.g., Fly.io account setup, CLI installation) and commands for deploying the application. βοΈ
Application Features Implemented π―
The tutorial successfully implements a comprehensive set of features, progressing from foundational components to complex collaborative functionalities and deployment.
- User Authentication & Authorization:
- Wasp Built-in Auth: Leverages Wasp's integrated email-based authentication system, enabling user signup, login, and logout.
- On After Signup Hook: Automatically creates a
BudgetProfileentity for each new user upon successful registration, ensuring a dedicated budgeting context. - Route Protection: Implements
authRequiredmiddleware to restrict access to specific pages (e.g.,/budget) to authenticated users. β
- Core Budgeting Structure:
- Budget Profile Entity: A central database model representing a user's overall budget, serving as the container for envelopes and transactions.
- Budget Envelope Entity: Database model for categorizing spending (e.g., "Groceries," "Rent," "Funny Money"). Each envelope has an allocated amount.
- CRUD Operations for Envelopes: Server-side functions (Wasp Actions/Queries) for creating, retrieving, updating, and deleting budget envelopes, including validation (e.g., ensuring inviter is owner).
- Budget UI: A dedicated page (
/budget) to display, add, edit, and delete envelopes using interactive modals. Visual progress bars illustrate the spent versus allocated amounts for each envelope. πΈ
- Manual Transaction Management:
- Transaction Entity: Database model to record individual income or expense items, including
date,description,value,type(enum forIncomeorExpense), andenvelopeassociation. - CRUD Operations for Transactions: Server-side functions for creating, retrieving, updating, and deleting transactions.
- Transaction Form UI: A dedicated page (
/transactions) with a form for manual transaction entry, featuring a date picker, description, amount, transaction type, and envelope assignment. This UI also supports editing and deleting transactions via modals. - Envelope Summary Updates: The
getEnvelopesquery is enhanced to calculate and display thespentandremainingamounts for each envelope dynamically based on associated transactions. π°
- Transaction Entity: Database model to record individual income or expense items, including
- Collaborative Budgeting:
- Budget Collaborator Model: Database model defining relationships between users and budgets, including
owner,editor, andviewerroles. - Collaboration Operations:
inviteCollaborator: Allows a budget owner to invite other registered users (by email) to their budget.removeCollaborator: Enables owners to remove collaborators.updateCollaboratorRole: Permits owners to change a collaborator's role (e.g., fromviewertoeditor).
- Permissions Checks: Extensive server-side permission logic is implemented across all relevant operations (e.g.,
createEnvelope,updateTransaction,getTransactions) to ensure users can only perform actions aligned with theirBudgetCollaboratorrole for a given budget. - Collaborator Management UI: Integrated within the
/budgetpage, allowing owners to invite new collaborators, view existing ones, and manage their roles via modals. Enhanced queries (findUserByEmail,getBudgetCollaborators) effectively retrieve collaborator emails by leveraging nested PrismaAuthIdentityselects. - Visual Indicators for Shared Envelopes: The UI visually distinguishes between personal envelopes (owned by the current user) and shared/collaborative envelopes within a budget. π€
- Budget Collaborator Model: Database model defining relationships between users and budgets, including
- Dashboard Enhancements:
- Income vs. Expense Overview: A bar chart (using Recharts) on the dashboard visually represents total income versus total expenses for the current month.
- Spending Breakdown by Envelope: A pie chart (using Recharts) illustrates how spending is distributed across different budget envelopes.
- Informational Cards: Repurposed UI cards display key metrics such as total income, total spent, and total remaining for the current period. π
- Application Deployment:
- SendGrid Integration: Replaced the dummy email sender with a production-ready SendGrid API for email verification.
- Fly.io Deployment: Successfully deployed the entire full-stack application to Fly.io using the
wasp deploy fly launchcommand, including database setup and environment variable configuration via CLI. π
Final Takeaway π‘
The "Vibe Coding" methodology, as demonstrated, offers a compelling, albeit not entirely autonomous, approach to full-stack application development. It effectively showcases how combining a powerful LLM (Gemini 2.5 Pro) with a full-stack framework (Wasp), a rich UI library (ShadCN), and a sophisticated IDE (Cursor) can significantly accelerate the development lifecycle. The iterative "vertical slice" pattern, guided by continuous PRD/plan refinement and assumption testing with the LLM, proves instrumental in managing complexity and building features systematically. While human oversight, domain knowledge, and manual intervention (e.g., database migrations, specific error interpretations) remain crucial, the LLM excels at boilerplate generation, boilerplate code implementation, error detection and resolution (often by consulting documentation), and suggesting architectural improvements. The resulting application, despite a few minor UI inconsistencies or detours during development, is a feature-rich, collaborative budgeting tool, validating the potential of AI-assisted development for creating complex, production-ready web applications.