📖 US Forms System Documentation ➡️ Getting Started with the US Forms System
The US Forms System Starter App creates the initial files, configuration, build process, and web server you need to start building your form.
Before you begin, review "Tools for getting started with the US Forms System."
- Clone the Starter App repository and change the remote URL
- Edit your
package.json
file - Install dependencies
- Build and run your app
- Clone the us-forms-system-starter-app repository to your computer:
$ git clone https://github.com/usds/us-forms-system-starter-app.git
- Change the current directory to the new us-forms-system-starter-app directory:
$ cd us-forms-system-starter-app
- On GitHub, create a new repository named for your new forms app.
- From your new repository on GitHub, copy the clone URL.
- In Terminal (Mac and Linux) or the Command Prompt (Windows), review the current remote URL that's set to
origin
. Thefetch
andpush
URLs should be set tohttps://github.com/usds/us-forms-system-starter-app.git
:
$ git remote -v
# Lists all remote repositories, along with the URL for those remotes.
origin https://github.com/usds/us-forms-system-starter-app.git (fetch)
origin https://github.com/usds/us-forms-system-starter-app.git (push)
- Change your
origin
to use the URL for the new remote repository you created in Step 3 and copied in Step 4:
$ git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-NEW-REPOSITORY-NAME.git
# Changes 'origin' to the new remote's URL
- Review your current remote URL again.
origin
should be set to your repository on GitHub, nothttps://github.com/usds/us-forms-system-starter-app.git
:
$ git remote -v
# Lists all remote repositories, along with the URL for those remotes.
origin https://github.com/YOUR-USERNAME/YOUR-NEW-REPOSITORY-NAME.git (fetch)
origin https://github.com/YOUR-USERNAME/YOUR-NEW-REPOSITORY-NAME.git (push)
Now that you've created a new app in a new repository based on the us-forms-system-starter-app, you must reference your app in your package.json
file.
- Edit the
name
property to use the name of the repository you created.
"name": "YOUR-NEW-REPOSITORY-NAME"
- Edit the
version
property to be0.0.1
.
"version": "0.0.1"
- Edit the
description
property to give a brief description of your form app.
"description": "Awesome form based on us-forms-system"
- Edit the
repository
property to specify the URL for your repository on GitHub, as well as the type of repository it is (Git).
"repository": {
"type": "git",
"url": "https://github.com/YOUR-USERNAME/YOUR-NEW-REPOSITORY-NAME.git"
}
Use npm to install dependencies specified in us-forms-system-starter-app/package-lock.json
.
- Make sure Node and npm are installed.
- In Terminal (Mac and Linux) or the Command Prompt (Windows), use npm to install dependencies for the Starter App:
$ npm install
Once your repository is set up and dependencies are installed, you can begin building your app by editing /js/config/form.js
. For more information, see "Creating a form config file."
To run your app locally, in Terminal (Mac and Linux) or the Command Prompt (Windows), type npm start
. Once the server has started, you can view your form in a browser window at localhost:8080
.