Versions Compared

Key

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

This guide is to provide an onboarding to introduces the codebase to new LiteFarm contributors.

Backend

The projects backend is using 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 library. 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.

The api package

The API uses Node along with Express to run the servers backend and routing logic. You will need to be pretty familiar with Express routing before getting into any code.

To access the database and to query it we are using use Knex, which is a query builder for multiple SQL enginesimplementations; in our case we are using use PostgreSQL. Please go through Knex documentation on migrations and the api/db/migration folder so you to get a better an understanding of both the library and how the project goes about using it. The migration folder contains all the projects migrations (so far) and how the DB has evolved from day one. You should get a pretty good understanding of how it works after that. You can also check out an ERD diagram of how the DB looks right now.We are using project's migrations-- the evolving definitions of the database’s schema from day one.

We use ObjectionJS to define the models in api/src/models.

Frontend

As you might know, we are using React as our primary frontend library. 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 (in fact, bookmark the documentation, you are probably revisiting it every other day).

...

The exports “package”

Within the api folder, the file packages/api/src/jobs/index.js defines a Node service that is run separately, as if it were a third package. This service monitors Redis-based work queues to receive and process requests for exports of certification information.