Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
7bffe11
fix: Remove max height from login form
A-Axisa May 15, 2026
0c9ba75
Add marital and working status to patient model
A-Axisa May 15, 2026
b48148c
Return marital and working status with user information
A-Axisa May 17, 2026
d8ed708
Update marital and working status on report upload
A-Axisa May 17, 2026
1183aa5
Add marital and working status to patient model
A-Axisa May 17, 2026
2eef9f2
Update marital and working status on report form
A-Axisa May 17, 2026
3d19fe0
Add docstring to model methods
A-Axisa May 17, 2026
65c6d22
Update create_patient to check for existing records
Bralc003 May 17, 2026
8c2f1ce
Implement test for checking duplicate patient creation
Bralc003 May 17, 2026
e905b54
Fix create patient form always return success
Bralc003 May 17, 2026
8fc3312
Change status types to dictionaries
A-Axisa May 17, 2026
cc2e76b
Return marital and working status for merchant patients
A-Axisa May 17, 2026
6c1902b
Update marital and working status for merchant reports
A-Axisa May 17, 2026
2e2a6f6
Give marital and work status default values
A-Axisa May 17, 2026
c355526
test: Fix tests checking patient keys
A-Axisa May 17, 2026
80402a4
remove some text and tab in setting
wyl2003 May 17, 2026
69cad90
fix: user dashboard percentage card displaying newest
wyl2003 May 17, 2026
9f92049
fix: display last data in Patient Details page
wyl2003 May 17, 2026
f151657
Merge pull request #156 from A-Axisa/shp-215/remember-marital-and-wor…
A-Axisa May 17, 2026
1cdcd40
Add authentication to the backend API for changing user roles
wyl2003 May 17, 2026
b009aab
fix: role change frontend add include credentials
wyl2003 May 17, 2026
a092d22
Merge pull request #155 from A-Axisa/sph-229/Prevent-Duplicate-Patients
Bralc003 May 17, 2026
a1108bd
Merge pull request #160 from A-Axisa/shp-175/Add-authentication-to-ba…
wyl2003 May 18, 2026
7798f4a
Merge pull request #158 from A-Axisa/shp-226/Update-user-settings-pag…
wyl2003 May 18, 2026
6f437bc
Remove FALLBACK text from prediction text
wyl2003 May 18, 2026
9adcd64
doc: add docstring for health_prediction.py
wyl2003 May 18, 2026
6804cb7
doc: add docstring for admin.py
wyl2003 May 18, 2026
0699223
Add value property to display existing phone numbers
A-Axisa May 19, 2026
15f58d1
Add clarification to component parameters
A-Axisa May 19, 2026
71ad55f
Replace TextField for PhoneInputField component
A-Axisa May 19, 2026
45d1146
Fix information leakage issue with logging error
A-Axisa May 19, 2026
b5da5e8
Fix additional information leakage issue
A-Axisa May 19, 2026
dfd61dd
fix: Update routing to use revised route name
A-Axisa May 19, 2026
1443239
doc: update docstring for authentication.py
wyl2003 May 19, 2026
3109e91
Merge pull request #162 from A-Axisa/fix/shp-237-country-code-in-user…
A-Axisa May 19, 2026
6acf3fd
doc: update and add doc in users.py
wyl2003 May 19, 2026
12fec9c
Update database to include new lifestyle data
Bralc003 May 19, 2026
efb03f5
docs: add docstring in log and encryptor.py
wyl2003 May 19, 2026
cec6cf7
Change api to include new lifestyle data and fix tests
Bralc003 May 19, 2026
e23dd2b
doc: add docstring for main.py
wyl2003 May 19, 2026
06e2b35
Update generate report form for standard user
Bralc003 May 19, 2026
55f9f8b
feat: include report creation time next to date text
jshudbrd May 19, 2026
8683d9e
update: change relative time to display creation date
jshudbrd May 19, 2026
d49934c
Update merchant report generation form
Bralc003 May 19, 2026
224c964
fix: add filtering by selectedYear before extracting months
jshudbrd May 19, 2026
86fdcfb
update: reorder lifestyle section in ReportTemplate
jshudbrd May 19, 2026
c64e3ad
Merge pull request #161 from A-Axisa/shp-236/Remove-FALLBACK-text-fro…
wyl2003 May 19, 2026
f8baf0d
Merge pull request #159 from A-Axisa/shp-225/Fix-user-dashboard-healt…
wyl2003 May 19, 2026
5993790
Merge pull request #157 from A-Axisa/shp-219/fix-login-form-height
A-Axisa May 19, 2026
6f08e12
Merge pull request #163 from A-Axisa/fix/shp-235-detail-reports-routing
A-Axisa May 19, 2026
591e3fc
Merge pull request #166 from A-Axisa/SHP-240/Correct-ordering-for-lat…
jshudbrd May 20, 2026
1028473
Merge pull request #164 from A-Axisa/SHP-247/Display-report-time-next…
jshudbrd May 20, 2026
8bb9606
doc: docstring consistency in health_predictin.py
wyl2003 May 20, 2026
86f93ec
Add retired option
Bralc003 May 20, 2026
dede4fe
Fix tests that were using invalid working status types
Bralc003 May 20, 2026
2dad20c
doc: docstring consistency in other py
wyl2003 May 20, 2026
239a362
doc: update doc in admin.py
wyl2003 May 20, 2026
63b3b5d
Merge pull request #168 from A-Axisa/shp-234/back-end-endpoint-add-doc
wyl2003 May 21, 2026
d518749
Merge branch 'dev' into SPH-241/add-lifestyle-options
Bralc003 May 21, 2026
a3285b3
Fix indent after resolving merge conflict
Bralc003 May 21, 2026
c4c6f91
Merge pull request #165 from A-Axisa/SPH-241/add-lifestyle-options
Bralc003 May 21, 2026
a0d829a
Add JSdoc to front-end components and routes
A-Axisa May 21, 2026
d170577
Merge branch 'dev' into doc/shp-233-front-end-jsdoc
A-Axisa May 21, 2026
31c6222
Remove drawer from user report history page
Bralc003 May 23, 2026
6826e6f
Merge pull request #169 from A-Axisa/doc/shp-233-front-end-jsdoc
A-Axisa May 23, 2026
4086c47
Remove drawer from Merchant Reports page
Bralc003 May 23, 2026
0e75854
Move merchant routes into a merchant route directory
Bralc003 May 23, 2026
1fb82b7
Move standard user pages into a starndardUser route dir
Bralc003 May 23, 2026
1bb01b5
Move admin routes into a admin route directory
Bralc003 May 23, 2026
c74121c
Move publicly accessed routes to a public routes directory
Bralc003 May 23, 2026
8081219
Add comments to differentiate routes in index.js
Bralc003 May 23, 2026
64c6cfe
Move health report component files into a grouped folder
Bralc003 May 23, 2026
2a7770a
Create dialog and patientAccessRequest component folders
Bralc003 May 23, 2026
3af655e
Remove unused imports
Bralc003 May 23, 2026
c7ae5c3
Merge pull request #170 from A-Axisa/sph-239/remove-drawer
Bralc003 May 23, 2026
0df3341
feat: add chart component for PDF rendering
jshudbrd May 23, 2026
901e513
Merge pull request #167 from A-Axisa/SHP-238/Fix-month-and-year-filters
jshudbrd May 23, 2026
f3ffd4a
Merge branch 'dev' into sph-218/Retructure-fron-end-route-folders
Bralc003 May 23, 2026
6a1dd66
feat: add PDFHealthChart component to ReportHistory
jshudbrd May 23, 2026
39fa66f
update: convert PDFHealthChart DOM node to png in DownloadReportButton
jshudbrd May 23, 2026
e687363
feat: embed chartImage into PDF under session 3
jshudbrd May 23, 2026
ef369bf
feat: add chart component to MerchantReports
jshudbrd May 23, 2026
2a4d9cc
Merge branch 'dev' into SHP-216/add-trend-graph-to-report
jshudbrd May 23, 2026
e076df1
fix: remove drawer component
jshudbrd May 23, 2026
1803648
Merge pull request #171 from A-Axisa/sph-218/Retructure-fron-end-rout…
Bralc003 May 24, 2026
67ea28d
Remove unused imports from login page
Bralc003 May 24, 2026
fe434fb
Remove unused imports from all pages
Bralc003 May 24, 2026
28914a8
Change href navigation to RouterLink in HealthAnalytics.js
Bralc003 May 24, 2026
5ab1c0a
Update font and mobile layout for HealthAnalytics.js
Bralc003 May 24, 2026
29e2dab
Update user settings page UI layout
Bralc003 May 24, 2026
37bab88
Fix mobile layout for report template
Bralc003 May 24, 2026
ea8cee2
Update mobile UI on Generate Report Form
Bralc003 May 24, 2026
04eb783
Update Merchant Report form mobile UI
Bralc003 May 24, 2026
b1b5cf2
fix: remove boxShadow prop from graph
jshudbrd May 24, 2026
5d2924d
Update patient details page layout
Bralc003 May 24, 2026
efe375a
Fix mobile font size on Merchant landing
Bralc003 May 24, 2026
71cd1e6
Merge branch 'dev' into SHP-216/add-trend-graph-to-report
jshudbrd May 24, 2026
2478d74
Fix mobile font size in Patient Management
Bralc003 May 24, 2026
4c27182
fix: resolve merge conflicts with dev
jshudbrd May 24, 2026
87cd72c
Update mobile layout on UserLanding
Bralc003 May 24, 2026
d2ba52c
fix: update relative path of imports
jshudbrd May 24, 2026
610726d
Update no report screen on report history
Bralc003 May 24, 2026
f7a1560
Fix mobile button alignment
Bralc003 May 24, 2026
816d4dd
Remove unused variables and imports after modifications
Bralc003 May 24, 2026
351e541
Resolve eslint errors when running the application
Bralc003 May 24, 2026
80d28e5
update: draft update README.md
jshudbrd May 24, 2026
40376ec
fix: correct anchor ref for "Return to top text"
jshudbrd May 24, 2026
9b502c7
update: update project logo and title
jshudbrd May 24, 2026
cb3dea3
fix: add render scaling to image
jshudbrd May 24, 2026
49fee27
Fix merchant report form validation
Bralc003 May 24, 2026
bd36659
Update navbar report history route
Bralc003 May 24, 2026
9929858
Fix scan log error for PatientManagement
Bralc003 May 24, 2026
1ac657a
Merge pull request #172 from A-Axisa/SHP-216/add-trend-graph-to-report
jshudbrd May 24, 2026
a27beac
Remove permission and role permission DB tables
Bralc003 May 24, 2026
851c106
fix: return string instead of error object
jshudbrd May 24, 2026
a1eedbd
Merge pull request #173 from A-Axisa/SHP-222/Update-README.md
jshudbrd May 24, 2026
53456be
fix: resolve leakage of information in logger message conflict
jshudbrd May 24, 2026
58b6e3a
fix: resolve information exposure through an exception conflict
jshudbrd May 24, 2026
8e08924
fix: resolve usage of hard-coded secret conflict
jshudbrd May 24, 2026
868da07
fix: remove default credential values
jshudbrd May 24, 2026
b72fd8d
fix: resolve observable timing discrepancy conflict
jshudbrd May 25, 2026
921983e
chore: move xor func to util folder
jshudbrd May 25, 2026
618dcc3
fix: add bearer suppression comment to non-vulnerable code
jshudbrd May 25, 2026
29ced01
Merge pull request #175 from A-Axisa/shp-248/remove-unused-DB-tables
Bralc003 May 25, 2026
6b4ae93
Merge branch 'dev' into shp-229/mobile-layout-and-font-consistancy
Bralc003 May 25, 2026
fd41307
Fix issues after resolving merge conflict
Bralc003 May 25, 2026
cc6bbc1
Update mobile ui for PatientAcessRequest
Bralc003 May 25, 2026
d5d0d28
Update UI for accept access request form
Bralc003 May 25, 2026
c244298
Merge pull request #174 from A-Axisa/shp-229/mobile-layout-and-font-c…
Bralc003 May 25, 2026
3a75ef1
fix: replace length and null check with false check
jshudbrd May 25, 2026
deb8a7b
Merge branch 'dev' into SHP-183/resolve-github-security-conflicts
jshudbrd May 25, 2026
ed09017
Merge pull request #176 from A-Axisa/SHP-183/resolve-github-security-…
jshudbrd May 25, 2026
d2c0d42
Fix errors after merging security SPH-183
Bralc003 May 25, 2026
4906871
Fix user test not return race
Bralc003 May 25, 2026
4c27d8c
Merge pull request #177 from A-Axisa/fix/dev-not-running-after-merge
Bralc003 May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 129 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,135 @@
# Smart-Health-Predictive

