How yaserrar/form-builder works
Main System Components
a. Frontend Layer (Next.js Application)
• Client-side Components
• Server-side Components
• Form Management System
• UI Component Library
• Validation Layer
Component Relationships
Use the following symbols and connections:
┌─────────────────────────────────────────────┐
• UI Layer │
• ┌─────────────┐ ┌─────────────┐ ┌────────┐ │
• ShadCN UI │ │ Dialogs │ │ Pages │ │
• ┘ └─────────────┘ └────────┘ │
• ┘
• ↕ (State & Events)
┌─────────────────────────────────────────────┐
• Form Management Layer │
• ┌─────────────┐ ┌─────────────────┐ │
• React Hook │ ←──→ │ Form State │ │
• Form │ │ Management │ │
• ┘ └─────────────────┘ │
• ┘
• ↕ (Validation)
┌─────────────────────────────────────────────┐
• Validation Layer │
• ┌─────────────┐ ┌─────────────────┐ │
• Zod Schemas │ ←──→ │ Type Safety │ │
• Layer │ │
• ┘ └─────────────────┘ │
• ┘
Important Details
A. UI Components (components/ui/*)
• Form-related components (input, select, checkbox, etc.)
• Their relationship with ShadCN
B. Dialog System (app/(dialogs)/*)
• How dialogs interact with form components
• State management flow
C. Validation Flow
• How Zod schemas (/validations/*) connect to form components
• Error message propagation
Data Flow Indicators
• User input flow
• Validation triggers
• Form submission flow
• Error propagation
• State updates
The real-time validation feedback loop
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this form builder unique, such as the integration of Zod with React Hook Form and the use of ShadCN UI components.