Development - GandalfClub/gandalf-app GitHub Wiki
libs
What is Each lib is basically angular module which can contain enything including store or just set of services which goal is to deliver single functionality.
For example each page of application in also lib
, but also it can be a common-components
which needs to be shared between multiple modules, or just some big chunks of functionality like /libs/auth
which handling login/register business logic.
Working with store
Rules
- Each lib should have it's own store module (only if needed of course)
- Folder structure for store module looks like this
./store ./store/store.module.ts - simple angular module which just inits
StoreModule.forFeature
andEffectsModule.forFeature
./store/feature ./store/feature/feature.actions.ts ./store/feature/feature.effects.ts ./store/feature/feature.facade.ts ./store/feature/feature.reducer.ts ./store/feature/feature.selectors.ts ./store/feature/feature.actions.ts
Events
Event class name must represent action.
- For
load data
cases common approach is usingLoadEvents => LoadEventsSuccess => LoadEventsFail
. - For storing any downloadable entity please use
EntityWrapper<T>
interface.
Feature Key variable naming
- Feature Key variable for feature store must represent lib name ex
./libs/event-description/
=>eventDescriptionFeatureKey
Proxy configuration.
Gandalf uses two ways of proxying to a backend server: “proxy.conf.json” and “http-proxy-middleware’.
- proxy.conf.json - used only for ‘ng serve’ option. This proxy configuration ignored when you run ‘node server.js’ or deploy on Heroku.
- http-proxy-middleware - used by express server. You should register your proxying scheme in server.js before deploying.