Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The LiteFarm monorepo defines two packages: webapp and api. As we will see, there is a kind of a third package, embedded within the api folder, that provides a certification export service, variously known as "exports", "scheduler", or "job scheduler".

The webapp package

We use React as our primary frontend libraryThis is the React-based frontend application. If you haven't seen React before we strongly recommend you go through the React Documentation and the tutorial. They are both extremely helpful getting started sources.

We use Redux for state management. If you haven't heard about Redux before, we strongly recommend you study the materials on their site. Or if you are more of a visual learner, Redux creator Dan Abramov has a free tutorial.

Conceptually, we divide the frontend into three categories.

“Pure” components are found in packages/webapp/src/components. These simple React components hold no logic and simply control the layout and rendering of their props.

“Container” components, sometimes called “smart” components, are found in packages/webapp/src/containers. These complex React components hold logic, connect to the Redux store, dispatch actions, and render the pure components with the required props. Within the container folders we will also define sagas, actions and reducers in case there are any of those that relate to that particular component logic.

Finally we have stories, which are tests of our containers that are rendered through Storybook. A story can import both pure and container components. In the case of testing isolated views, the most likely scenario is importing pure components. When rendering complete flows, however, you might use container components to test user interactions with the store or to test changes on events.

To do that, create a new folder and corresponding file that ends in ".stories.js" in the stories folder, and import the pure component in that file.

The api package

The API uses Node along with Express. Under packages/api/src there are folders for routes, middleware, controllers, and models.

...