josephmasson26 / DiagnoseMe

Empowering Tomorrow's Doctors, Today
MIT License
4 stars 0 forks source link

Dual Ported DiagnoseMe! #106

Closed josephmasson26 closed 7 months ago

josephmasson26 commented 7 months ago

This PR adds functionality to run DiagnoseMe as a web app in browser (hosted on local port) and in your desktop (run through electron). Here are the relevant changes and need-to-knows:

New Directories Inside of /DiagnoseMeApp you can now find subdirectories /DiagnoseMeDesktop and /DiagnoseMeWeb. The codebase across the two is relatively equal, just with changes to the bundling with webpack.config.js.

As a result of this, you will most likely need to run npm force -install in both directories since we don't track modules on git.

New Scripts Both apps can be run with the script npm start like before. There is also a npm run build command that is scripted for the web version, but I don't believe it is required to run it. The web app is hosted on port 3000. You still need to instantiate our flask server from main.py to run the backend component.

Cors/Backend Changes Since the web app runs on port 3000, javascript will automatically restrict access to other ports, which is why the API calls to OpenAI were being made but not received into the app. The workaround is called CORS, and it tells both Flask and the web app to expect communication between ports. You will need to run pip install flask-cors as a result.

We still need to resolve the problem of making changes to files. We can discuss this Friday if you want, but I suggest we stick to updating one of the apps and we can recopy files to the other port, while keeping our backend dual functional.

Closes #88 Closes #98 im coming for your job max

NamkhangNLe commented 7 months ago

I've heard of CORS before. Great job Joseph, easy to ready and understand. lgtm!