## Getting Started
### Prerequisites
- Node.js v22.x or higher
- npm
- FastApi (Python)
- Docker Desktop

### Running the Web Application
1. Open a terminal and navigate to the project directory.
2. Run the server.
```node server\src\server.js```
3. Open a second terminal and navigate to the client folder in the project directory.
4. Install packages with npm and run the client.
```npm install```
```npm start```

## Installing Required Modules

<a href="https://wellai.app/">
<img src="client/src/assets/WellAiLogoTR.png" alt="WellAI logo" title="Well AI" height="60" align="right" >
</a>


# WellAI - Smart Health Predictive

Smart Health Predictive empowers individuals to take control of their well-being through data-driven insights. Using AI-powered health analytics, WellAI helps you understand potential health risks early and make informed lifestyle choices for a better, healthier future.


## Prerequisites
- Node.js v22+
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)


## How to Build

1. To build the project:
```shell
# Navigate to https://github.com/A-Axisa/Smart-Health-Predictive

# Ensure Git is installed
# Open a terminal (Command Prompt or PowerShell for Windows, Terminal for macOS or Linux)

# Clone the repository
git clone https://github.com/A-Axisa/Smart-Health-Predictive.git

# Navigate to the project directory and run the services
docker compose up -d
```


## Services
- Frontend: http://localhost:3000/
- Backend: http://localhost:8000/
- API Docs: http://localhost:8000/docs


