https://simplereport.gov/
brew install docker docker-compose.There are two major pieces:
To run the service, you need a JDK and some way of running postgresql (most people choose to use Docker, but you can also just run it as a service on your development box.) To test the full authentication/authorization/user-management integration, you will also need Okta credentials, but that is not necessary most of the time.
If Java isn't installed on a Mac you can get it from brew:
brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk11
brew install gradle
Another option (also compatible with Linux) is to install with jabba, the Java version manager:
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
jabba install adopt@1.11-0
jabba use adopt@1.11
Running with docker:
cd backenddocker-compose up --buildRunning spring app locally and db in docker
cd backenddocker-compose up -d dbgradle bootRun --args='--spring.profiles.active=dev'Running spring app locally and db in docker on port 5433
cd backenddocker-compose --env-file .env.development up dbSR_DB_PORT=5433 gradle bootRun --args='--spring.profiles.active=dev'For development, it may be more convenient to start the front and backends simultaneously. This can be done by running the following command in the root directory of the project:
make # "make start" if you're nasty
This will start up both servers in "watch" mode, so that changes to the source code result in an immediate rebuild.
By default the local test user is an organization admin role. If you need to change this value to test out other permissions.
It can be set in application-local.yaml. If you have not created one run:
bash
touch backend/src/main/resources/application-local.yaml
Organization roles can be set by adding the following to application-local.yaml:
simple-report:
demo-users:
default-user:
authorization:
granted-roles: ADMIN
current role types are ADMIN, USER, and ENTRY_ONLY. You can check backend/src/main/java/gov/cdc/usds/simplereport/config/authorization/OrganizationRole.java for a list of available roles
ADMIN - an organization admin with full access to their organization
USER - a site user the has access to everything in their organization but the gear icon
ENTRY_ONLY - a site user that only has access to the Conduct Test tab
You can make the default user a site admin by adding the following to application-local.yaml:
simple-report:
site-admin-emails:
- bob@sample.com
Site admins can access the /admin paths and site admin APIs
When there are DB schema changes the backend may throw an error and fail to start.
Restarting the docker way:
cd backenddocker-compose downdocker system prune && docker images prune && docker volume prunedocker-compose up --buildRestarting the SQL way:
db-setup/nuke-db.shgradle bootRun --args='--spring.profiles.active=dev'Go to localhost:8080 to see interact with the graphql api. You would need to point the api endpoint to the backend at: http://localhost:8080/graphql This gives you a preview to query/mutate the local database.
All the tests can be run with gradle test. Make sure that you do not have SPRING_PROFILES_ACTIVE set in your shell environment.
Running a single test with a full stacktrace can be accomplished by supping the path to gradle test. Example
gradle test --tests gov.cdc.usds.simplereport.api.QueueManagementTest.updateItemInQueue --stacktrace
E2E/Integration tests are available using Nightwatch.js.
Run them with the following commands while the app (both front and backends) is already running:
cd frontend
yarn e2e
to edit Spring boot settings for your local set up you must first create a application-local.yaml
(note this file is git ignored):
bash
touch backend/src/main/resources/application-local.yaml
Useful local settings
simple-report:
site-admin-emails:
- bob@sample.com
spring:
jpa:
properties:
hibernate:
format_sql: true
simple-report:
feature-flags:
patient-links: true
http://schemaspy.org/
cd backend
docker-compose up db
docker-compose up --build schemaspy
# to run on a different port than 8081
SR_SCHEMASPY_PORT=8082 docker-compose up --build schemaspy
visit http://localhost:8081
Twilio's Java SDK auto-configures based on two environment variables: TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN. SMS is also disabled by default, and can be enabled in application.yml:
twilio:
enabled: true
from-number: +13214560987
These can also be set by environment variable if desired.
The frontend is a React app. The app uses Apollo to manage the graphql API. For styling the app leverages the U.S. Web Design System (USWDS)
cd frontend && nvm use && yarn installyarn startThis project uses eslint and prettier as frontend linters, and spotless and google-java-format for the backend. GitHub Actions is configured to run these linters on every pull request, so you must resolve all mismatches/errors prior to merging. There are a few ways to manage this:
yarn lint:write in the frontend/ dir, and ./gradlew spotlessApply in the backend/ dir, before every commityarn install in the root dir| Type | Frontend | API | Deployment |
|---|---|---|---|
| Prod | /app/static/commit.txt | /api/actuator/info | Release |
| Demo | /app/static/commit.txt | /api/actuator/info | Release & Action |
| Training | /app/static/commit.txt | /api/actuator/info | Release & Action |
| Staging | /app/static/commit.txt | /api/actuator/info | Action & Daily cron |
| Dev | /app/static/commit.txt | /api/actuator/info | Push to main |
| Test | /app/static/commit.txt | /api/actuator/info | Action |
| Pentest | /app/static/commit.txt | /api/actuator/info | Release & Action |
Navigate to New Release Form pag

v1 then this release should be v2Deploying prod https://github.com/CDCgov/prime-simplereport/releases/tag/0.test/app/static/commit.txt and /api/actuator/infoNavigate to the Github Actions Tab
1. Select the environment you want to deploy to from the workflows list on the left. In this case we are selecting the test environment
2. Click the "Run workflow" button
3. Select the branch you want to deploy. In this case we are deploying the latest commit on main
4. Click the green "Run workflow" button.
5. After the workflow is completed you can verify the changes are live by Checking the deployed commit hash. This is done my going to /app/static/commit.txt and /api/actuator/info
$ claude mcp add prime-simplereport \
-- python -m otcore.mcp_server <graph>