Docs
Getting started
Install and run OSAGI Console, a Next.js 16 admin template: requirements, local run, demo sign-in, project structure, everyday commands and deployment.
OSAGI Console is a Next.js 16 template for an AI-native operations console. Every screen runs on an in-memory mock API, so the console works out of the box.
Requirements
- Node.js 22 LTS.
- pnpm 10. The exact version is pinned in the
packageManagerfield ofpackage.json;corepack enableinstalls it.
No database and no environment variables are needed to run the template.
Run locally
pnpm installpnpm dev # http://localhost:3000Production build:
pnpm buildOSAGI_DEMO_AUTH=on pnpm start # on your own machine: a production server keeps the demo sign-in off without itSign in
Open /login, enter any email and password, then any six digits as the two-factor code. You are signed in as Demo Admin (demo@example.com), an owner with every permission and every section. The console opens on its home page, /overview.
The public landing page lives at /. Its Live demo button opens /demo, which signs the visitor in as the same demo user, shows a "Demo data" banner and opens the console.
Tip
/demo?next=/sla and GET /api/auth/demo?next=/sla sign in at once and open the given console page, which is handy for screenshots and end-to-end runs.
The demo data (people, companies, numbers, texts) is invented and lives in memory: a server restart brings the seed data back.
Project structure
| Path | What lives there |
|---|---|
app/(auth)/ | Sign-in and two-factor screens |
app/(marketing)/ | The public landing page; its texts are in content/landing.ts, the kits in content/kits.ts and every price in lib/config/pricing.ts |
app/(console)/ | Console screens, one folder per module |
app/api/ | Route handlers: the mock API |
app/root-document.tsx, app/fonts.ts | The <html> document and the fonts shared by the root layouts |
components/ | UI by module, plus ui/ (shadcn), core/, charts/ and patterns/ |
config/nav.ts | Navigation |
lib/ | View models, formatting, schemas, auth and the mock layer (lib/mock) |
styles/theme.css | Design tokens |
scripts/ | Contrast and licence checks, theme and landing screenshots |
tests/ | unit/, ui/ (component tests) and e2e/ (Playwright) |
deploy/Dockerfile | Container image of the production server |
Everyday commands
| Command | What it does |
|---|---|
pnpm dev | Development server |
pnpm typecheck | TypeScript |
pnpm check / pnpm fix | Lint and format (Biome through Ultracite) |
pnpm test | Unit and component tests (Vitest) |
pnpm test:e2e | Playwright smoke tests against a production build |
pnpm check:contrast | WCAG contrast of the theme tokens |
pnpm check:licenses | Licences of the production dependencies |
Deploy
next.config.ts sets output: "standalone", so pnpm build also writes a self-contained server to .next/standalone; pnpm start keeps working as before. deploy/Dockerfile packs that server into an image: Node.js 22 on Alpine, a non-root user, port 3000.
docker build -f deploy/Dockerfile -t osagi-console .docker run --rm -p 127.0.0.1:3000:3000 osagi-consoleNEXT_PUBLIC_*values are inlined bynext build, so pass them as build arguments (--build-arg); setting them on a running container changes nothing. All of them are optional:NEXT_PUBLIC_CHECKOUT_PERSONAL_URLandNEXT_PUBLIC_CHECKOUT_TEAM_URLare the checkout links of the landing page,NEXT_PUBLIC_CHECKOUT_<KIT>_URLthose of its kits,NEXT_PUBLIC_CHECKOUT_BACKEND_URLandNEXT_PUBLIC_CHECKOUT_FULL_SUITE_URLthose of Backend Starter and Full Suite (a Full Suite link counts only together with Backend Starter's),NEXT_PUBLIC_LAUNCH_CODEandNEXT_PUBLIC_LAUNCH_UNTILits launch offer,NEXT_PUBLIC_SUPPORT_EMAILits support address,NEXT_PUBLIC_SITE_URLmakes Open Graph image URLs absolute andNEXT_PUBLIC_BUILD_IDlabels the build in the console footer. An empty or malformed link value hides the link.- The image checks itself through
/api/health/live, which answers without touching the data. - The demo sign-in stays off in production. With it on anyone can open
/demoand become the demo owner, so a production server, the image included, keeps it off unlessOSAGI_DEMO_AUTH=on: the public preview and the end-to-end tests set that on purpose (add-e OSAGI_DEMO_AUTH=onto try the image as a demo). Off, the demo cookie opens nothing, and/demoand/api/auth/demoanswer 404; a value that is neither on nor off turns it off too. Then connect your sign-in, see Connecting your API. - The mock API keeps what visitors create in process memory, in a sandbox of each visitor's own: nobody sees another visitor's data, and a sandbox goes back to the seed after 60 minutes without activity or 6 hours in all (at most 200 sandboxes within about 160 MiB).
OSAGI_DEMO_SANDBOX=offkeeps one store for every visitor instead. A public demo should still restart on a schedule, for example nightly, for a clean process.
Next steps
- Connecting your API: replace the mock data with your back-end.
- Permissions: groups, rights and sections.
- Theming: rebrand the console with tokens.