Skip to content
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ Tools used for development:

Start the Postgres, Django REST, and React services by starting Docker Desktop and running `docker compose up --build`

Local development servers:

- **Frontend (React dev server):** http://localhost:3000 — when developing locally, open the React app at this address.
- **Backend / API (Django):** http://localhost:8000
- *Note:* if you open http://localhost:8000 in a browser you will see a minimal single-page fallback for the frontend, which is non-functional for development. To view the working frontend during development, use http://localhost:3000.

#### Postgres

The application supports connecting to PostgreSQL databases via:
Expand Down
9 changes: 5 additions & 4 deletions config/env/dev.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ SQL_PASSWORD=balancer

# Connection Type Examples:
#
# CloudNativePG (Kubernetes service within cluster):
# SQL_HOST=balancer-postgres-rw
# SQL_HOST=balancer-postgres-rw.balancer.svc.cluster.local
# CloudNativePG (primary — Philthy Civic Cloud shared cluster):
# SQL_HOST=shared-cluster-rw.cloudnative-pg.svc.cluster.local
# SQL_DATABASE=balancer
# (SSL typically not required within cluster)
#
# AWS RDS (External database):
# AWS RDS (legacy — for migration contexts):
# SQL_HOST=balancer-db.xxxxx.us-east-1.rds.amazonaws.com
# SQL_DATABASE=balancer_dev
# (SSL typically required - set SQL_SSL_MODE if needed)
#
# Local development:
Expand Down
9 changes: 7 additions & 2 deletions deploy/manifests/balancer/base/secret.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# repository. Secrets should be created in each target cluster using cluster-specific
# tools (e.g., SealedSecrets in the cfp-sandbox-cluster).
#
# CloudNativePG is the primary database target (Philthy Civic Cloud shared cluster).
# AWS RDS was used previously and may still be referenced for migration contexts.
#
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -20,8 +23,10 @@ stringData:
REACT_APP_API_BASE_URL: https://balancer.sandbox.k8s.phl.io/
SECRET_KEY: randomly_generated_key_ere
SQL_ENGINE: django.db.backends.postgresql
SQL_HOST: sql_host_here
# CloudNativePG (primary): shared-cluster-rw.cloudnative-pg.svc.cluster.local
# AWS RDS (legacy): balancer-db.xxxxx.us-east-1.rds.amazonaws.com
SQL_HOST: shared-cluster-rw.cloudnative-pg.svc.cluster.local
SQL_PORT: '5432'
SQL_DATABASE: balancer_dev
SQL_DATABASE: balancer
SQL_USER: balancer
SQL_PASSWORD: sql_password_here
4 changes: 2 additions & 2 deletions frontend/src/components/Header/MdNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ const MdNavBar = (props: LoginFormProps) => {
</li>
<li className="border-b border-gray-300 p-4">
<Link
to="/login"
to="/"
className="mr-9 text-black hover:border-b-2 hover:border-blue-600 hover:text-black hover:no-underline"
>
Medical Suggester
Medication Suggester
</Link>
</li>
<li className="border-b border-gray-300 p-4">
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/PatientManager/NewPatientForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ const NewPatientForm = ({
id="suicide"
name="suicide"
type="radio"
value="No"
checked={newPatientInfo.Suicide === "No"}
onChange={(e) => handleRadioChange(e, "Suicide")}
className="w-4 h-4 text-indigo-600 border-gray-300 focus:ring-indigo-600"
Expand Down
6 changes: 2 additions & 4 deletions server/api/views/assistant/eval_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
import django
django.setup()

from django.contrib.auth import get_user_model
from django.contrib.auth import get_user_model # noqa: E402

from api.views.assistant.assistant_services import run_assistant
# TODO: remove unused import or use INSTRUCTIONS to record an instructions_hash column
from api.views.assistant.assistant_prompts import INSTRUCTIONS
from api.views.assistant.assistant_services import run_assistant # noqa: E402

logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)
Expand Down
7 changes: 3 additions & 4 deletions server/balancer_backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Import TemplateView for rendering templates
from django.views.generic import TemplateView
import importlib # Import the importlib module for dynamic module importing
import os
from django.conf import settings
from django.http import HttpResponseNotFound
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView, SpectacularRedocView


Expand Down Expand Up @@ -58,10 +61,6 @@
path("api/redoc/", SpectacularRedocView.as_view(url_name="schema"), name="redoc"),
]

import os
from django.conf import settings
from django.http import HttpResponseNotFound


def spa_fallback(request):
"""Serve index.html for SPA routing when build is present; otherwise 404."""
Expand Down
Loading