## Installing Dependencies (Manual)

> [!NOTE]
> The docker-compose file already runs these commands automatically.

### Client
1. Navigate to ```root/client``` and run:
```bash
npm install
```

### Server
1. Open command prompt in the server directory of the project.
2. Install the modules listed in the requirements.txt.
```pip3 install -r requirements.txt```

## FastApi Setup
### Initial Setup
1. Open Command Prompt
2. Run pip install ```"fastapi[standard]"```

### Run FastApi
1. Navigate to FastApi directory
```cd server```
2. (Optional) Configure extra CORS origins via environment variable (comma-separated).
```CORS_ORIGINS="https://example.com,https://another.example.com"```
3. Run the server
```fastapi dev main.py```
4. Go to http://127.0.0.1:8000/docs to interact with API

## Database Setup (Docker Compose + Alembic)
### Initial Setup
1. Have Docker running in the background.
2. Navigate to the root directory.
3. Create the container with:
```docker compose up -d```
4. To update your database to the latest version, run the following command:
```alembic upgrade head```

*ADDITIONAL NOTES*:
Run the following command to downgrade the database:
**Warning: This command will drop *ALL* existing tables and their associated data**
```alembic downgrade base```
1. Navigate to ```root/server``` and run:
```bash
pip3 install -r requirements.txt
```

