Skip to content

Commit

Permalink
Migrate to React 18 (#69)
Browse files Browse the repository at this point in the history
# Migrate to React 18.3

## ♻️ Current situation & Problem
The project is currently using React 17, which is now deprecated. As a
result, security updates cannot be applied, and other dependencies also
cannot be added or upgraded since they require React 18 or above.

## ⚙️ Release Notes 

- Migrates the project to React 18.3, which is still supported, and
updates dependencies including react-router, react-dnd,
react-dnd-html5-backend, react-i18next, and typescript.
- Fixes eslint warnings / typescript errors.

### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [X] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
vishnuravi authored Jan 20, 2025
1 parent 9d70f38 commit 6e8033d
Show file tree
Hide file tree
Showing 13 changed files with 21,727 additions and 27,009 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['react-app'],
plugins: ['jest'],
env: {
'jest/globals': true
},
root: true
};
7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Phoenix Contributors
=================================

* [Vishnu Ravi](https://github.com/vishnuravi)
* [Lukas Kollmer](https://github.com/lukaskollmer)

This project was originally forked from https://github.com/helsenorge/structor in August 2022.
41 changes: 25 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build and Test](https://github.com/StanfordBDHG/phoenix/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordBDHG/phoenix/actions/workflows/build-and-test.yml)

A web application that allows you to build healthcare surveys using the [HL7® FHIR® Questionnaire](https://www.hl7.org/fhir/questionnaire.html) international data standard using an interactive, drag-and-drop interface, and export JSON to be used in CardinalKit/Spezi iOS and Android applications to deliver surveys to patients.
A web application that allows you to build healthcare surveys using the [HL7® FHIR® Questionnaire](https://www.hl7.org/fhir/questionnaire.html) international data standard using an interactive, drag-and-drop interface, and export JSON to be used in [Stanford Spezi](https://github.com/StanfordSpezi) iOS and Android applications to deliver surveys to patients.

<img src="figures/home_screenshot.png" />

Expand All @@ -16,7 +16,7 @@ A web application that allows you to build healthcare surveys using the [HL7® F
- Node.js & npm

## Getting Started
- To use the application online, visit https://stanfordbdhg.github.io/phoenix
- To use the application online, visit https://stanfordbdhg.github.io/phoenix.

## Run for Development
- First, ensure that Node.js (version 16 or greater) and npm are installed on your system.
Expand All @@ -31,33 +31,42 @@ A web application that allows you to build healthcare surveys using the [HL7® F
- The build files will be found in the `build/` subdirectory. You may deploy these files to the static web hosting service of your choice.

## Build and Run in Docker
- First, build the docker image:
```
docker build -t phoenix-survey-builder
```
- Then, run the docker image:

First, build the Docker image:

```bash
docker build -t phoenix-survey-builder .
```

Then, run the Docker image:

```bash
docker run -p 8080:80 phoenix-survey-builder
```
(You may substitute `8080` in the command above with a different port of your choice if needed.)

- Open `localhost:8080/phoenix` in your browser to view the application.
> [!TIP]
> You may also substitute `8080` in the command above with a different port of your choice.
Open `localhost:8080/phoenix` in your browser to view the application.

## Deploy to GitHub Pages

The repository contains a GitHub Action that will deploy the application to GitHub pages: [deploy.yml](https://github.com/StanfordBDHG/phoenix/blob/dockerize/.github/workflows/deploy.yml).

Before using the action:
- Update `package.json` with the full GitHub pages URL for your repository in the `homepage` key, i.e. `https://username.github.io/repository`.
- Update the main route path in `src/router/index.tsx` with your repository name:
```
<Route path="/YOUR_REPOSITORY_NAME" exact>
...
1. Update `package.json` with the full GitHub pages URL for your repository in the `homepage` key, i.e. `https://username.github.io/repository`.
2. Update the main route path in `src/router/index.tsx` with your repository name:

```typescript
<Route path="/YOUR_REPOSITORY_NAME" element={
// remainder of code is unchanged
```
## Contributors & License
The Phoenix Survey Builder is licensed under the [MIT license](LICENSE).
Phoenix is based on the [Structor](https://github.com/helsenorge/structor) project. We are grateful to the [Helse Norge](https://github.com/helsenorge) team for open-sourcing their work.
The Phoenix Survey Builder is licensed under the [MIT license](LICENSE). For a full list of contributors, see [CONTRIBUTORS.md](CONTRIBUTORS.md).
Phoenix was originally forked from the [Structor](https://github.com/helsenorge/structor) project in August 2022. We are grateful to the [Helse Norge](https://github.com/helsenorge) team for open-sourcing their work.
## Disclaimer
HL7®, and FHIR® are the registered trademarks of Health Level Seven International and their use of these trademarks does not constitute an endorsement by HL7.
Expand Down
Loading

0 comments on commit 6e8033d

Please sign in to comment.