/image-viewer

A quick little web application to anonymously view and share images. Not for production use.

Primary LanguageJavaScript

Image Viewer

Build Status

A quick little web application to anonymously view and share images. Not for production use.

Installation

Clone the repo, before starting the development server:

yarn
yarn start

Technologies

  • JavaScript (ES2015+)
  • React.js + Redux.js
  • CSS Modules + PostCSS
  • ESLint + Airbnb config
  • Jest + Enzyme

Testing & linting

Testing and linting are run before any git commits, otherwise to run manually:

yarn test
yarn run lint

Assumptions

Several assumptions have been made:

  1. Due to being image heavy, server side rendering will introduce development complexity that provides little additional value.
  2. Task is primarily frontend due to described role.
  3. Consistency is preferred over minor performance gains - prefer stateful components over pure functions.
  4. Browser compatibility - modern browsers are only required.
  5. We don't want to test React internals itself. Linting, flow types, can provide more value (at times) in terms of governing the codebase (for the frontend). There is significant value in unit testing the backend however.

Recommendations

Due to time constraints, there are several recommendations to extend the project further.

  1. Using browser route / history for routing, rather than hash router. This was consciously used to enable the application for project pages on Github.
  2. Using a server to handle uploads, server side validation, authorisation, etc.
  3. Storing records in a database, rather than on the client side. Generate appropriate server side IDs instead of client side. For scaleability, the front-end should not hit the database directly, however through a cache layer such as Redis, populated by a push technology (eg. Kafka). This also gives us the flexibility of using GraphQL subscriptions to subscribe to potential changes.
  4. Authorisation of the upload functionality to enable audit history.
  5. If there is consideration to perform uploads of images, they should be:
    • Compressed
    • Uploaded to an S3 Bucket
    • Served via Cloudfront, cached and gzipped
  6. Include E2E tests / snapshot tests, in addition to component unit testing.
  7. Further governance by including Flow (at the cost of readability).