https://github.com/palerdot/dhis2-dashboard-app
dhis2 dashboard app
https://github.com/palerdot/dhis2-dashboard-app
Last synced: about 1 year ago
JSON representation
dhis2 dashboard app
- Host: GitHub
- URL: https://github.com/palerdot/dhis2-dashboard-app
- Owner: palerdot
- Created: 2023-11-04T07:43:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-05T03:18:04.000Z (over 2 years ago)
- Last Synced: 2025-02-11T14:51:29.213Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://dhis2dash.initdot.in/
- Size: 83 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DHIS2 dashboard app
[Deployed Version](https://dhis2dash.initdot.in/)
The dashboard app is bootstrapped with `vite` `react-ts` template.
Stack
- React + Typescript
- Tailwind for styling
- dhis2 UI library for ui components
- vitest + @testing-library/react + msw for testing
### Installation
```shell
pnpm install
# run the local server
pnpm run dev
```
### Code
Some pointers on the code
- Dashboard data is loaded only once when the user **first** opens the dashboard. This makes sure dashboards that are not open does not fetch data from the api. Subsequent open/close actions on dashboard does not repeatedly call the apis.
- star data is locally persisted on local storage
- When filters are applied items are hidden instead of removing from dom to prevent rerenders when filters change.
### Testing
Tests are present in `tests` folder and tested with `vitest + @testing-library/react + msw for testing`.
`App.test.tsx` file tests the following
- App is loaded fine and dashboard api data is loaded and all 5 dashboards are shown
- Only one dashboard content is shown
- Visible dashboard lists all the items with the default `All` filter
- When filter is changed to `visualization`, only visualization items are visible, and map/text items are not shown.
`index.test.ts` has tests for local storage interfaces.