SKILL.md
Vendix Frontend Routing
Purpose
Use this skill for Angular web routing in apps/frontend. It replaces the old separate lazy-routing skill; all route targets should be lazy-loaded unless there is a verified reason not to.
Current Routing Reality
apps/frontend/src/app/app.routes.tsexports an empty route array.- Runtime route setup is handled dynamically by app/domain configuration.
- Public route files live in
apps/frontend/src/app/routes/public. - Private route files live in
apps/frontend/src/app/routes/private. - Many feature areas also expose
*.routes.tsfiles underprivate/modules/**.
Key route files:
routes/private/super_admin.routes.tsroutes/private/org_admin.routes.tsroutes/private/store_admin.routes.tsroutes/private/ecommerce.routes.tsroutes/public/store_ecommerce.public.routes.tsroutes/public/vendix_landing.public.routes.tsroutes/public/org_landing.public.routes.tsroutes/public/store_landing.public.routes.ts
Core Rules
- Use
loadComponentfor standalone components. - Use
loadChildrenfor route groups exported from*.routes.ts. - Do not statically import routed page components into route files.
- Verify the actual parent route file is active before adding a child route.
- Public ecommerce/landing routes should not require staff/admin auth unless the page explicitly needs it.
- Private admin route roots use
AuthGuard; backend still owns real authorization. - Use route
datafor presentation metadata or default filters, not security decisions.
Patterns
{
path: 'products',
loadComponent: () =>
import('../../private/modules/store/products/products.component').then(
(c) => c.ProductsComponent,
),
}
{
path: 'accounting',
loadChildren: () =>
import('../../private/modules/store/accounting/accounting.routes').then(
(m) => m.accountingRoutes,
),
}
Adding A Route
- Identify the active route tree: public, private app shell, or feature child routes.
- Add a lazy
loadComponentorloadChildrenroute. - Add guards only at the correct boundary.
- Add sidebar/menu metadata separately through layout/menu files and
vendix-panel-uiif this is an admin module. - Verify the path does not conflict with existing public aliases such as localized ecommerce routes.
Related Skills
vendix-app-architecture- AppType/domain routing conceptsvendix-panel-ui- Sidebar visibility for private modulesvendix-zoneless-signals- Component runtime rulesvendix-frontend-module- Module file structure