This project provides a complete solution for creating, managing, and submitting dynamic forms.
- RESTful API built with Node.js, Express, Prisma, and PostgreSQL.
- JWT-based authentication for secure operations.
- Export form submissions as CSV.
- Drag-and-drop form builder.
- Real-time form customization.
- Responsive design for managing and submitting forms.
- CSV export from the submission viewer.
- Node.js: Version 16 or above.
- PostgreSQL: A running PostgreSQL instance.
- React: React 18 or above for the frontend.
- Docker: For containerized deployment.
-
Clone the repository:
git clone <repository-url> cd <project-folder>/backend
-
Install dependencies:
npm install
-
Create a
.envfile in the backend directory:DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database>?schema=public JWT_SECRET=your_secret_key
-
Run Prisma commands:
npx prisma generate npx prisma migrate dev --name init
-
Start the server:
npm start
-
Access the API at:
http://localhost:5001
-
Navigate to the backend folder:
cd <project-folder>/backend
-
Update environment variables in
docker-compose.ymlif necessary. -
Start the containers:
docker-compose up --build
-
Access the API at:
http://localhost:5001
-
Navigate to the frontend folder:
cd <project-folder>/frontend
-
Install dependencies:
npm install
-
Create a
.envfile in the frontend directory:REACT_APP_API_URL=http://localhost:5001
-
Start the development server:
npm start
-
Access the application at:
http://localhost:3000
-
Create a new service on Render:
- Choose Node.js.
- Set up environment variables (
DATABASE_URLandJWT_SECRET) in the Render dashboard.
-
Add the build and start commands in
package.json:"scripts": { "build": "npx prisma generate && npx prisma migrate deploy", "start": "node index.js" }
-
Deploy the backend using Render.
-
Create a new site on Netlify:
- Link the repository.
-
Set the build command to:
npm run build
-
Set the publish directory to:
build
-
Add environment variables:
REACT_APP_API_URL=<deployed-backend-url>
-
Deploy the frontend.
If integrated, access it at:
http://localhost:5001/api-docs
- Import the provided Postman collection (
postman_collection.json). - Set the
BASE_URLto the deployed backend URL orhttp://localhost:5001for local use.
- Express.js: Lightweight and flexible for RESTful APIs.
- Prisma: Simplified ORM for managing relational data.
- PostgreSQL: Relational database to handle complex relationships.
- JWT Authentication: Secure API endpoints.
- React: Component-based architecture for dynamic user interfaces.
- Tailwind CSS: For responsive and modern styling.
- React DnD: For drag-and-drop functionality in the form builder.
id,title,description,uuid,createdAt,updatedAt
id,formId(FK),type,label,options
id,formId(FK),responses(JSON),submittedAt
- JWT Token Issuance: Secure user login.
- Token Validation: Middleware ensures only authenticated requests.
- Frontend: The submission viewer includes an "Export CSV" button.
- Backend: Use the
/api/forms/:id/submissions/exportendpoint.
- Fork the repository.
- Create a branch for your feature.
- Submit a pull request.




