Skip to content

FreeElephants/clean-core

Repository files navigation

Clear Core

Build Status

codecov

Core interfaces and classes for html applications.

Architecture

Page

Every page is html file in public directory. It includes:

  • common html elements (html, head, body)
  • mark-up (for template engine or raw html)

Advantages of this approach:

  • Client-side rendering and raw html can be used
  • Real URI for every page

Application

Application handle entry point in app (e.g. main.ts):

  • Execute global hooks
  • Check requested route for current page
  • Run Route Handler

Router

Contains map of URI -> Route Handler.

Route Handlers

Route Handler known how handle specific URI with given params. Route handling cases:

  • instantiate and execute Page Object with given Window context
  • redirection (based on URI params, Window context, etc)

Route inject all external Page Object dependencies.

Page Objects

Page Object instantiate html components (forms, widgets) and handle events.