This is a scalable Google Forms backend clone written in Node.js that provides an API to interact with the system. Developers can self-host this project, eliminating the need to share data with third-party services like Google when implementing forms.
If you find any bugs, raise an issue or please email [email protected]. We aim to improve the API over time, ensuring that all changes remain backward compatible.
Currently, there is no rate limit implemented.
Ensure that Docker is installed on your system and you are inside the project folder after cloning.
-
Start the application:
docker-compose up
-
Wait until you see "app is working at 3000" in the terminal.
-
The API endpoint will be available at:
http://localhost:3000/
- Endpoint:
/createAccountService
- Method: POST
- Body:
{ "username": "your-username", "password": "your-password", "contact": "your-contact-number", "email": "your-email-address", "type": 0 }
- Response: "account added" on success / error message on failure
- Endpoint:
/twoFAService
- Method: POST
- Body:
{ "username": "your-username", "password": "your-password" }
- Response: "OTP sent to: your-email-address" / error message on failure
- Endpoint:
/validateOTPService
- Method: POST
- Body:
{ "username": "your-username", "otp": your-otp }
- Response: true on success / false on failure
{ "output": true }
- Endpoint:
/createFormService
- Method: POST
- Body:
currently type is always one more types will be supported in subsequent releases
{ "questions": [ { "qcode": unique-integer-for-question-code, "text": "what is your name", "type": 1 } ], "metadata": { "author": "your-username", "timestamp": "dd-mm-yyyy" }, "formID": "unique-integer-for-form-id" }
- Response: "form created"
- Endpoint:
/getFormService
- Method: POST
- Body:
{ "formID": "form-id-of-requested-form" }
- Response: (Form details)
- Endpoint:
/responseStorageService
- Method: POST
- Body:
{ "formID": "form-id", "responderID": "unique-responder-id", "responseID": "unique-response-id", "response": { "question-code-for-respective-response": "answer-to-question-1", "question-code-for-respective-response": "answer-to-question-2" } }
- Response: "response recorded" on success / error message on failure
- Endpoint:
/googleSheetService
- Method: POST
- Body:
{ "formID": "form-id-of-the-form-to-be-exported", "spreadsheetId": "spreadsheet-id-of-the-sheet-you-want-to-export-to", "sheetName": "sheet-name-of-the-sheet-you-want-to-export-to" }
- Response: "your data is exported to, please clone link-to-your-spreadsheet"
For an in-depth understanding of the system design, please refer to the System Design Document.
Contributions are welcome! Please feel free to submit a Pull Request.
brought to you by yours truly, Apoorv Bedmutha