### Adding a Migration
**Auto-generated migrations**
1. Navigate to ```/server/models/dbmodels.py``` and modify/create tables as necessary.
2. Navigate to the server directory.
3. Run the following command to ensure you are on the current version:
```alembic upgrade head```
4. Run the following command to create the migration:
```alembic revision --autogenerate -m "Description of migration"```

**Manual migrations**
1. Navigate to the server directory.
2. Run the following command to add a new version:
```alembic revision -m "Description of migration"```
3. Navigate to ```/server/alembic/versions/nameOfNewVersion.py``` and locate the created version file.
4. Refer to *https://alembic.sqlalchemy.org/en/latest/ops.html* for detail on creating/dropping tables.


## Generating Dummy Data ##
The script will generate random data directly into the database.

## Generating Dummy Data

The script will generate random data directly into the database.
The amount of data generated can be modified at the head of the script.
1. Open a terminal and navigate to the root directory of the project.
2. Run the following command to generate data:
```python -m server.tools.generate_dummy_data```

## Running Playwright
1. Navigate to the project directory:
```bash
python -m server.tools.generate_dummy_data
```


## Using Alembic

To update your database to the latest migration run:
```bash
alembic upgrade head
```

To remove all tables and data run:
```bash
alembic downgrade base
```


### Adding a Migration

1. Navigate to ```root/server/models/dbmodels.py``` and modify/ create tables as necessary.
2. Navigate to ```root/server``` and run:
```bash
alembic upgrade head
alembic revision --autogenerate -m "Your migration description."

# This will auto-generate a version in /root/server/alembic/versions/
```

Refer to the [Alembic Docs](https://alembic.sqlalchemy.org/en/latest/ops.html) for more detail.


## Testing

To run all integration tests, navigate to ```root/server```:
```bash
# Run the tests
pytest
```

### End-to-end Testing
1. If not already installed, run the command:
```npx playwright install```
2. Open a terminal and navigate to the Client directory.
3. run the command:
```npx playwright test```
4. Tests will now begin running and the terminal will log the status of completed tests.
Proceeding this it will open a window in your browser with a more detailed overview. This can also
```bash
npx playwright install
```
2. Navigate to the ```root/client```:
```bash
npx playwright test
```
Tests will now begin running and the terminal will log the status of completed tests.
Following this it will open a window in your browser with a more detailed overview. This can also
be accessed directly on http://localhost:9323/.

### Load Testing
1. If not already install k6 on your machine
2. Navigate to the project directory:
```bash
# There are currently a number of test types you can run:
# - average
# - breakpoint
# - smoke
# - soak
# - spike
# - stress

# To ensure that k6 is operational, run:

k6 run load-tests/tests/smoke.js
```


[Return to top](#wellai---smart-health-predictive)
Loading
Loading