A modern, production-ready form builder application built with Encore.ts backend and React frontend.
- User Management: Simple email-based user registration and authentication
- Form Builder: Intuitive drag-and-drop interface for creating forms
- Field Types: Support for text, textarea, multiple choice, and single choice fields
- Form Sharing: Unique shareable links for each published form
- Response Collection: Collect and manage form submissions
- Analytics Dashboard: View form performance and response analytics
- Export Data: Export responses to CSV format
- Framework: Encore.ts with TypeScript
- Database: PostgreSQL with automated migrations
- API: RESTful API with type-safe endpoints
- Infrastructure: Built-in SQL database, automatic deployment
- Framework: React with TypeScript
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui components
- Icons: Lucide React
- Build Tool: Vite
- Node.js 18+
- Encore CLI installed (
npm install -g @encore/cli)
-
Clone the repository
git clone <repository-url> cd formos
-
Install dependencies
npm install
-
Start the development server
encore run
This will start both the backend API server and frontend development server.
-
Open your browser
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- Encore Developer Dashboard: http://localhost:9400
├── backend/
│ ├── form/ # Form service
│ │ ├── encore.service.ts # Service definition
│ │ ├── create.ts # Create form endpoint
│ │ ├── list.ts # List forms endpoint
│ │ ├── get.ts # Get form details
│ │ ├── update.ts # Update form
│ │ ├── publish.ts # Publish form
│ │ ├── submit.ts # Submit form response
│ │ └── ...
│ └── user/ # User service
│ ├── encore.service.ts # Service definition
│ ├── create.ts # Create user
│ ├── get_by_email.ts # Get user by email
│ └── db.ts # Database configuration
└── frontend/
├── components/ # React components
│ ├── Dashboard.tsx # Main dashboard
│ ├── FormEditor.tsx # Form builder
│ ├── PublicForm.tsx # Public form view
│ └── ...
├── styles/ # CSS styles
└── App.tsx # Root component
-
Create your Encore app
encore app create formos
-
Deploy to Encore Cloud
encore deploy
-
Note your app URL After deployment, Encore will provide you with an API URL like:
https://staging-formos-<id>.encoreapi.com
-
Update the backend URL in
frontend/config.tsReplace the placeholder URL with your actual Encore app URL:export const API_BASE_URL = process.env.NODE_ENV === 'production' ? 'https://staging-formos-<your-id>.encoreapi.com' // Your actual Encore URL : 'http://localhost:4000';
-
Build the frontend
cd frontend npm run build -
Deploy to Vercel, Netlify, or similar
- Upload the
distfolder - Set up environment variables if needed
- Upload the
- Backend URL: Make sure to update
frontend/config.tswith your actual Encore app URL after deployment - CORS: The backend is configured to work with any frontend origin in development/staging
- Database: Encore automatically provisions and manages your PostgreSQL database
- SSL: All Encore deployments come with automatic SSL certificates
POST /users- Create a new userGET /users/by-email/:email- Get user by email
POST /forms- Create a new formGET /forms/user/:userId- List user's formsGET /forms/details/:id- Get form detailsPUT /forms/:id- Update formPUT /forms/:formId/fields- Update form fieldsPOST /forms/:id/publish- Publish formDELETE /forms/:id- Delete form
GET /forms/share/:token- Get public form by share tokenPOST /forms/share/:token/submit- Submit form response
GET /analytics/dashboard/user/:userId- Get dashboard analyticsGET /forms/:formId/analytics- Get form-specific analyticsGET /forms/:formId/responses- Get form responses
Each published form generates a unique shareable URL:
https://your-frontend-domain.com/share/{unique-token}
- Short Text: Single-line text input
- Long Text: Multi-line textarea
- Multiple Choice: Checkbox options
- Single Choice: Radio button options
- Total forms created
- Published forms count
- Total responses received
- Daily response trends
- Top performing forms
-
Dashboard not loading after deployment
- Check if
frontend/config.tshas the correct backend URL - Verify the backend is deployed and accessible
- Check browser console for API errors
- Check if
-
Forms not saving
- Ensure the backend database migrations ran successfully
- Check if the user ID is being passed correctly
-
Share links not working
- Make sure forms are published before sharing
- Verify the frontend routing handles
/share/:tokencorrectly
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support, email support@formos.app or create an issue in the repository.