Forms
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
index.ts
https://kyumz--c5665ada3fa411f0ae9576b3cceeab13.web.val.run
A comprehensive form builder application that allows users to create custom forms with drag-and-drop functionality, share them via links, and manage responses.
- Form Creation: Drag-and-drop form builder with various input types
- Input Types: Text, email, dropdown, checkboxes, radio buttons, textarea, number, date
- Form Sharing: Automatic link generation for sharing forms
- Response Management: View responses in a dashboard and export to CSV
- Email Notifications: Optional email notifications for form submissions
- Embed Support: Generate embed codes for websites
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema setup
β β βββ queries.ts # Database query functions
β βββ routes/
β β βββ forms.ts # Form CRUD operations
β β βββ responses.ts # Response handling
β β βββ static.ts # Static file serving
β βββ index.ts # Main Hono server
βββ frontend/
β βββ components/
β β βββ App.tsx # Main application component
β β βββ FormBuilder.tsx # Drag-and-drop form builder
β β βββ FormRenderer.tsx # Form display and submission
β β βββ Dashboard.tsx # Response dashboard
β βββ index.html # Main HTML template
β βββ index.tsx # Frontend entry point
βββ shared/
βββ types.ts # Shared TypeScript types
- The app runs on Val Town's serverless platform
- Access the form builder at the root URL
- Create forms using the drag-and-drop interface
- Share forms using the generated links
- View responses in the dashboard
GET /
- Form builder interfacePOST /api/forms
- Create a new formGET /api/forms/:id
- Get form detailsGET /form/:id
- Public form viewPOST /api/forms/:id/submit
- Submit form responseGET /api/forms/:id/responses
- Get form responsesGET /api/forms/:id/export
- Export responses to CSV