Make sure you have these installed:
- Node
git clone https://github.com/henriqueinonhe/medical-dashboard
cd medical-dashboard
npm ci
Configure environment variables.
- Copy
.env-sample
contents to.env
.
Make sure port 8080 is available.
For development:
npm run dev-start
For "production-like" environment:
npm run prod-start
- Language: Typescript
- Framework: React
- CSS in JS: Styled Components
- Bundler: Webpack
- Linter: ESLint
- Tests: Jest
- UI Tests: Cypress
Clone the project:
git clone https://github.com/henriqueinonhe/medical-dashboard
There are two environment variables:
- API_BASE_URL - Self explanatory
- TEST_ENVIRONMENT - Must be set to true when running cypress tests.
As environment variables are actually replaced (textually, just like C #define
) by webpack, each time you update an environment variable value you MUST restart the server for the update to take effect.
For a development environment:
npm run dev-start
For a production-like environment:
npm run prod-start
This one is much more performant however takes much longer to compile and thus much longer to iterate, so it is mostly used for profiling purposes.
To run the linter:
npx eslint .
There are mostly UI integration tests, where the API is mocked, but aside that, everything runs pretty much "in the flesh".
To run unit tests:
npx jest
To run UI Integration tests you must first serve the web server (e.g. npm run dev-start
), set TEST_ENVIRONMENT
environment variable to true
and then you may either run them in headless mode
npx cypress run
or in a headed mode:
npx cypress open
(It's cooler to use the headed mode to see things happening for real)