A modern, interactive form builder application built with React, Node.js, and MongoDB. Create dynamic forms with drag-and-drop functionality, including categorization, fill-in-the-blank, and comprehension questions.
- Interactive Form Builder - Drag-and-drop interface for creating forms
- Multiple Question Types:
- Categorization questions with drag-and-drop sorting
- Fill-in-the-blank (Cloze) questions with draggable words
- Comprehension questions with multiple choice
- Image Upload Support - Add images to questions
- Real-time Preview - See how forms look while building
- Form Management - Create, edit, publish, and delete forms
- Responsive Design - Works on desktop and mobile devices
- Frontend: React 18, Vite, Tailwind CSS
- Backend: Node.js, Express
- Database: MongoDB
- Drag & Drop: @dnd-kit
- Animations: Anime.js
- HTTP Client: Axios
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn
-
Clone the repository
git clone <your-repo-url> cd form-builder
-
Install dependencies
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Setup
# Server environment cd ../server cp .env.example .env # Edit .env with your MongoDB connection string # Client environment (optional) cd ../client cp .env.example .env # Edit if you need custom API URLs
-
Start MongoDB
- For local MongoDB:
mongod - For MongoDB Atlas: Update connection string in server/.env
- For local MongoDB:
-
Run the application
# Start the server (in server directory) npm run dev # Start the client (in client directory, new terminal) npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/formbuilder
CLIENT_URL=http://localhost:5173
UPLOAD_PATH=./uploads
MAX_FILE_SIZE=10485760
SESSION_SECRET=your-secret-key-hereVITE_API_URL=http://localhost:5000/api
VITE_UPLOAD_URL=http://localhost:5000/uploads- Create a Form: Click "New Form" on the dashboard
- Add Questions: Use the sidebar to add different question types
- Configure Questions: Set up categories, blank words, or multiple choice options
- Add Images: Upload images to enhance your questions
- Preview: Use the preview button to see how your form looks
- Publish: Make your form available for others to fill
- Share: Use the fill link to share your form
GET /api/forms- Get all formsPOST /api/forms- Create a new formGET /api/forms/:id- Get a specific formPUT /api/forms/:id- Update a formDELETE /api/forms/:id- Delete a formPOST /api/responses- Submit form responsePOST /api/images/upload- Upload imageDELETE /api/images/:filename- Delete image
form-builder/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ └── config/ # Configuration files
│ └── public/ # Static assets
└── server/ # Node.js backend
├── models/ # MongoDB models
├── routes/ # API routes
├── middleware/ # Custom middleware
└── uploads/ # Uploaded images
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.