Skip to content

Example Application

Kyriakos Chatzidimitriou edited this page Oct 4, 2018 · 2 revisions

The example application can be found in the code part of this GitHub repository. It serves as a starting kit for future projects. In general an example app, a tailored application template or a starter kit is necessary because many people learn by example.

The technologies and libraries used can be found in the README.md file.

For now a mock API is used based on the package json-server. Why a mock API? Because in big teams the front-end development team:

  • can start development before the API exists.
  • can have independence from the API team (even though it must be in sync)
  • can start ultra fast
  • can test more quickly
  • can test as if the API existed

If you are a solo developer then perhaps the mock API doesn't make too much sense, except perhaps that it aids testing in the front-end. Also, json-server comes with CORS out of the box, so you can play straight ahead, running react in a different port.

Guidelines for structuring the files and folders:

  • JS belongs in a .js file
  • Configuration Object Pattern: Avoid generating JavaScript logic, but rather dynamically generate JSON the JavaScript can use.
  • Consider organising by feature instead of by file type.
  • Extract logic to POJO, Plain Old JavaScript Objects