{"id":14483671,"url":"https://github.com/opengovsg/FormSG","last_synced_at":"2025-08-30T04:31:56.061Z","repository":{"id":36970409,"uuid":"284633811","full_name":"opengovsg/FormSG","owner":"opengovsg","description":"Form builder for the Singapore Government","archived":false,"fork":false,"pushed_at":"2025-08-27T16:45:27.000Z","size":327573,"stargazers_count":313,"open_issues_count":254,"forks_count":103,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2025-08-27T19:43:38.123Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://form.gov.sg","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opengovsg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-03T07:32:42.000Z","updated_at":"2025-08-27T02:56:41.000Z","dependencies_parsed_at":"2023-12-17T21:21:34.728Z","dependency_job_id":"6f092a5e-3d0f-4a06-a75f-7591ffacae76","html_url":"https://github.com/opengovsg/FormSG","commit_stats":null,"previous_names":[],"tags_count":425,"template":false,"template_full_name":null,"purl":"pkg:github/opengovsg/FormSG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2FFormSG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2FFormSG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2FFormSG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2FFormSG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opengovsg","download_url":"https://codeload.github.com/opengovsg/FormSG/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengovsg%2FFormSG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272805350,"owners_count":24995909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-09-03T00:01:58.477Z","updated_at":"2025-08-30T04:31:56.050Z","avatar_url":"https://github.com/opengovsg.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://form.gov.sg\"\u003e\u003cimg src=\"https://file.go.gov.sg/form-logo-background-rmved.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)\n[![Build Status](https://github.com/opengovsg/FormSG/actions/workflows/deploy-eb.yml/badge.svg)](https://github.com/opengovsg/FormSG/actions/workflows/deploy-eb.yml)\n[![Coverage Status](https://coveralls.io/repos/github/opengovsg/FormSG/badge.svg?branch=develop)](https://coveralls.io/github/opengovsg/FormSG?branch=develop)\n[![DeepWiki](https://img.shields.io/badge/DeepWiki-opengovsg%2FFormSG-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANS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P7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/opengovsg/FormSG)\n\n## 📚 Documentation\n\nFor comprehensive self-hosting guides, configuration references, and deployment instructions, visit our **[FormSG Self-Hosting Guide](https://ogp-international.gitbook.io/ogp-international-hub/self-hosting/formsg)**.\n\nThe GitBook documentation is actively maintained and provides:\n- Deployment guides for AWS and other platforms\n- Configuration reference for all environment variables\n- Component customization guides\n- Legal and compliance requirements\n- Evaluation frameworks for decision makers\n\n## Table of Contents\n\n- [Contributing](#contributing)\n    - [IMPORTANT NOTE TO ALL CONTRIBUTORS](#important-note-to-all-contributors)\n- [Features](#features)\n- [Local Development (Docker)](#local-development-docker)\n  - [Prerequisites](#prerequisites)\n  - [First Setup](#first-setup)\n  - [Running Locally](#running-locally)\n  - [Adding dependencies](#adding-dependencies)\n  - [Accessing email locally](#accessing-email-locally)\n  - [Login using mockpass locally](#login-using-mockpass-locally)\n  - [Environment variables](#environment-variables)\n  - [Trouble-shooting](#trouble-shooting)\n- [Testing](#testing)\n  - [Testing Prerequisites](#testing-prerequisites)\n  - [Running tests](#running-tests)\n    - [Unit tests](#unit-tests)\n    - [End-to-end tests](#end-to-end-tests)\n    - [Cross-browser testing](#cross-browser-testing)\n- [Architecture](#architecture)\n- [MongoDB Scripts](#mongodb-scripts)\n- [Support](#support)\n- [Database Alternatives](#database-alternatives)\n- [Acknowledgements](#acknowledgements)\n\n## Contributing\n\nWe welcome all contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas to code open sourced by the Government Technology Agency of Singapore. Contributors will also be asked to sign a Contributor License Agreement (CLA) to ensure that everybody is free to use their contributions.\n\n#### IMPORTANT NOTE TO ALL CONTRIBUTORS\n\nBefore contributing, please read [CONTRIBUTING.md](CONTRIBUTING.md). In particular, we strongly encourage contributors to please **first discuss the change you wish to make via GitHub issue**, [email](mailto:contribute@form.gov.sg), or any other method with the repository owners beforehand. Otherwise, we may not be able to review or accept your PR.\n\n## Features\n\nFormSG is a form builder application built, open sourced and maintained by the [Open Government Products](https://open.gov.sg) team of the Singapore [Government Technology Agency](https://tech.gov.sg) to digitise paper processes.\n\nNotable features include:\n\n- 19 different form field types, including attachments, tables, email and mobile\n- Verified email and mobile phone fields via integrations with Twilio and AWS SES\n- Automatic emailing of submissions for forms built with Email Mode\n- Encryption for data collected on forms built with Storage Mode\n- (Singapore government agencies only) Citizen authentication with [SingPass](https://www.singpass.gov.sg/singpass/common/aboutus)\n- (Singapore government agencies only) Citizen authentication with [sgID](https://www.id.gov.sg/)\n- (Singapore government agencies only) Corporate authentication with [CorpPass](https://www.corppass.gov.sg/corppass/common/aboutus)\n- (Singapore government agencies only) Automatic prefill of verified data with [MyInfo](https://www.singpass.gov.sg/myinfo/common/aboutus)\n- Webhooks functionality via the official [FormSG JavaScript SDK](https://github.com/opengovsg/formsg-sdk) and contributor-supported [FormSG Ruby SDK](https://github.com/opengovsg/formsg-ruby-sdk)\n- Variable amount and Itemised payments on forms with [stripe](https://stripe.com) integration\n\n## Local Development (Docker)\n\n### Prerequisites\n\nInstall [docker and docker-compose](https://docs.docker.com/get-docker/) and the [node version manager](https://github.com/nvm-sh/nvm).\n\n### First Setup\n\nFirst, make sure to install and use the node version used by the project:\n\n```bash\nnvm install\nnvm use\n```\n\nTo install the relevant npm packages (frontend, backend and virus-scanner), run the following in the root direcory:\n\n```bash\nnpm install \u0026\u0026 npm --prefix serverless/virus-scanner install\n```\n\nIf you are on Mac OS X, you may want to allow Docker to use more RAM (minimum of 4GB) by clicking on the Docker icon on the toolbar, clicking on the \"Preferences\" menu item, then clicking on the \"Resources\" link on the left.\n\n### Running Locally\n\nFirst, build the frontend for local development:\n\n```bash\nnpm run build:frontend\n```\n\nRun the following shell commands to build the Docker image. The first time will usually take 10 or so minutes. These commands runs the backend services specified under [docker-compose.yml](docker-compose.yml) and the React frontend on the native host.\n\n```bash\nnpm run dev\n```\n\nAfter the Docker image has finished building, the following local applications can be accessed:\n\n- React application can be accessed at [http://localhost:5173](http://localhost:5173)\n- The backend API server can be accessed at [http://localhost:5001](http://localhost:5001)\n- The development mail server can be accessed at [http://localhost:1080](http://localhost:1080)\n\n### Adding dependencies\n\nRun `npm install` as per usual.\n\nFor backend, run\n\n```\ndocker-compose up --build --renew-anon-volumes\n```\n\nwhich will rebuild the backend Docker image and not reuse the existing node_modules volume.\n\nAs frontend project is currently not using Docker, no other steps are required.\n\n### Accessing email locally\n\nWe use [MailDev](https://github.com/maildev/maildev) to access emails in the development environment. The MailDev UI can be accessed at [http://localhost:1080](http://localhost:1080) when the Docker container runs.\n\n### Login using mockpass locally\n\n1. Click on the `Login with Singpass` button on the login page\n2. In the dropdown menu, select `S9812379B [MyInfo]`\n3. Choose the profile with the email `lim_yong_xiang@was.gov.sg`\n4. You should now be successfully logged in\n\n**Note**: Remember to renew your formsg_mongodb_data volume\n\n### Environment variables\n\nDocker-compose looks at various places for environment variables to inject into the containers.\nThe following is the order of priority:\n\n- Compose file\n- Shell environment variables\n- Environment file\n- Dockerfile\n\nFormSG requires some environment variables to function.\nMore information about the required environment variables are in the\n[Configuration Reference](docs/configuration-reference.md).\n\nWe provide a [`.env.example`](./.env.example) file with the secrets blanked out. You can copy and\npaste the variables described into a self-created `.env` file, replacing the\nrequired values with your own.\n\n### Trouble-shooting\n\nFor troubleshooting common development issues, refer to the [Self-Hosting Guide](https://ogp-international.gitbook.io/ogp-international-hub/self-hosting/formsg) or create an issue in the repository.\n\n## Testing\n\nThe docker environment has not been configured to run tests. Thus, you will need\nto follow the following local build guide to get tests running locally.\n\n### Testing Prerequisites\n\nThe team uses macOS for development.\n\nMake you sure have the following node version \u0026 package manager on your machine:\n\n- `\"node\": \"\u003e=22.12.0\"`\n- `\"npm\": \"\u003e=8.19.2\"`\n- `\"mongo\": \"\u003e=4.0.0\"`\n- Python 3.7+ (for LocalStack)\n\nRun\n\n```bash\nnvm install\nnvm use\nnpm install\npip install \"localstack[full]\"\n```\n\nto install node modules and Localstack locally to be able to run tests. Note that\n`localstack[full]` is only compatible with Python 3.7 and above.\n\n### Running tests\n\n#### Unit tests\n\n```bash\nnpm run test\n```\n\nwill build the backend and run our backend unit tests. The tests are located at [`__tests__/unit/backend`](./__tests__/unit/backend).\n\nFor CI testing (optimized for continuous integration), you can run\n\n```bash\nnpm run test:backend:ci\n```\n\nFrontend tests are located at [`frontend/__tests__`](./frontend/__tests__). They can be run with\n\n```bash\nnpm run test:frontend\n```\n\n#### End-to-end tests\n\n```bash\nnpm run test:e2e-v2\n```\n\nwill build both the frontend and backend then run our end-to-end tests. The tests are located at [`__tests__/e2e`](./__tests__/e2e). You will need to stop the Docker dev container to be able to run the end-to-end tests.\n\nIf you do not need to rebuild the frontend and backend, you can run\n\n```bash\nnpx playwright test\n```\n\n#### Cross-browser testing\n\nThis project is tested with [BrowserStack](https://www.browserstack.com/open-source).\n\n## Architecture\n\nThe architecture overview is available in the [Self-Hosting Guide](https://ogp-international.gitbook.io/ogp-international-hub/self-hosting/formsg).\n\n## Support\n\nPlease contact FormSG (support@form.gov.sg) for any details.\n\n## Database Alternatives\n\nFormSG uses MongoDB with Mongoose ODM. While the application can potentially be adapted to work with other databases, this requires significant code changes and is not officially supported.\n\nFor detailed guidance on database migration options (including FerretDB, Prisma ORM, CockroachDB, and other alternatives), refer to the [Self-Hosting Guide](https://ogp-international.gitbook.io/ogp-international-hub/self-hosting/formsg).\n\n**Note**: Database migrations involve complex changes to the codebase and may require ongoing maintenance. Consider the trade-offs carefully before proceeding.\n\n## Acknowledgements\n\nFormSG acknowledges the work done by [Arielle Baldwynn](https://github.com/whitef0x0) to build and maintain [TellForm](https://github.com/tellform), on which FormSG is based.\n\nContributions have also been made by:\n[@RyanAngJY](https://github.com/RyanAngJY)\n[@jeantanzy](https://github.com/jeantanzy)\n[@pregnantboy](https://github.com/pregnantboy)\n[@namnguyen08](https://github.com/namnguyen08)\n[@zioul123](https://github.com/zioul123)\n[@JoelWee](https://github.com/JoelWee)\n[@limli](https://github.com/limli)\n[@tankevan](https://github.com/tankevan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengovsg%2FFormSG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopengovsg%2FFormSG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengovsg%2FFormSG/lists"}