mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-28 21:20:56 -04:00
74da3b1adfc7bd98baa0f2759956e2486fad65c6
ES6 has some nice new features. Specifically relevant to this piece of work are: Arrow functions[1], whose `this` context is bound the value of `this` in the current scope and can’t be overidden. The code is cleaner as a result, and doesn’t need the addition of a bind polyfill for older browsers. Template strings[2], which are similar to triple-quoted multi line strings in Python. This means less fiddly and error-prone string concatenation. This commit adds Babel[3] to the Gulp pipeline. This transpiles Javascript written to the ES6 specification into code which is compatible with older browsers that don’t understand ES6 syntax. It also rewrites the gulpfile itself using some ES6 syntax, for the same reasons. 1. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions 2. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings 3. https://babeljs.io
…
…
…
…
…
…
…
notifications-admin
Application to handle the admin functions of the notifications application.
Features of this application:
- Register users
- Register services
- Download CSV for an email or sms batch
- Show history of notifications
- Reports
Create a virtual environment for this project
mkvirtualenv -p /usr/local/bin/python3 notifications-admin
Building the frontend
You need Node which will also get you NPM, Node's package management tool.
brew install node
Most of the frontend dependencies are managed using Git Submodules. Some are managed with NPM and Bower. To install or update all the things, run
git submodule init --update
npm install
If you want the front end assets to re-compile on changes, leave this running in a separate terminal from the app
npm run watch
Running the application:
pip install -r requirements.txt
./scripts/bootstrap.sh
./scripts/run_app.sh
Note: the ./scripts/bootstrap.sh script only needs to be run the first time to create the database.
URL to test app:
localhost:6012/helloworld
Domain model
All the domain models are defined in the models.py file.
Description
Languages
Python
69.3%
HTML
16.6%
JavaScript
11.1%
SCSS
0.9%
Nunjucks
0.7%
Other
1.4%