2018-08-06 10:44:00 -04:00
2018-08-06 10:44:00 -04:00
2018-08-03 15:21:20 -04:00
2018-08-03 13:16:31 -04:00
2018-06-04 17:13:24 -04:00
2018-08-06 10:44:00 -04:00
2018-08-06 10:44:00 -04:00
2018-08-03 11:39:56 -04:00
2018-08-03 13:31:39 -04:00
2018-08-06 10:44:00 -04:00
2018-06-04 22:36:20 -04:00
2018-08-03 11:38:20 -04:00
2018-07-13 09:16:00 -04:00
2018-06-18 10:42:07 -04:00
2018-08-03 15:54:29 -04:00
2018-07-31 11:49:06 -04:00
2018-08-02 13:18:44 -04:00
2018-06-14 13:53:18 -04:00
2018-05-23 08:50:39 -04:00
2018-08-06 10:44:00 -04:00
2018-06-26 10:31:39 -04:00
2018-05-24 12:27:41 -04:00
2018-08-02 14:37:16 -04:00

ATST

Build Status

Description

This is the main user-facing web application for the ATAT stack. All end-user requests are handled by ATST, with it making backend calls to various microservices when appropriate.

Installation

Requirements

See the scriptz repository for the shared requirements and guidelines for all ATAT applications. Additionally, ATST requires a redis instance for session management. Have redis installed and running. By default, ATST will try to connect to a redis instance running on localhost on its default port, 6379.

Cloning

This project contains git submodules. Here is an example clone command that will automatically initialize and update those modules:

git clone --recurse-submodules git@github.com:dod-ccpo/atst.git

If you have an existing clone that does not yet contain the submodules, you can set them up with the following command:

git submodule update --init --recursive

Setup

This application uses Pipenv to manage Python dependencies and a virtual environment. Instead of the classic requirements.txt file, pipenv uses a Pipfile and Pipfile.lock, making it more similar to other modern package managers like yarn or mix.

To perform the installation, run the setup script:

script/setup

The setup script creates the virtual environment, and then calls script/bootstrap to install all of the Python and Node dependencies.

To enter the virtualenv manually (a la source .venv/bin/activate):

pipenv shell

If you want to automatically load the virtual environment whenever you enter the project directory, take a look at direnv. An .envrc file is included in this repository. direnv will activate and deactivate virtualenvs for you when you enter and leave the directory.

Running (development)

To start the app locally in the foreground and watch for changes:

script/dev_server

To watch for changes to any js/css assets:

yarn watch

Users

There are currently six mock users for development:

  • Sam (a CCPO)
  • Amanda
  • Brandon
  • Christina
  • Dominick
  • Erica

To log in as one of them, navigate to /login-dev?username=<lowercase name>. For example /login-dev?username=amanda.

Testing

Tests require a test database:

createdb atat_test

To run lint, static analysis, and unit tests:

script/test

To run only the unit tests:

pipenv run python -m pytest

To re-run tests each time a file is changed:

pipenv run ptw

Notes

tornado templates are like mustache templates -- add the following to ~/.vim/filetype.vim for syntax highlighting:

:au BufRead *.html.to set filetype=mustache

Icons

To render an icon use {% module Icon('name') %} in a template, where name is the filename of an svg file in static/icons.

All icons used should be from the Noun Project, specifically this collection if possible.

SVG markup should be cleaned an minified, Svgsus works well.

Deployment

The /login-dev endpoint is protected by HTTP basic auth when deployed. This can be configured for NGINX following the instructions here. The following config should added within the main server block for the site:

location /login-dev {
    auth_basic "Developer Access";
    auth_basic_user_file /etc/apache2/.htpasswd;
    [proxy information should follow this]
}

The location block will require the same proxy pass configuration as other location blocks for the app.

Description
No description provided
Readme 17 MiB
Languages
Python 48.6%
HTML 43.1%
JavaScript 3.7%
SCSS 3.7%
Shell 0.8%
Other 0.1%