2022-11-08 09:44:09 -05:00
# Notify UI
2015-11-18 16:32:15 +00:00
2022-11-08 09:44:09 -05:00
This is the Notify front-end for government users and admins. To see it in action, check out [the demo site ](https://notify-demo.app.cloud.gov ) (contact team for credentials).
2022-08-01 11:14:37 -07:00
2022-11-08 09:44:09 -05:00
Through the interface, users can:
2015-11-23 14:37:29 +00:00
2023-04-24 15:52:38 -04:00
- Register and manage users
- Create and manage services
- Send batch SMS by uploading a CSV
- View their history of notifications
Use a Node-based tools for handling assets
…or how to move a bunch of things from a bunch of different places into
`app/static`.
There are three main reasons not to use Flask Assets:
- It had some strange behaviour like only
- It was based on Ruby SASS, which is slower to get new features than libsass,
and meant depending on Ruby, and having the SASS Gem globally installed—so
you’re already out of being a ‘pure’ Python app
- Martyn and I have experience of doing it this way on Marketplace, and we’ve
ironed out the initial rough patches
The specific technologies this introduces, all of which are Node-based:
- Gulp – like a Makefile written in Javascript
- NPM – package management, used for managing Gulp and its related dependencies
- Bower – also package management, and the only way I can think to have
GOV.UK template as a proper dependency
…speaking of which, GOV.UK template is now a dependency. This means it can’t be
modified at all (eg to add a global `#content` wrapper), so every page now
inherits from a template that has this wrapper. But it also means that we have a
clean upgrade path when the template is modified.
Everything else (toolkit, elements) I’ve kept as submodules but moved them to a
more logical place (`app/assets` not `app/assets/stylesheets`, because they
contain more than just SASS/CSS).
2015-12-15 08:20:25 +00:00
2022-11-08 09:44:09 -05:00
The [Notify API ](https://github.com/GSA/notifications-api ) provides the UI's backend and is required for most things to function. Set that up first!
2022-04-05 12:00:26 +01:00
2022-11-08 09:44:09 -05:00
## Local setup
2016-03-23 14:09:07 +00:00
2023-03-14 16:00:40 -04:00
### Common steps
2023-04-24 15:52:38 -04:00
1. Install pre-requisites for setup:
- [jq ](https://stedolan.github.io/jq/ ): `brew install jq`
- [terraform ](https://www.terraform.io/ ): `brew install terraform` or `brew install tfenv` and use `tfenv` to install `terraform ~> 1.4.0`
- [cf-cli@8 ](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html ): `brew install cloudfoundry/tap/cf-cli@8`
1. [Log into cloud.gov ](https://cloud.gov/docs/getting-started/setup/#set-up-the-command-line ): `cf login -a api.fr.cloud.gov --sso`
1. Ensure you have access to the `notify-local-dev` and `notify-staging` spaces in cloud.gov
1. Run the API setup steps
1. Run the development terraform with:
2023-03-14 16:00:40 -04:00
```
$ cd terraform/development
$ ./run.sh
```
2023-04-24 15:52:38 -04:00
1. If you want to send data to New Relic from your local develpment environment, set `NEW_RELIC_LICENSE_KEY` within `.env`
1. Follow the instructions for either `Direct installation` or `Docker installation` below
2023-03-14 16:00:40 -04:00
### Direct installation
2016-08-17 15:59:16 +01:00
2022-11-08 09:44:09 -05:00
1. Get the API running
2022-08-05 15:29:51 +00:00
2022-11-08 09:44:09 -05:00
1. Install [pipenv ](https://pipenv.pypa.io/en/latest/ )
2022-08-05 15:29:51 +00:00
2022-11-08 09:44:09 -05:00
1. Install Python and Node dependencies
2022-08-05 15:29:51 +00:00
2023-04-24 15:52:38 -04:00
`make bootstrap`
2015-11-25 15:29:12 +00:00
2022-11-08 09:44:09 -05:00
1. Run the Flask server
2022-08-05 15:29:51 +00:00
2023-04-24 15:52:38 -04:00
`make run-flask`
2022-08-05 15:29:51 +00:00
2022-11-08 09:44:09 -05:00
1. Go to http://localhost:6012
2022-08-05 15:29:51 +00:00
2023-03-14 16:00:40 -04:00
### Docker installation
If you are using VS Code, there are also instructions for [running inside Docker ](./docs/docker-remote-containers.md )
2021-02-22 17:12:03 +00:00
## To test the application
2023-04-24 15:52:38 -04:00
2022-08-01 11:14:37 -07:00
From a terminal within the running devcontainer:
2021-02-22 17:12:03 +00:00
```
2021-05-11 18:20:40 +01:00
# run all the tests
2021-02-22 17:12:03 +00:00
make test
2021-05-11 18:20:40 +01:00
# continuously run js tests
npm run test-watch
2021-02-22 17:12:03 +00:00
```
2018-07-10 15:16:14 +01:00
2021-05-11 18:20:40 +01:00
To run a specific JavaScript test, you'll need to copy the full command from `package.json` .
2022-08-30 10:31:48 -04:00
## Running a11y-scans locally
Unlike most of the tests and scans, pa11y-ci cannot currently be run from within the VSCode dev container.
2023-04-24 15:52:38 -04:00
1. `make run-flask` from within the devcontainer
2022-08-30 10:31:48 -04:00
2. Run `make a11y-scan` from your host computer.
2022-11-08 09:44:09 -05:00
## Further docs from UK
2018-12-14 16:25:31 +00:00
2021-02-22 17:15:09 +00:00
- [Working with static assets ](docs/static-assets.md )
2022-04-05 12:00:26 +01:00
- [JavaScript documentation ](https://github.com/alphagov/notifications-manuals/wiki/JavaScript-Documentation )
2021-12-29 15:01:21 +00:00
- [Updating dependencies ](https://github.com/alphagov/notifications-manuals/wiki/Dependencies )
2022-11-07 11:29:20 -05:00
## License && public domain
2022-11-07 12:24:46 -05:00
Work through [commit `543be77` ](https://github.com/GSA/notifications-admin/commit/543be77776b64fddb6ba70fbb015ecd81a372478 ) is licensed by the UK government under the MIT license. Work after that commit is in the worldwide public domain. See [LICENSE.md ](./LICENSE.md ) for more information.
2022-11-07 11:29:20 -05:00
## Contributing
As stated in [CONTRIBUTING.md ](CONTRIBUTING.md ), all contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
2022-11-08 16:10:50 -05:00
## About the TTS Public Benefits Studio
The Public Benefits Studio is a team inside of [GSA’ s Technology Transformation Services ](https://www.gsa.gov/about-us/organization/federal-acquisition-service/technology-transformation-services ) (TTS), home to innovative programs like [18F ](https://18f.gsa.gov/ ) and [Login.gov ](https://login.gov ). We collaborate with benefits programs to develop shared technology tools and best practices that reduce the burden of navigating government programs for low income individuals and families.
We’ re a cross-functional team of technologists with specialized experience working across public benefits programs like Medicaid, SNAP, and unemployment insurance.
For more information on what we're working on, the Notify tool, and how to get involved with our team, [see our flyer. ](https://github.com/GSA/notifications-admin/blob/main/docs/notify-pilot-flyer.md )