Balancer is a website of digital tools designed to help prescribers choose the most suitable medications for patients with bipolar disorder, helping them shorten their journey to stability and well-being
You can view the current build of the website here: https://balancertestsite.com
Balancer is a Code for Philly project
Join the Code for Philly Slack and introduce yourself in the #balancer channel
The project kanban board is on GitHub here
The Code for Philly Code of Conduct is here
Get the code using git by either forking or cloning CodeForPhilly/balancer-main
- Copy the example environment file:
cp config/env/dev.env.example config/env/dev.env
- (Optional) Add your API keys to
config/env/dev.env:OpenAI APIAnthropic API
Tools used for development:
Docker: Install Docker DesktopPostman: Ask to get invited to the Balancer Postman teambalancer_devnpm: In the terminal run 1) 'cd frontend' 2) 'npm install' 3) 'cd ..'
Start the Postgres, Django REST, and React services by starting Docker Desktop and running docker compose up --build
The application supports connecting to PostgreSQL databases via:
- CloudNativePG - Kubernetes-managed PostgreSQL cluster (for production/sandbox)
- AWS RDS - External PostgreSQL database (AWS managed)
- Local Docker Compose - For local development
See Database Connection Documentation for detailed configuration.
Local Development:
- Download a sample of papers to upload from https://balancertestsite.com
- The email and password of
pgAdminare specified inbalancer-main/docker-compose.yml - The first time you use
pgAdminafter building the Docker containers you will need to register the server.- The
Host name/addressis the Postgres server service name in the Docker Compose file - The
UsernameandPasswordare the Postgres server environment variables in the Docker Compose file
- The
- You can use the below code snippet to query the database from a Jupyter notebook:
from sqlalchemy import create_engine
import pandas as pd
engine = create_engine("postgresql+psycopg2://balancer:balancer@localhost:5433/balancer_dev")
query = "SELECT * FROM api_embeddings;"
df = pd.read_sql(query, engine)
- The email and password are set in
server/api/management/commands/createsu.py
The Balancer website is a Postgres, Django REST, and React project. The source code layout is:
Balancer is licensed under the AGPL-3.0 license
