Skip to main content
The Form Management Dashboard is your control center for viewing, publishing, and managing all forms you’ve created. Every form is stored securely in PostgreSQL and accessible only to its creator.

Dashboard Overview

The dashboard displays all your forms with key metrics and quick actions. Dashboard showing list of forms

What You See

Each form card displays:
  • Form title - The AI-generated or custom title
  • Response count - Total number of submissions received
  • Creation date - When the form was generated
  • Delete button - Remove the form permanently

Data Fetching

Forms are fetched from the /api/getAllForms endpoint on page load:
1

Component mounts

The useEffect hook triggers on component mount.
2

API request

Axios fetches all forms for the authenticated user.
3

State update

Forms are stored in React state and rendered as cards.
The dashboard uses optimistic UI updates - when you delete a form, it’s immediately removed from the view while the API request processes in the background.

Publishing & Unpublishing Forms

Forms must be published before they can receive responses. This gives you control over when forms go live.

Form States

Default state when a form is first generated.
  • Cannot receive public submissions
  • Shareable link is not active
  • Shows “Publish Form” button

Publishing Flow

1

Click Publish/Unpublish button

User clicks the toggle button in the form preview.
2

API request

A PATCH request is sent to /api/forms/{formId} to toggle the isPublished field.
3

Database update

The form’s isPublished field is toggled in PostgreSQL via Prisma.
4

UI update

The component state is updated to reflect the new publish status, showing/hiding the shareable link.
Unpublishing a form immediately prevents new submissions, but existing responses are preserved. The public URL will return an error if accessed.

Form Preview

Each form has a preview page at /forms/{formId} where you can:
  • See exactly how the form will appear to respondents
  • All fields are disabled (preview mode)
  • Toggle publish status
  • Copy the shareable link (when published)
The preview uses the same rendering logic as the public form, ensuring WYSIWYG (What You See Is What You Get) accuracy.

Form Deletion

Deleting a form permanently removes it and all associated responses.

Deletion Flow

1

Click Delete button

User clicks the red “Delete” button on a form card.
2

Confirmation dialog

Browser confirmation dialog prevents accidental deletion.
3

API request

DELETE request sent to /api/forms/{formId}.
4

Database cascade

Prisma deletes the form and all related responses (cascade delete).
5

UI update

The form card is immediately removed from the dashboard via optimistic update.
Deletion is permanent and cannot be undone. All form data and responses are permanently removed from the database.

Database Schema

Forms are stored in PostgreSQL using Prisma ORM:

Key Fields

Primary key using CUID (Collision-resistant Unique Identifier) for secure, unpredictable IDs.
Links the form to its creator via Clerk authentication. Used for authorization checks.
Unique, URL-friendly identifier used in public form URLs (/f/{slug}). Auto-generated on creation.
JSON column storing the complete form schema as an array of field objects. Allows flexible field types without schema migrations.
Controls whether the form is accessible via public URL. Defaults to false for safety.
Relation to the responses table. Enables cascade deletion when a form is removed.

Error Handling

The dashboard handles various error states:
Clicking a form card navigates to its responses page:
The delete button uses e.stopPropagation() to prevent triggering navigation when clicking delete.