Table of Contents
Notable features include:
- 19 different form field types, including attachments, tables, email and mobile
- Verified email and mobile phone fields via integrations with Twilio and AWS SES
- Automatic emailing of submissions for forms built with Email Mode
- End-to-end encryption for forms built with Storage Mode
- (Singapore government agencies only) Citizen authentication with SingPass
- (Singapore government agencies only) Corporate authentication with CorpPass
- (Singapore government agencies only) Automatic prefill of verified data with MyInfo
The current product roadmap includes:
- (in progress) Frontend rewrite from AngularJS to React
- Enabling payments on forms
- Electronic signatures
- Notifications to form admins for Storage mode submissions
- Integration with vault.gov.sg
Local Development (Docker)
Install docker and docker-compose.
Run the following shell command to build the Docker image from scratch. This will usually take 10 or so minutes.
npm run dev
After the Docker image has finished building, the application can be accessed at localhost:5000.
If there have been no dependency changes in
package.json or changes in the
src/app/server.ts file, you can run
which does not rebuild the Docker image from scratch. This command usually only takes ~15 seconds to finish starting up the image.
Accessing email locally
We use MailDev to access emails in the development environment. The MailDev UI can be accessed at localhost:1080 when the Docker container is running.
Docker-compose looks at various places for environment variables to inject into the containers. The following is the order of priority:
- Compose file
- Shell environment variables
- Environment file
FormSG requires some environment variables in order to function. More information about the required environment variables can be seen in DEPLOYMENT_SETUP.md.
We provide a
.template-env file with the secrets blanked out. You can copy and
paste the variables described into a self-created
.env file, replacing the
required values with your own.
You can consult TROUBLESHOOTING.md for common issues that developers face and how to resolve them.
The docker environment has not been configured to run tests. Thus, you will need to follow the following local build guide to get tests running locally.
The team uses macOS for development.
Make you sure have the following node version & package manager on your machine:
nvm install 14 npm install pip install "localstack[full]"
to install node modules and Localstack locally to be able to run tests. Note that
localstack[full] is only compatible with Python 3.7 and above.
npm run test
If the backend is already built, you can run
npm run test-ci
npm run test-e2e
will build both the frontend and backend then run our end-to-end tests. The tests are located at
tests/end-to-end. You will need to stop the Docker dev container to be able to run the end-to-end tests.
If you do not need to rebuild the frontend and backend, you can run
npm run test-e2e-ci
An overview of the architecture can be found here.
Scripts for common tasks in MongoDB can be found here.
We welcome all contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas to code open sourced by the Government Technology Agency of Singapore. Contributors should read CONTRIBUTING.md and will also be asked to sign a Contributor License Agreement (CLA) in order to ensure that everybody is free to use their contributions.
Please contact FormSG (firstname.lastname@example.org) for any details.