A full-stack form builder application that allows users to create multi-page forms with different question types and fill them out in a separate preview mode.
- ✅ Multi-page forms
- 📝 Multiple question types: Text, MCQ, Checkbox, File Upload
- 👥 User authentication system
- 💾 Dual database design: SQL.js (client-side) + PostgreSQL (server-side)
- 👀 Live preview mode
- 📤 JSON export for form responses
Frontend: Vanilla JavaScript, HTML5, CSS3, SQL.js
Backend: Python Flask, PostgreSQL
- Python 3.8+
- PostgreSQL
- Modern web browser
# Clone the repository
git clone https://github.com/maneyd/form-builder.git
cd form-builder
# Install Python dependencies
pip install flask psycopg2-binary flask-corsCREATE DATABASE flask_db;
CREATE TABLE users (
userID TEXT PRIMARY KEY,
password TEXT
);
INSERT INTO users VALUES ('admin', 'password123');Update your database credentials in app.py and db.py.
python app.pyThen visit http://localhost:5000 in your browser.
- Login with your credentials.
- Create a new form or load an existing one.
- Add pages and questions of different types.
- Save and preview your form.
- Fill out and export responses as JSON.
static/
├── js/ # JavaScript modules
├── css/ # Stylesheets
└── db/ # SQL.js library
templates/ # HTML templates
JSON/ # Form and response data
app.py # Flask server
db.py # Database setup
| Method | Endpoint | Description |
|---|---|---|
| POST | /login |
User authentication |
| POST | /add_form |
Create a form |
| POST | /insert_page |
Add a page to form |
| POST | /insert_item |
Add a question |
| GET | /formData |
Retrieve form data |
| POST | /getData-Builder |
Save form data |