Setting Up a Development Environment
This guide will walk you through setting up HydroServer for local development.
Contributing
This guide is for setting up a local development instance of HydroServer which may be useful if you fork our repository and need to modify code. HydroServer is open source, and if you'd like to contribute directly to our repository, checkout our contributing guide.
Prerequisites
Before starting, make sure you have the following software installed on your machine:
- Python 3.14+
- Docker
- Node.js: The frontend uses various Node.js libraries. Check the package.json for specific version requirements.
- npm (typically bundled with Node.js): This is required to install the project's dependencies.
NGINX Reverse Proxy and Development Database
Installation
- Clone the repository:bash
git clone https://github.com/hydroserver2/hydroserver.git cd hydroserver/deploy/dev - Create environment variables for static and media file paths. The default locations of these folders should be
/staticand/mediawithin thehydroserverproject folder. Mac/Linux:bashWindows:export HS_MEDIAFILES="/path/to/media" export HS_STATICFILES="/path/to/static"cmdset HS_MEDIAFILES=C:\path\to\media set HS_STATICFILES=C:\path\to\static - Start Docker containers. All services can be accessed in a browser at
http://localhost.bashThe bundled NGINX config proxiesdocker compose --file "docker-compose.yaml" up/.well-known/,/identity/,/accounts/,/admin/, and/api/to Django so the local OIDC authorization flow works throughhttp://localhost.
HydroServer Django Backend
Installation
- Clone the repository:bash
git clone https://github.com/hydroserver2/hydroserver.git cd hydroserver - Install the Python dependencies:bash
pip install -r django/requirements.txt pip install -e packages/hydroserverpy - Perform database migrations and collect static files:bash
./scripts/dev-api-command manage.py migrate ./scripts/dev-api-command manage.py collectstatic --noinput - Create an admin user:bash
./scripts/dev-api-command manage.py createsuperuser - Start the Django development web server:bash
./scripts/dev-api-command manage.py runserver 127.0.0.1:8000
If you need OIDC identity provider features (discovery, authorize, token, and JWKS endpoints), generate a signing key first:
bash
openssl genpkey -algorithm RSA -out django/dev_oidc_private_key.pem -pkeyopt rsa_keygen_bits:2048HydroServer Frontend
Data Management App
- Navigate to
apps/data-managementand install the required packages:bashnpm install - Create a .env file and update variables as needed. For getting started, the default settings should be sufficient.
- Run the application in developer mode:bash
npm run dev - Open
http://localhost. The reverse proxy forwards frontend requests to Vite and backend requests, including the OIDC endpoints, to Django.
QC App
- Navigate to
apps/qc-appand install the required packages:bashnpm install - Run the application in developer mode:bash
npm run dev - Open
http://localhost/qc. The reverse proxy forwards these requests to the QC app's Vite server; no separate environment configuration is needed since backend requests are already routed through NGINX.
