Skip to content

Online application that allows Illinois residents to apply for the Child Care Assistance Program (CCAP)

License

Notifications You must be signed in to change notification settings

codeforamerica/il-gcc-form-flow

Repository files navigation

Online Application for the Illinois Child Care Assistance Program (CCAP)

About GetChildCareIL

Product

Get Child Care IL (abbreviated as IL-GCC) allows families in Illinois to apply online for the Child Care Assistance Program (CCAP). CCAP is a benefit program funded by the Illinois Department of Human Services (IDHS) that helps cover the cost of child care, with eligibility based on income level and family size.

When a family is approved for CCAP, IDHS pays their child care provider(s) directly, to subsidize some or all of the cost of their children’s care. Examples of CCAP providers include daycare centers, afterschool programs, or care from a friend or family member.

Families apply through the site by answering questions and uploading supporting documents. Once a family has submitted their application, they are prompted to notify their chosen child care provider(s). The provider(s) can use the app to reply to the family's request for care, fill out their respective info, and register as a new CCAP provider if applicable. The provider's information is added to the family's application, after which the combined application (containing both the family and provider data) along with all submitted supporting documents are transmitted to the State of IL's Child Care Management System (CCMS) via an API request.

From there, the application will assigned to a dedicated Child Care Referral and Resource (CCR&R) agency for processing and eligibility determination.

Technology

This application is a Java Spring Boot application built on Code for America's open source Form Flow Library (form-flow). It utilizes common, frequently-used libraries throughout, most of which are free and open source.

  • form-flow is included in the application's build.gradle, along with all other dependencies. A detailed explanation of form-flow concepts and underlying functionality can be found in the library's README
  • JobRunr is used in this application to manage background jobs (eg, scheduling of email notifications, submission of applications over https)

In addition, the following product capabilities are enabled using third-party services:

I. Local development set up instructions

Git

  1. First, ensure that you have git installed on your local machine. If desired, you can also install a Github desktop client or preferred git plugin for your IDE.
  2. Clone this repository into your local environment. From your command line:
 git clone git@github.com:codeforamerica/il-gcc-form-flow.git

Environment variables

You'll need to provide some environment variables to run this application locally.

  1. To do this, create a new .env file by copying the sample.env file in the root directory of your project:
cp sample.env .env
  1. You can find the dev environment variables and configs in the Shared-SNLAB-IL folder in LastPass. Put those values into your .env file.
  2. If you use IntelliJ IDEA, download the EnvFile plugin and follow the setup instructions here to set up Run Configurations with EnvFile. (see more IDE setup instructions below)

Dev set up: script for Mac and Linux

The setup.sh script:

  • uses Homebrew to install all the necessary dependencies (such as java, gradle, postgres, node)
  • runs the generate_localhost_cert.sh script, which installs dependencies to create an SSL certification so you can use https with localhost during development
  • creates the main app database and users needed to run the application locally
  • creates the database needed for running tests, and then runs the tests

To run from the command line, go to the root of the repository and run the setup.sh script:

./scripts/setup.sh

Or, run from within IntelliJ by clicking on the setup.sh file in the scripts directory and select Run 'setup.sh'.

Dev set up: Windows (manual)

Install dependencies

  1. Install Java Temurin v 21
    • Set 21 as your Java version in JAVA_HOME - see docs
  2. Install Gradle v8.11 or higher
  3. Install Postgres v14 or higher
  4. Install Libreoffice

Create databases

  1. Make sure postgres is running
  2. Run the sql commands from the setup.sh script

Run tests

./gradlew clean test

Create cert for https on localhost

./generate_localhost_cert.sh

Running the app for the first time

  1. If you need to set up the IntelliJ IDE, start by following the instructions from the form flow library here.
  2. In IntelliJ, run the application using the IlGCCApplication configuration (found in org.ilgcc.app). The run will fail, but it will create a new run configuration in IntelliJ.
  3. Open this new run configuration and configure it to use the .env file you created earlier with the EnvFile plugin:
    • Run -> Edit Configurations -> IlGCCApplication.
    • Select Enable EnvFile and manually add the .env file you created using the + button.
  4. In your .env file, make sure the SPRING_PROFILES_ACTIVE is set to dev
  5. Run the application again. The application should start up successfully.

Seeding your local database

The following steps will allow you to seed your local db with the necessary counties, providers, and resource organizations:

  • Import zip code <> county mapping data
  • Import resource organization data
  • Import provider data

Set up Live Reload

Live Reload is very helpful when making changes to HTML templates, CSS, or JavaScript. Here are instructions on how to get IntelliJ to reload resources and have the LiveReload browser extension automatically reload the browser tab for you.

  1. Download live reload extension in your browser of choice:
  2. Restart your browser after install
  3. In IntelliJ, go to Edit configuration -> Modify options * On Frame deactivation: * Check - Update classes and resources
  4. Run your application from IntelliJ
  5. In your browser, go to http://localhost:8080/
  6. Check that the live reload extension is "turned on", it will either be a solid color or a filled dot in the middle of the icon
  7. Now when you move focus away from IntelliJ, it will trigger an update and will then trigger a browser refresh

📹 Here's a video going step by step through these instructions.

II. Development

Tests

This application includes the following types of automated tests:

To compile and run all tests:

./gradlew clean test

To run accessibility tests:

./gradlew accessibilityTest

To run a single journey test:

./gradlew test --tests org.ilgcc.app.journeys.GccFlowJourneyTest.fullGccFlow

