UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

platform1-site

Static site for https://p1.dso.mil Staging url: https://p1.staging.dso.mil

Requirements

  • nodejs v16 installed
    • Windows Installation:
    • Linux Installation:
      npm cache clean -f
      npm install -g n
      n 16

Project setup

npm install

Compiles and hot-reloads for development

npm run dev

Compiles and minifies for production

npm run build

Run your unit tests

npm run test:unit

Run your end-to-end tests

CI end-to-end tests

npm run test:e2e-ci

GUI end-to-end tests

npm run test:e2e

Lints and fixes files

npm run lint

Run production build in NGINX production environment using Docker

npm run build

docker pull registry.il2.dso.mil/platform-one/products/bullhorn/padawan/padawan-umbrella:1.0.2

docker run -it --rm \
--name=platform-one-site \
-p 9999:8080 \
-v $PWD/dist:/var/www \
-v $PWD/tests/custom-csp.conf:/etc/nginx/conf.d/site-config/custom-csp.conf \
registry.il2.dso.mil/platform-one/products/bullhorn/padawan/padawan-umbrella:1.0.5

Searching

Since the P1 site is a static site, we use lunrjs for generating a search index and for client-side searching.

To generate a search index, run:

npm run generate-search-index

The search index is stored in src/assets/data/search-index.json and the search content is stored in src/assets/data/search-data.json. We store the search content to provide context-aware hints in the search results rather than just presenting the page where the search term matched something on the page.

To ensure the search index is up to date with the site content we generate the search index on a git pre-commit hook.