UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

62 lines (43 loc) 3.01 kB
# Allocation UI ## Getting up and running `npm install` Create a file at the project root `.env` using `.env.example` as a guideline To run as a developer In console window 1 `npm run build` In console window 2 `npm run dev:build` This complexity is due to incremental typescript compilation being much faster. Build times are circa 5 seconds using incremental compilation (including webpack build) and generally > 10 seconds using webpack integrated typescript compilation. To run on a build server `npm run production:build` To run tests use `npm test` Please note: use of pop up blockers may result in failed requests to loggly and gmaps ## Code organisation The code is organised using two approaches. Firstly any code which has a presence in the UI or the redux state is organised into a Pod (also known as feature first, as opposed to file type first). Secondly, any code which could in theory exist separately from the rest of the application is organised into a library. ### Pods A pod contains code related to a single feature of the application. At present pods include Jobs, which includes all code relating to the jobs panel and job popups; Couriers, which contains all code related to the courier panel and related popups; and Mapping, which contains all code related to the maps panel. Each Pod consists of several modules all organised under a single parent folder. The standard set of modules is + actions: All action dispatchers for the pod + api: All calls to services relating to the pod + components: All React components for the pod + data: All data structures used by the pod. These are defined as interfaces + reducers: All redux reducers used by the pod. Also contains the definition of the reducer state for each pod + selectors: All selectors over the state for the pod + services: All data services defined for the pod. + specs: All specs defined for the pod The pods defined in the application at present are: + allocation: Contains the root components of the application and some shared code for the rest of the app. + auth: contains code relating to maintaining the authentication data used by the app. + avatar-icon: A component library used by several other pods. + cad-panel: Stands for Control And Dispatch panel because that is the old name of the app. Contains the controller component which contains the jobs, couriers and mapping UI components. Also defines any action dispatchers which must be aware of multiple pods, eg jobs AND couriers. + couriers: Contains all code related to the couriers panel and popups. + google: Contains components used to asynchronously load the google maps libraries and update the application state when they are loaded. + jobs: Contains all code related to the jobs panel and popups + logger: The logging library for the app. Lives in a pod because it has a reducer and associated state. + login: The login view and associated state. + mapping: All code related to the map panel. + notification: Popup 'toast' messages.