Skip to content

Latest commit

 

History

History
88 lines (71 loc) · 4.11 KB

creating-a-new-application-with-the-us-forms-system-starter-app.md

File metadata and controls

88 lines (71 loc) · 4.11 KB

📖 US Forms System Documentation ➡️ Getting Started with the US Forms System

Creating a new application with the US Forms System Starter App

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."

In this guide

Clone the Starter App repository and change the remote URL

  1. Clone the us-forms-system-starter-app repository to your computer:
$ git clone https://github.com/usds/us-forms-system-starter-app.git
  1. Change the current directory to the new us-forms-system-starter-app directory:
$ cd us-forms-system-starter-app
  1. On GitHub, create a new repository named for your new forms app.
  2. From your new repository on GitHub, copy the clone URL.
  3. In Terminal (Mac and Linux) or the Command Prompt (Windows), review the current remote URL that's set to origin. The fetch and push URLs should be set to https://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)
  1. 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
  1. Review your current remote URL again. origin should be set to your repository on GitHub, not https://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)

Edit your package.json file

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.

  1. Edit the name property to use the name of the repository you created.
"name": "YOUR-NEW-REPOSITORY-NAME"
  1. Edit the version property to be 0.0.1.
"version": "0.0.1"
  1. Edit the description property to give a brief description of your form app.
"description": "Awesome form based on us-forms-system"
  1. 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"
}

Install dependencies

Use npm to install dependencies specified in us-forms-system-starter-app/package-lock.json.

  1. Make sure Node and npm are installed.
  2. In Terminal (Mac and Linux) or the Command Prompt (Windows), use npm to install dependencies for the Starter App:
$ npm install

Build and run your app

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.

Back to Getting Started with the US Forms System