From b7d8759ff5c2d88fc7218a1b51c34a3c7e7789a9 Mon Sep 17 00:00:00 2001 From: "Darrell Malone Jr." Date: Tue, 4 Nov 2025 18:16:33 -0600 Subject: [PATCH 1/2] Fixes some common development issues. --- docker-compose.yml | 21 ++++++++++++++++++++- frontend/next.config.ts | 8 ++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4e99ab84f..06bba2779 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,8 @@ +networks: + stack: + name: police-data-trust-net + driver: bridge + services: db: image: neo4j:5.23-community @@ -13,6 +18,13 @@ services: - "7687:7687" # Bolt port for database access environment: - NEO4J_AUTH=neo4j/${GRAPH_PASSWORD:-password} + healthcheck: + test: ["CMD-SHELL", "cypher-shell -u ${GRAPH_USER:-neo4j} -p ${GRAPH_PASSWORD:-password} 'RETURN 1' || exit 1"] + interval: 5s + timeout: 5s + retries: 30 + networks: + - stack test-neo4j: image: neo4j:5.23-community profiles: @@ -24,6 +36,8 @@ services: ports: - "7475:7474" - "7688:7687" + networks: + - stack web: build: context: ./frontend @@ -38,6 +52,8 @@ services: NEXT_PUBLIC_API_BASE_URL: http://localhost:${NPDI_API_PORT:-5000}/api/v1 ports: - ${NPDI_WEB_PORT:-3000}:${NPDI_WEB_PORT:-3000} + networks: + - stack api: build: context: . @@ -49,7 +65,8 @@ services: env_file: - ".env" depends_on: - - db + db: + condition: service_healthy environment: PYTHONPATH: app/ FLASK_ENV: ${FLASK_ENV:-development} @@ -60,6 +77,8 @@ services: WAIT_HOSTS: db:7687 ports: - ${NPDI_API_PORT:-5001}:${NPDI_API_PORT:-5001} + networks: + - stack volumes: neo4j: {} neo4j_logs: {} diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 43d92b311..cdc18fc1b 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -5,4 +5,12 @@ const nextConfig: NextConfig = { output: "export" } +module.exports = { + allowedDevOrigins: [ + 'http://localhost:3000', + 'http://127.0.0.1:3000', + '127.0.0.1' + ], +} + export default nextConfig From ab33caae7aba906337bd1854b97c89db63b0013a Mon Sep 17 00:00:00 2001 From: "Darrell Malone Jr." Date: Tue, 4 Nov 2025 19:56:06 -0600 Subject: [PATCH 2/2] Fix formatting and update Readme --- README.md | 4 ++-- frontend/next.config.ts | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8bd61f8e5..dfe3ac832 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This method uses Docker to run the complete application stack. 1. Make sure that [Docker](https://www.docker.com) is installed on your machine. -2. Create a `.env` file by running `cp .env.template .env` in the root of your local project folder, and change GRAPH_PASSWORD to a unique value. +2. Create a `.env` file by running `cp .env.template .env` in the root of your local project folder, and change GRAPH_PASSWORD to a unique value. For windows users, you may need to use `Copy-Item` instead of `cp`. The full statement will be `Copy-Item -Path ".env.template" -Destination ".env"` > **Note** > When running locally, you may need to update one of the ports in the `.env` file if it conflicts with another application on your machine. @@ -58,7 +58,7 @@ All code must pass the unit tests and style checks before it can be merged into ``` -docker exec -it "police-data-trust_api_1" /bin/bash +docker exec -it "police-data-trust-api-1" /bin/bash ``` diff --git a/frontend/next.config.ts b/frontend/next.config.ts index cdc18fc1b..82e266ff0 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -6,11 +6,7 @@ const nextConfig: NextConfig = { } module.exports = { - allowedDevOrigins: [ - 'http://localhost:3000', - 'http://127.0.0.1:3000', - '127.0.0.1' - ], + allowedDevOrigins: ["http://localhost:3000", "http://127.0.0.1:3000", "127.0.0.1"] } export default nextConfig