Core framework
Alpha
This framework is actively being developed. APIs and naming may change. The canonical terminology is documented in the Front-end north star architecture Notion page.
Under construction
These docs are a work in progress and may be incomplete.
The Core framework provides the building blocks for building modular, multi-country applications at Alan. It enforces dependency inversion and declarative configuration, enabling country expansion without code duplication.
Quickstart
A minimal country app (like Canada) looks like this:
import type { ComponentType } from "react";
import { customerDashboardShell, rootPath } from "@alan-eu/global-customer-dashboard/module";
import { customerAdminManagementModule } from "@alaneu/customer-admin-management";
import { api } from "@alaneu/global-api/ca";
import { GlobalApp } from "@alaneu/global-shell";
export const createApplication = (): ComponentType => {
// the customer dashboard shell is a module, built from the dashboard modules and the menu
const dashboardModule = customerDashboardShell({
modules: [myDashboardModule, customerAdminManagementModule],
menu: { main: { order: 1, items: ["employees", "admins"] } },
});
const myModules = [someAdhocModule, dashboardModule];
return () => <GlobalApp homePage={`/${rootPath}/my-page`} api={api} modules={myModules} />;
};
How it fits together
GlobalApp (modules)
│
├── Core features (auth, user, feature-flags)
│
├── Dashboard shell module (customerDashboardShell({ modules, menu }))
│ ├── Dashboard modules
│ │ ├── Screens (routed views)
│ │ ├── Menu items (declared on each module, placed by the menu)
│ │ └── Translations
│ ├── Layouts (CustomerDashboardLayout, FullPageLayout, …)
│ └── Menu (sections in rank order, items by key)
│
└── Standalone features
├── Screens (routed views)
├── Services (singletons with lifecycle)
└── Translations (i18n namespaces)
Key packages
Temporary package hierarchy
The package hierarchy is likely to change heavily in the coming weeks, this table is only informative to document the current state of affairs.
| Package | Purpose |
|---|---|
modular-arch | Defines the foundational types and tools: Module, Screen, Service, WithModules |
global-shell | Provides the GlobalApp component that orchestrates features into a running web app |
global-customer-dashboard | A product shell for the admin dashboard, with layouts and menus |
Glossary
| Term | Definition |
|---|---|
| GlobalApp | Root component orchestrating features and shells into a running app. Renders the provider stack and derives the router from the registered modules. |
| Feature | A declarative set of screens, services and translations contributed to an application. Defined using the Module type from modular-arch. |
| Shell | A module factory that groups related modules for a persona (admins, members, ops). Supplies layouts, menus, and cohesive UX. |
| Product shell | A specific shell (e.g. customerDashboardShell) providing an out-of-the-box UX for a persona. |
| Screen | A universal view abstraction exposed through an application, mapped to a route. |
| Service | A singleton managing logic and state within a feature, with lifecycle hooks. |
| Layout | A reusable view structure with named insertion points (slots). |
| Package | A folder with a package.json containing cohesive code — may provide one or more Features. |
| Configuration | Assembles product shells and domain features together. Country-specific when needed. |