Skip to content

Commit

Permalink
Merge pull request #1 from beda-software/support-windows
Browse files Browse the repository at this point in the history
Add dev mode support in Windows system
  • Loading branch information
ir4y authored Nov 14, 2023
2 parents c69555e + a931362 commit 8899663
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env.windows.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AIDBOX_LICENSE=
HOST_OS=Windows
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ Password: `password`
## Local environment
To run it locally you will need a license that you can get here [aidbox.app](https://aidbox.app/ui/portal#/signin)
Then add a `.env` file that contains the store license key in the `AIDBOX_LICENSE` variable.

Run aidbox with docker: `docker compose up`

If docker is not already installed on your system, you can download and install it from the official docker [website](https://docs.docker.com/get-docker/)

## SMART launch track
For the smart launch track I have prepared a simple SMART on FHIR app that just loads a list of patients.
The source code is available in [smart](https://github.com/beda-software/au-core-aidbox/tree/main/) folder of this repository.
Expand All @@ -23,4 +26,4 @@ You can launch it locally with npm, or use smart-app docker compose profile
docker compose --profile smart-app up
```
The app launches in dev mode so any changes in the source code will be represented in the browser.
If you are a Windows user, you should add `HOST_OS=Windows` into .env file. It enable file polling that is required for code reload in Windoes.
2 changes: 2 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ services:
profiles: ["smart-app"]
smart-app:
build: ./smart
env_file:
- .env
command: npm run dev
ports:
- "5173:5173"
Expand Down
3 changes: 3 additions & 0 deletions smart/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

const isWindowsHost = process.env.HOST_OS === 'Windows';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: '0.0.0.0',
watch: isWindowsHost ? { usePolling: true } : undefined,
},
})

0 comments on commit 8899663

Please sign in to comment.