A simple hello world CARE App boilerplate to get you started with CARE App development.
- Clone the repository and navigate to the project directory.
git clone
cd care_hello- Install the dependencies.
npm install- Start the development server.
npm run devMake sure you have CARE running locally. Then, follow these steps:
-
Open the CARE Admin Dashboard in your browser (usually at
http://localhost:4000/admin). -
Navigate to the "Apps" section and click on "Add New Config".
-
Add a slug, and specify the following as the Meta:
{
"url": "http://localhost:4173/assets/remoteEntry.js",
"name": "care-hello-fe"
}
-
Save the configuration and reload CARE.
-
Head over to a patient encounter page, and you should see a new "Hello!" button. Click on it to see the "Hello CARE!" page.
Tip: while developing this plugin, you can open http://localhost:4173 to view a local status page that includes these setup steps and quick links.
The manifest is located at src/manifest.tsx. You can add new routes, components, and other configurations here. The boilerplate includes a sample route for a Hello page and a navigation link to access it. Types are provided for the manifest configuration to help you with type checking and autocompletion.
Update the manifest's routes object to include new routes. For example, to add a new route for a Hello page, you can do the following:
import Hello from "./pages/Hello";
export const manifest = {
// ...
routes: {
"/hello": () => (
<Page>
<Hello />
</Page>
),
},
};You can mount custom components in the app by adding them in components in the manifest. For example, to add a new Button component, you can do the following:
export const manifest = {
// ...
components: {
PatientInfoCardQuickActions: lazy(() => import("./components/Button")),
},
};CARE will then inject the Button component into wherever the PatientInfoCardQuickActions slot is defined in CARE's UI. You can find the list of available slots here. If you want to create your own custom slot, you can do that as well.
You can add new navigation links to the sidebar, user menu, or admin sidebar by updating the manifest. For example -
export const manifest = {
// ...
userNavItems: [
{
url: "/hello";
name: "Hello";
icon?: <icon/>;
children?: NavigationLink[];
}
],
};