feat: demo account banner for demo installs (TR_DEMO)
Merged
EV
15d ago+348+348+012345678901234567890123456789-2-2-0123456789
What
demo.gauzy.co shows a strip above the app:
You are using a demo account. Finding our software useful? Click here to Sign Up and start using for free!
demo.traduora.co showed nothing. Traduora has no hosted sign-up, so the link reads "Click here to get Traduora and start using it for free!" and goes to the homepage (environment.homepage, https://traduora.co).
How it's switched on (only on demo)
- api: new
TR_DEMO(defaultfalse). When it'strue, theindex.htmlthe API serves carries<meta name="traduora-demo" content="true">and is sent withCache-Control: no-cache. When it's off,index.htmlis sent withsendFileexactly as before. If the file can't be read, it falls back tosendFile. - webapp:
app-demo-bannerabove the app bar (signed-in pages, like the Gauzy and Teams strips), shown only when that tag is on the page. - docs:
TR_DEMOrow indocs/configuration.md.
There's no new endpoint and no extra request. The Swagger contract is unchanged (the index route is @ApiExcludeEndpoint). The demo install gets TR_DEMO=true in a separate k8s-gitops change (apps/ever-traduora-demo).
Tests
api/src/controllers/index.controller.spec.ts: off by default; untouchedsendFilewhen off; tag added (and no-cache set) when on; falls back when index.html is missing; keeps<head>attributes and leaves<header>alone. Passes locally withconfig.spec.ts(9/9). tslint is clean on the changed files.webapp/.../demo-banner.component.spec.ts(Karma): renders nothing without the tag; shows the text and the homepage link with it. I couldn't run it locally because the borrowed deps lackkarma-jasmine, so this PR's CI webapp job is its first run.tsc -p webapp/tsconfig.json: no errors outsidenode_modules.
š¤ Generated with Claude Code
Summary by cubic
Adds a "You are using a demo account" banner to demo installs (TR_DEMO=true). Non-demo installs serve and render exactly as before.
- When
TR_DEMOis on, the API injects a<meta name="traduora-demo">tag intoindex.htmlwithCache-Control: no-cache; a directGET/HEADfor/index.html, including percent-encoded forms, redirects to/so the tagged page is served. - The web app shows the banner above the app bar only when that tag is present, linking to the Traduora homepage (
environment.homepage). - Documents
TR_DEMOindocs/configuration.md.