-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove proxy and clean up config #8445
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
92a0170
Clean up proxy
bodhish f62231f
More cleanup
bodhish 5df6dda
use api url for cover image upload
sainak 5d689cd
Refactor care config to use camelCase variables and remove `useConfig…
rithviknishad e5ce50a
Merge branch 'develop' into add-api-url
rithviknishad a8d53cc
Update cypress workflow to use `REACT_CARE_API_URL` instead
rithviknishad 2fcd928
Update cypress config to use configured backend API
rithviknishad 415c16a
Merge branch 'develop' into add-api-url
rithviknishad 5958728
Cypress CI: ensure FE builds use `REACT_CARE_API_URL` env
rithviknishad b35c042
Merge branch 'develop' into add-api-url
rithviknishad 59a234d
Cypress CI: set env `CORS_ALLOWED_ORIGINS`
rithviknishad f6484c1
Cypress CI: fix incorrect port for `CORS_ALLOWED_ORIGINS`
rithviknishad f3393fb
switch to using request instead of fetch in asset import
rithviknishad cc8885d
Switch to relative imports
rithviknishad acd44b5
use fallback if json parse error for logo env's
rithviknishad 91801da
Define example for logo envs
rithviknishad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# Whitelabelling envs | ||
|
||
REACT_APP_TITLE=CARE | ||
REACT_APP_META_DESCRIPTION=Revolutionizing EMR with AI: Open Healthcare Network develops free, open-source tools to enhance efficiency in global healthcare delivery. Our EMR system is recognized as a Digital Public Good by the United Nations. | ||
REACT_APP_META_DESCRIPTION="Revolutionizing EMR with AI: Open Healthcare Network develops free, open-source tools to enhance efficiency in global healthcare delivery. Our EMR system is recognized as a Digital Public Good by the United Nations." | ||
REACT_APP_COVER_IMAGE=https://cdn.ohc.network/care_logo.svg | ||
REACT_APP_COVER_IMAGE_ALT=https://cdn.ohc.network/care_logo.svg | ||
REACT_PUBLIC_URL=https://care.ohc.network | ||
|
||
# Care API URL without the /api prefix | ||
REACT_CARE_API_URL=https://careapi.ohc.network | ||
|
||
# Dev envs | ||
ESLINT_NO_DEV_ERRORS=true | ||
|
||
CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dotenv | ||
test -f .env.local && dotenv .env.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Backend URL | ||
REACT_CARE_API_URL=https://careapi.ohc.network | ||
|
||
# Dashboard URL | ||
REACT_DASHBOARD_URL= | ||
|
||
# GitHub URL (default: https://github.com/ohcnetwork) | ||
REACT_GITHUB_URL= | ||
|
||
# OHCN URL (default: https://ohc.network?ref=care) | ||
REACT_OHCN_URL= | ||
|
||
# Plausible site domain (default: care.ohc.network) | ||
REACT_PLAUSIBLE_SITE_DOMAIN= | ||
|
||
# Plausible server URL (default: https://plausible.10bedicu.in) | ||
REACT_PLAUSIBLE_SERVER_URL= | ||
|
||
|
||
# Main logo (JSON string with light and dark properties) | ||
REACT_HEADER_LOGO= | ||
|
||
# Main logo (JSON string with light and dark properties) | ||
REACT_MAIN_LOGO= | ||
|
||
# State logo (JSON string with light and dark properties) | ||
REACT_STATE_LOGO= | ||
|
||
# Custom logo (JSON string with light and dark properties) | ||
REACT_CUSTOM_LOGO= | ||
|
||
# Custom alternative logo (JSON string with light and dark properties) | ||
REACT_CUSTOM_LOGO_ALT= | ||
|
||
# Custom description | ||
REACT_CUSTOM_DESCRIPTION= | ||
|
||
# Google Maps API key | ||
REACT_GMAPS_API_KEY= | ||
|
||
# Government data API key | ||
REACT_GOV_DATA_API_KEY= | ||
|
||
# reCAPTCHA site key | ||
REACT_RECAPTCHA_SITE_KEY= | ||
|
||
# Sentry DSN | ||
REACT_SENTRY_DSN= | ||
|
||
# Sentry environment (default: staging) | ||
REACT_SENTRY_ENVIRONMENT= | ||
|
||
# KASP settings | ||
REACT_KASP_ENABLED=true | ||
REACT_KASP_STRING=KASP | ||
REACT_KASP_FULL_STRING=Karunya Arogya Suraksha Padhathi | ||
|
||
# Sample format file paths | ||
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx | ||
REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT=/External-Results-Template.csv | ||
|
||
# Feature flags | ||
REACT_ENABLE_HCX=true | ||
REACT_ENABLE_ABDM=true | ||
REACT_ENABLE_SCRIBE=true | ||
REACT_WARTIME_SHIFTING=true | ||
|
||
# JWT token refresh interval (in milliseconds) (default: 5 minutes) | ||
REACT_JWT_TOKEN_REFRESH_INTERVAL= | ||
|
||
# Minimum encounter date (default: 2020-01-01) | ||
REACT_MIN_ENCOUNTER_DATE= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
const env = import.meta.env; | ||
|
||
interface ILogo { | ||
light: string; | ||
dark: string; | ||
} | ||
|
||
const logo = (value?: string, fallback?: ILogo) => { | ||
return value ? (JSON.parse(value) as ILogo) : fallback; | ||
rithviknishad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
const careConfig = { | ||
apiUrl: env.REACT_CARE_API_URL, | ||
|
||
urls: { | ||
dashboard: env.REACT_DASHBOARD_URL, | ||
github: env.REACT_GITHUB_URL || "https://github.com/ohcnetwork", | ||
ohcn: env.REACT_OHCN_URL || "https://ohc.network?ref=care", | ||
}, | ||
|
||
headerLogo: logo(env.REACT_HEADER_LOGO, { | ||
light: "https://cdn.ohc.network/header_logo.png", | ||
dark: "https://cdn.ohc.network/header_logo.png", | ||
}), | ||
mainLogo: logo(env.REACT_MAIN_LOGO, { | ||
light: "https://cdn.ohc.network/light-logo.svg", | ||
dark: "https://cdn.ohc.network/black-logo.svg", | ||
}), | ||
stateLogo: logo(env.REACT_STATE_LOGO), | ||
customLogo: logo(env.REACT_CUSTOM_LOGO), | ||
customLogoAlt: logo(env.REACT_CUSTOM_LOGO_ALT), | ||
customDescription: env.REACT_CUSTOM_DESCRIPTION, | ||
|
||
gmapsApiKey: | ||
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk", | ||
|
||
govDataApiKey: | ||
env.REACT_GOV_DATA_API_KEY || | ||
"579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b", | ||
reCaptchaSiteKey: | ||
env.REACT_RECAPTCHA_SITE_KEY || "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN", | ||
|
||
kasp: { | ||
enabled: env.REACT_KASP_ENABLED === "true", | ||
string: env.REACT_KASP_STRING || "KASP", | ||
fullString: | ||
env.REACT_KASP_FULL_STRING || "Karunya Arogya Suraksha Padhathi", | ||
}, | ||
|
||
sampleFormats: { | ||
assetImport: | ||
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx", | ||
externalResultImport: | ||
env.REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT || | ||
"/External-Results-Template.csv", | ||
}, | ||
|
||
wartimeShifting: env.REACT_WARTIME_SHIFTING === "true", | ||
|
||
auth: { | ||
tokenRefreshInterval: env.REACT_JWT_TOKEN_REFRESH_INTERVAL | ||
? parseInt(env.REACT_JWT_TOKEN_REFRESH_INTERVAL) | ||
: 5 * 60e3, | ||
}, | ||
|
||
minEncounterDate: new Date(env.REACT_MIN_ENCOUNTER_DATE || "2020-01-01"), | ||
|
||
// Plugins related configs... | ||
|
||
plausible: { | ||
server: env.REACT_PLAUSIBLE_SERVER_URL || "https://plausible.10bedicu.in", | ||
domain: env.REACT_PLAUSIBLE_SITE_DOMAIN || "care.ohc.network", | ||
}, | ||
rithviknishad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
sentry: { | ||
rithviknishad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dsn: | ||
env.REACT_SENTRY_DSN || | ||
"https://[email protected]/5183632", | ||
environment: env.REACT_SENTRY_ENVIRONMENT || "staging", | ||
}, | ||
|
||
hcx: { | ||
enabled: env.REACT_ENABLE_HCX === "true", | ||
}, | ||
|
||
abdm: { | ||
enabled: (env.REACT_ENABLE_ABDM ?? "true") === "true", | ||
}, | ||
|
||
scribe: { | ||
enabled: env.REACT_ENABLE_SCRIBE === "true", | ||
}, | ||
} as const; | ||
|
||
export default careConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.