Used vercel:
https://thermographic-camera-git-master.malt.vercel.app/
First, install libraries (Node 12.11.0):
yarn
Then, run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
First, if the image is undefined, with no timeout error, I evaluate typeof response.headers['content-type'] === 'undefined'
in src/redux/api.ts
, then I send undefined in the image object and I can catch the error on the component.
Then, if the input return a timeout, it automatically dispatch the error action.
If there is an error, it doesn't save the record and I added a Try Again button.
All the records are stored on localStorage
(not the best solution, with more time I would use Redis or Firebase to store the values.)
The image is stored in base 64.
- Testing, testing, testing
- Improve Polling with redux
- Fix Flash of Unstyled Content
- Fix blink on every polling
- Add immutable library
- Fix some types
- Add default props
- Improve documentation
The branching model used is gitflow, this helps a lot with collaboration and scaling the development team.
deployments to production
Developtment branch.
Adding tsconfig, precommiter and material ui.
Adding the base responsive layout.
Adding all the redux functionality
Adding documentation to the code
Used eslint
,it is going to tell you if you’ve imported something and not used it, if your function could be short-handed, and loads of other little gotchas that you can fully configure.
Used prettier
, it is an opinionated code formatter, this will assure that the code styling is the same.
These are ones of the major libraries I used to accomplish this test.
Use to use SSR (server side rendering features), this can improve the SEO.
Theming
State management and midleware for side effects
Promise based HTTP client
precommit, ensure same slyting and no javascript errors before commit
linter tool to find and fix problems in javascript code.
to share the same code styling
├── README.md
├── src
│ ├── pages
│ │ ├── _app.tsx
│ │ ├── _document.tsx
│ │ └── index.tsx
│ ├── components
│ │ └── Footer
│ │ │ └── index.tsx
│ │ └── ImageViewer
│ │ │ └── index.tsx
│ │ └── Layout
│ │ │ └── index.tsx
│ │ └── NavBar
│ │ │ └── index.tsx
│ │ └── TableValues
│ │ │ └── index.tsx
│ │ └── Values
│ │ │ └── index.tsx
│ │ └── AppContext.tsx
│ │ └── MuiTheme.tsx
│ │ └── index.tsx
│ ├── redux
│ │ └── home
│ │ │ └── actions.ts
│ │ │ └── api.ts
│ │ │ └── reducers.ts
│ │ │ └── representations.ts
│ │ │ └── sagas.ts
│ │ │ └── types.ts
│ │ └── store.ts
│ │ └── rootSaga.ts
│ │ └── api.ts
│ ├── constants
│ │ └── index.ts
└── yarn.lock
├── package.json
├── .eslintrc.json
├── .prettierrc
├── jsconfig.json