Private Electronic Health Records (EHR) in Nextcloud
Refer to our detailed documentation here
- Download the last pre-build release
- Extract the
tar.gzinto the apps folder
- Clone the repo in the apps folder
- Run
makein theehrfolder
For building, node and npm are required.
The app can be built using Makefile
During development the webpack dev server can be used to automatically build the code for every change.
Since the compiled source from the webpack dev server need to be injected in the regular Nextcloud sources a proxy setup is needed to combine things.
If your local Nextcloud setup runs at http://localhost:8080, an nginx configuration for the proxy would look like the following:
server {
listen 3001;
server_name localhost;
location /apps/ehr/build/main.js {
proxy_pass http://localhost:3000/build/main.js;
}
location /apps/ehr/build/main.css {
return 404;
}
location /build {
proxy_pass http://localhost:3000;
}
location /__webpack_hmr {
proxy_set_header Host $host;
proxy_pass http://localhost:3000;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
}
location / {
proxy_set_header Host $host;
proxy_hide_header Content-Security-Policy;
proxy_pass http://localhost:8080;
}
}
This will run the proxy at http://localhost:3001/
With the proxy configured you can start the webpack dev server and specify where the Nextcloud proxy is.
PROXY_URL=http://localhost:3001/ make watch
Alternativately, Nextcloud and proxy server can be run in Docker for development using the following steps:
- Create
$HOME/NextcloudWorkspace,$HOME/NextcloudWorkspace/dband$HOME/NextcloudWorkspace/nextcloudfolder - Copy the content of
.developmentfolder in this repo into the$HOME/NextcloudWorkspacefolder - Run
docker-compose up -din the$HOME/NextcloudWorkspacefolder - Wait a bit for Nextcloud initialization
- Update
$HOME/NextcloudWorkspace/nextcloud/config/config.phpto usehttp://localhost:3001url and enable debug mode - Clone the repo in the
$HOME/NextcloudWorkspace/nextcloud/appsfolder - Run
PROXY_URL=http://localhost:3001/ make watch - Go to
http://localhost:3001and enableElectronic Health Records (EHR)application in Nextcloud