Scripts

In the scripts directory, you can find the following useful scripts:

- setup.sh

(see above)

- generate_localhost_cert.sh

(see above)

- generate_migration.sh

This script will generate an empty migration file and place it in the following directory: src/main/resources/db/migration. If you'd like to change this location, you can edit the generate_migration.sh file and update the migrations_paths variable.

The script will create the migration directory if it does not already exist.

It will prompt you to enter a short description of what the migration will do. It will then generate the file, with a name based on that description. The script will then open up the migration file in IntelliJ for you.

To run the script, simply type:

 ./generate_migration.sh

Note: if it does not run on the command line, you may need to give the script executable permission first, by running chmod u+x generate_migration.sh

Troubleshooting IntelliJ

Application Won't Run After IntelliJ Update

Sometimes an IntelliJ update will cause the ILGCCApplication run context to fail. Here are some ways to attempt to fix it.

  1. Invalidate the cache
    • File -> Invalidate Caches...
    • This will invalidate the caches and restart IntelliJ.
    • Afterward, try to run the application. If this issue isn't fixed, try suggestion 2.
  2. Remove .idea/modules
    • In the root of the repository, look for .idea/modules
    • Make a copy of this folder and save somewhere else
    • Delete this folder and all of its contents
    • Quit IntelliJ
    • Open IntelliJ, rebuild the project, hopefully modules are re-created from the application context
  3. If both of the above fail
    • Make a copy of the entire .idea folder and save somewhere else.
    • Delete the original .idea folder
    • Quit IntelliJ
    • Open IntelliJ, rebuild the project, hopefully modules are re-created from the application context and found

Contributing Live Templates to Your App

If you have created live templates with fragments which are specific to your application based on a starter app template, you can commit them to your repository. You will follow a similar pattern to create templates to what is outlined in the form-flow library here.

An example template which was set up using this process, starting from an html snippet is available in this repository's IntelliJ settings folder.

If you want to use a local version of the Form-Flow Library (for library development)

To use a local version of the form-flow, library you can do the following:

  1. Clone the form-flow repo in the same directory as the starter app.
  2. Build the form-flow library jar.
  3. In this starter app, set the SPRING_PROFILES_ACTIVE to dev in the .env file.
  4. Start the form-flow-starter-app.

Changing the SPRING_PROFILES_ACTIVE to dev will cause the starter app's build.gradle to pull in the local library, via this line:

implementation fileTree(dir: "$rootDir/../form-flow/lib/build/libs", include: '*.jar')

Actuator Endpoints

The Actuator is a feature Spring Boot provides to monitor and interact with your application. It opens endpoints that can be queried to get information about your application, like health and build information.

This app, by default, enables full access to all actuator endpoints in the dev profile for local development. However, in other profiles, it restricts access, allowing only the health and build information endpoints to be available for use outside of local development.

** ⚠️ This feature can be a large security concern if certain endpoints are open. ⚠️**

Please read the following section in Form Flow Library's documentation as well as Spring Boot's documentation. It's extremely important that you understand the actuator and what it provides and the risks, so that you can configure the feature accordingly.

III. Cloud infrastructure

Option 1. AWS set up

To run set up this application to run exclusively on AWS, please see https://github.com/codeforamerica/il-gcc-infra

Option 2. Aptible + AWS set up

Aptible Setup

For Aptible configuration information, please see their documentation.

The Aptible CLI documentation is particularly helpful.

Here are the general steps to setup a new application in Aptible:

  1. Create a new environment and application in Aptible, or create a new application in an existing environment.
  2. Setup Aptible permissions to enable deploying your application, if they do not already exist.
  3. Provision a database for your application in Aptible.
  4. Add repository secrets for the deploy github action.

AWS S3 document storage

  1. Provision a new AWS S3 bucket.
    1. We use two buckets: one for non-production purposes and another for production.
  2. Replace the bucket names with your newly created buckets in the main application configuration and the demo application configuration.

Deployment in Aptible to a Custom URL

These instructions guide you through the process of creating resources in Aptible + AWS which will allow you to deploy your application to a custom domain with root domain forwarding. Please create the resources in the specified order, as there are dependencies:

Route53 Setup

  1. Create a new hosted zone with the name corresponding to the root domain of your purchased domain name.

Aptible Endpoint Setup

  1. Create a new managed HTTPS endpoint for your root domain with subdomain (i.e. www)
  2. In Aptible, be sure to include the following variable in your application's configuration environment: FORCE_SSL=true.
  3. Follow the instructions to create managed HTTPS validation records in Route53

Request Public Certificate

  1. Request certificate in AWS Certificate Manager (ACM) for your purchased domain name. If you would like to support directing non-www to www traffic, please use your root domain for the fully qualified domain name in the request.
  2. Create records in AWS Route53

S3 Static Hosting for Redirect Requests (non-www traffic -> www)

  1. Create a new S3 bucket with your root domain.
  2. Under the bucket properties, configure static website hosting with hosting type of Redirect requests for an object. Select Protocol of none.

Cloudfront Distribution Setup

  1. Create a new CloudFront distribution with CNAME corresponding to your root domain
  2. Associate the certificate that you created for your root domain. All other settings can remain as defaults.
  3. Create a Route53 Alias record for the root domain which points to your cloudfront distribution.

About

Online application that allows Illinois residents to apply for the Child Care Assistance Program (CCAP)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 22