Skip to content

CDCgov/NEDSS-Modernization

Repository files navigation

NEDSS-Modernization

Quality Gate Status

About

Guidelines

Running everything inside docker

  1. Gain access to the NBS source code repository

  2. CD into the cdc-sandbox directory

    cd cdc-sandbox
  3. Run the build_all.sh script

    ./build_all.sh
  4. Visit http://localhost:8080/nbs/login

    username: msa
    password:
    
  5. To create your own user account:

    • Navigate to System Management
    • Expand Security Management
    • Click Manage Users & click Add
    • Enter userId, First Name and Last Name
    • Add a Role(s) & click submit

To learn more about the build process view the cdc-sandbox README

Running the Modernization API and UI in development mode

  1. CD into the cdc-sandbox directory
    cd cdc-sandbox
  2. Start nbs-mssql database
    docker-compose up nbs-mssql -d
  3. Start the reverse-proxy configured to point to non-docker API and UI. For more details see Running with local servers.
    MODERNIZATION_UI_SERVER=host.docker.internal MODERNIZATION_UI_PORT=3000 MODERNIZATION_API_SERVER=host.docker.internal MODERNIZATION_API_PORT=9080 docker-compose up reverse-proxy -d
  4. CD into the root directory
    cd ..
  5. Start the modernized api on port 9080. Port 5005 will be open for debugger attachment.
    ./gradlew :modernization-api:bootRun --args='--server.port=9080'
  6. CD into the modernization-ui folder
    cd apps/modernization-ui/    
  7. Launch the ui application
    npm run start
  8. Access the UI localhost:3000

Code Formatting

Print Artifact Version

./gradlew printVersion


> Task :printVersion
Version: 1.0.0-SNAPSHOT

Running with local servers

By default, the reverse proxy will route to the containerized services. Routing to a local services can be achieved by altering the configuration to point to the local instances.

Name Default Description
MODERNIZATION_UI_SERVER modernization-ui The host name of the server that provides the frontend UI.
MODERNIZATION_UI_PORT 80 The port the frontend UI is served from.
MODERNIZATION_API_SERVER modernization-api The host name of the server that provides the backend API.
MODERNIZATION_API_PORT 8080 The port that modernization-api is served from.
PAGEBUILDER_API pagebuilder-api The host name of the server that provides the page-builder API.
PAGEBUILDER_API_PORT 8095 The port that page-builder is served from.
NBS_GATEWAY_SERVER nbs-gateway The host name of the server that provides the NBS Gateway.
NBS_GATEWAY_PORT 8000 The port the NBS Gateway is served from.

Configuring the Reverse Proxy to use local modernization-ui

Start the frontend UI locally by running the following command from the apps/modernization-ui folder.

npm run start

Start the reverse proxy configured to route to the local frontend instance by running the following command from the cdc-sandbox folder

MODERNIZATION_UI_SERVER=host.docker.internal MODERNIZATION_UI_PORT=3000 docker compose up -d reverse-proxy

Configuring the Reverse Proxy to use local modernization-api

Start the backend API locally listening on port 9080 from the root project folder. The cdc-sandbox exposes the reverse-proxy on port 8080, which is the default port for Spring Boot. It must be changed in order for the backend to stat properly.

./gradlew :modernization-api:bootRun --args='--server.port=9080'

Start the reverse proxy configured to route to the local backend by running the following command from the cdc-sandbox folder

MODERNIZATION_API_SERVER=host.docker.internal MODERNIZATION_API_PORT=9080 docker compose up -d reverse-proxy

Configuring the Reverse Proxy to use local pagebuilder-api

Start the question-bank applicaiton.

./gradlew :question-bank:bootRun'

Start the reverse proxy configured to route to the local backend by running the following command from the cdc-sandbox folder

PAGEBUILDER_API=host.docker.internal PAGEBUILDER_API_PORT=8095 docker compose up -d reverse-proxy

Resetting to Docker only

Start the reverse proxy by running the following command from the cdc-sandbox folder

docker compose up -d reverse-proxy