@ftisindia/create-frontend
v0.4.3
Published
Scaffold an Angular frontend wired to the FTIS backend starter.
Readme
@ftisindia/create-frontend
ftis-front scaffolds an Angular 22 app — zoneless, OnPush, Vitest, §33
lint gates — with the FTIS SDK vendored at src/app/ftis-sdk/ (zero
FTIS runtime dependencies; the runtime + typed contract layer are generated
code, per backend, via @ftisindia/sdk, which the app pins as an exact
devDependency).
npx @ftisindia/create-frontend my-app --api-url http://localhost:3000Requires Node.js ^22.22.3 || ^24.15.0 || >=26.0.0 — the range the
scaffolded app's Angular 22 CLI accepts. ftis-front refuses any other
version up front instead of letting the first npm run dev fail.
Options:
--api-url <url>: backend API origin used by the dev proxy, production environment, and the app'ssdk:regenerate/sdk:checkscripts.--sdk <path>: vendor an existing generated Angular SDK (a backend repo'ssdk/angular/<name>-sdkfolder) instead of the baked canonical one.--backend <dir|url>: generate the SDK from YOUR backend during scaffold (runsnpx @ftisindia/sdk@<pinned> generate --target angular).--framework angular: Angular is supported in v1.--no-install: copy only.--no-git: skip git initialization.
The default scaffold carries a canonical SDK generated from the standard
FTIS template contract, so it builds immediately; re-point it at your
backend any time with npm run sdk:regenerate (drift guard:
npm run sdk:check, strict like the generator). Both scripts run the
@ftisindia/sdk devDependency the scaffold pins exactly to the generator
version stamped into the vendored SDK (ftis.generator in
src/app/ftis-sdk/package.json: this package's baked version, or the
--sdk folder's own stamp), so the drift guard stays byte-stable until you
bump the pin. Plug-and-play backend
modules (mailer, realtime, push, messaging, notifications, …) are not in
the canonical SDK — it covers the base template contract only — so run
npm run sdk:regenerate after installing one on the backend to get its
typed services and permission keys. Scaffold features: login + Google OAuth exchange,
organisation switching with a create-organisation empty state, a
settings.read gated route, and npm run gen:module -- <module> which
composes the SDK's facade + permission-guarded route skeleton into a
user-owned feature folder.
Private routes carry hasSessionGuard() (anonymous visits go to /login)
ahead of hasPermissionGuard(...); keep that order on routes you add.
For Google login, set the backend's AUTH_GOOGLE_SUCCESS_REDIRECT_URL to
the scaffolded app's login route (for example http://localhost:4200/login);
the backend default points at its own origin and the one-time ?code= never
reaches the frontend.
