English | 简体中文
Welcome.
This is a demo that uses React
, Material UI
, styled-components
, react-hook-form
and fetch-mock
, according to the provided API, to implement a clinician to log in and view patient details project.
To run this project, install it locally using npm
:
cd ./clinical-portal-demo-react-ts
npm i
npm run start
Then you can visit http://localhost:8080/
.
- The main Javascript framework is React 18.2 version.
- Use Material UI 5.11.7 for UI library.
- Use react-hook-form 7.43.1 for form management.
- Use styled-components 5.3.6 for style management.
- Use fetch-mock 9.11.0 for mock responses to API requests.
- Use Webpack 5.75.0 for code and resource packaging.
- It follows the type checking and syntax specifications of Typescript and ESLint.
- All projects are in the
/src
directory. /src/index.tsx
is an entry file./src/App.tsx
judgessessionToken
and chooses to loadLogin
component orDashboard
component.- The
/src/utils/
directory puts the public section.interface.ts
defines the types used by all components. - Under the
/src/components/
directory are theLogin
andDashboard
components in the page. Among them,Dashboard
also contains three subcomponentsClinicianDetail
,PatientDetail
andPatient
. - The
Login
component is used for the login screen. - The
Dashboard
component is used for the dashboard interface seen by clinicians after login. - The
ClinicianDetail
component is used to display clinician details. - The
PatientDetail
component and thePatient
component are used to display patient details. - Send a request to the mock API through the specified method and URL. Render the page with the returned data as requested.
- Login validation check is set.
- Cumulative time spent: about
29
hours.