|
| 1 | +# Vim Canvas Base App Template |
| 2 | + |
| 3 | +  |
| 4 | +  |
| 5 | + |
| 6 | + |
| 7 | +<img src='https://static.getvim.com/img/vim-canvas-landing.png?v=2' width='100%' > |
| 8 | + |
| 9 | +## Quick Links |
| 10 | + |
| 11 | +* [Vim Canvas™️ Developer Platform](https://getvim.com/vim-canvas-developer-platform/) |
| 12 | +* [Vim Canvas™️ Docs](https://docs.getvim.com/) |
| 13 | +* [VimOS.js Canvas™️ SDK](https://www.npmjs.com/package/vim-os-js-browser) |
| 14 | + |
| 15 | +## What is Vim Canvas™️? |
| 16 | +Vim is the middleware platform for healthcare. Vim Canvas™️ is a self-service platform that empowers application developers to embed their application into Electronic Health Record (EHR) workflows, resulting in a streamlined and low-friction experience for end users. With Vim, you can deploy your applications on top of Vim Connect - Vim's in-EHR connectivity layer - accelerating time to market at reduced cost and improved flexibility. |
| 17 | + |
| 18 | +# Repo Overview 😎 |
| 19 | + |
| 20 | +This repo contains example template for building applications on top of Vim Canvas™️. |
| 21 | +The applications in different frameworks demonstrates how to use the VimOS.js Canvas™️ SDK to interact with the Vim Canvas™️ platform. The app showcases the following features: |
| 22 | + |
| 23 | +* Authentication with Vim Canvas™️ |
| 24 | +* Embedding an application into the Vim Canvas™️ platform |
| 25 | + |
| 26 | +## Vim Base Template App (React) |
| 27 | + |
| 28 | +Under the `vim--base-app--template` we have a project that uses cloudflare pages to host the Vim Base Template App built with React & also the serverless service needed for the authentication flow. |
| 29 | + |
| 30 | +The app is built with `vite` and `react`. |
| 31 | + |
| 32 | +### Folder Structure |
| 33 | + |
| 34 | +* `functions` - Contains [cloudflare pages functions](https://developers.cloudflare.com/pages/functions/) for the authentication flow. |
| 35 | +* `src/components/ui` - Contains UI components generated with [Shadcn](https://ui.shadcn.com/). |
| 36 | +* `src/hooks` - Contains custom hooks for the application, including hooks that wrap the VimOS.js Canvas™️ SDK - [following the docs examples](https://docs.getvim.com/vim-os-js/reactjs.html#react-integration-guide-for-vimos.js). |
| 37 | + |
| 38 | +### Running the example code |
| 39 | + |
| 40 | +#### Prerequisites |
| 41 | +In order to see the demo code in action, you must first configure an application in the [Vim Canvas™️ Developer Platform](https://console.getvim.com/organization-admin/). |
| 42 | + |
| 43 | +If you don’t have a Vim Canvas™️ developer account yet, register [here](https://getvim.com/vim-canvas-developer-platform/) to gain access. |
| 44 | + |
| 45 | +> ❕ **You don't need a cloudflare user / account** to run the app locally. |
| 46 | +
|
| 47 | +#### Installation |
| 48 | + |
| 49 | +To install and run the app locally, follow these steps: |
| 50 | + |
| 51 | +1. Clone the repository: |
| 52 | + |
| 53 | +```bash |
| 54 | +git clone https://github.com/getvim/vim-canvas-demo-app.git |
| 55 | +``` |
| 56 | + |
| 57 | +2. Navigate to the project directory: |
| 58 | + |
| 59 | +```bash |
| 60 | +cd vim-canvas-demo-app-react |
| 61 | +``` |
| 62 | + |
| 63 | +3. Install the dependencies: |
| 64 | + |
| 65 | +```bash |
| 66 | +npm install |
| 67 | +``` |
| 68 | + |
| 69 | +4. Create a `.dev.vars` file with the following content: |
| 70 | + |
| 71 | +```.env |
| 72 | +CLIENT_ID=<<YOU ACCOUNT CLIENT ID>> |
| 73 | +CLIENT_SECRET=<<YOUR ACCOUNT CLIENT SECRET>> |
| 74 | +REDIRECT_URL=http://localhost:8788 |
| 75 | +``` |
| 76 | + |
| 77 | +5. Start the development server: |
| 78 | + |
| 79 | +```bash |
| 80 | +npm run dev |
| 81 | +``` |
| 82 | + |
| 83 | +> This will start both the backend at `http://localhost:8788` and the frontend at `http://localhost:3000`. <br> |
| 84 | +The backend will proxy the frontend - **making both API & frontend available at `http://localhost:8788`**. |
| 85 | + |
| 86 | +6. Follow up on [Testing Your Application](https://docs.getvim.com/platform/testing.html#testing-your-application) in the official docs |
| 87 | + |
| 88 | +### Authentication Flow |
| 89 | + |
| 90 | +The `functions` folder is a cloudflare pages function that handles the authentication flow for the app. |
| 91 | + |
| 92 | +When running locally the api server starts at `http://localhost:8788` & exposes the following endpoints: |
| 93 | +* `/api/launch` - This endpoint is used to initiate the authentication flow. |
| 94 | +* `/api/token` - This endpoint is used to handle the callback from the Vim Canvas™️ platform to create a token. |
| 95 | + |
| 96 | +## Settings Application Demo |
| 97 | + |
| 98 | +On top of using VimOS.js to integrate your application's iframe within Vim Connect and display it in the Vim Hub on EHRs, you can also inject an additional optional iframe into the Vim Console. This allows you to create a dedicated Settings Application where organization administrators can customize and configure your main application. |
| 99 | + |
| 100 | +This settings application is implemented under `/settings` route. |
| 101 | + |
| 102 | +[For further information](https://docs.getvim.com/platform/platform.html#app-settings) |
| 103 | + |
| 104 | +# Vim Canvas™️ Pricing |
| 105 | + |
| 106 | +| Starter Access | Patient-Based | User-Based | |
| 107 | +| --- | --- | --- | |
| 108 | +| **Design and test your application before choosing a plan.** | **Active Member Pricing (AMP) Billed Based on Per Member Per Month (PMPM)** | **Per User Per Month (PUPM)** | |
| 109 | +| *Who is this right for?* | *Who is this right for?* | *Who is this right for?* | |
| 110 | +| - Access to developer platform<br>- Ability to build application using Vim workflows<br>- Design and testing only. Activation and distribution of application requires a package | - Patient-based pricing model in use or applicable to workflow<br>- Application is enabled based on patient in context in the EHR<br>- Allows for unlimited clinic-level users | - User-based pricing model in use or applicable to application<br>- Application is always available and is not specific to patients<br>- Based on number of users/year for which the application is enabled | |
| 111 | +| | Example:<br>A mental health referral solution | Example:<br>An efficiency solution such as a medical documentation tool | |
| 112 | + |
| 113 | +# Contributing |
| 114 | +* How can I submit an improvement? |
| 115 | + * Improvements are always welcomed! 🥳 Open a PR with a proper description and we'll review it as soon as possible |
| 116 | +* Spot a bug 🕷 ? |
| 117 | + * We welcome code changes that improve the apps or fix a problem. Please make sure to follow all best practices and open an "Issue" and we'll review it as soon as possible. |
0 commit comments