Initial portal commit: landing + 9 AI-powered apps

Apps:
- dwg-rooms: extract room numbers from DWG/DXF
- dwg-counting: count symbols in PDF drawings (OpenCV template matching)
- contract-check: review PDF contracts against a checklist (Claude vision + Tesseract OCR fallback)
- email-drafter: bullet notes → polished Czech/English business emails
- invoice-extractor: PDF/image invoice → structured data → Excel
- translator: Czech-first translator across 19 languages with tone control
- vv-check: find inconsistent unit prices across VV sheets in one workbook
- vv-compare: diff original vs new VV files (changes / added / removed)
- feature-request: portal users submit ideas + sample files

Infrastructure:
- LiteLLM gateway with per-app virtual keys + budgets
- Langfuse observability
- Geist font, shared theme, cross-subdomain back link + theme sync via cookie/URL
- Caddy reverse proxy on *.klas.chat
This commit is contained in:
Ondřej Glaser
2026-05-13 15:25:04 +02:00
commit 48cef99257
139 changed files with 20171 additions and 0 deletions

8
landing/.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
node_modules
.next
.git
.env
.env.local
Dockerfile
.dockerignore
README.md

41
landing/.gitignore vendored Normal file
View File

@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

5
landing/AGENTS.md Normal file
View File

@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->

1
landing/CLAUDE.md Normal file
View File

@@ -0,0 +1 @@
@AGENTS.md

32
landing/Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
FROM node:23-alpine AS base
RUN corepack enable
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN pnpm build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3010
ENV HOSTNAME=0.0.0.0
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3010
CMD ["node", "server.js"]

36
landing/README.md Normal file
View File

@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

18
landing/eslint.config.mjs Normal file
View File

@@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);
export default eslintConfig;

7
landing/next.config.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
};
export default nextConfig;

35
landing/package.json Normal file
View File

@@ -0,0 +1,35 @@
{
"name": "landing",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
},
"dependencies": {
"@auth/core": "^0.34.3",
"@heroicons/react": "^2.2.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"framer-motion": "^12.38.0",
"lucide-react": "^1.14.0",
"next": "16.2.4",
"next-auth": "5.0.0-beta.31",
"next-themes": "^0.4.6",
"react": "19.2.4",
"react-dom": "19.2.4",
"tailwind-merge": "^3.5.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.2.4",
"tailwindcss": "^4",
"typescript": "^5"
}
}

4282
landing/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
ignoredBuiltDependencies:
- sharp
- unrs-resolver

View File

@@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;

1
landing/public/file.svg Normal file
View File

@@ -0,0 +1 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 391 B

1
landing/public/globe.svg Normal file
View File

@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

1
landing/public/next.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 128 B

View File

@@ -0,0 +1 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>

After

Width:  |  Height:  |  Size: 385 B

View File

@@ -0,0 +1,3 @@
import { handlers } from "@/auth";
export const { GET, POST } = handlers;

BIN
landing/src/app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

155
landing/src/app/globals.css Normal file
View File

@@ -0,0 +1,155 @@
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@theme {
/* Dify / Untitled UI palette */
--color-bg-primary: #ffffff;
--color-bg-secondary: #f9fafb;
--color-bg-tertiary: #f2f4f7;
--color-bg-section: #f6f7f9;
--color-text-primary: #101828;
--color-text-secondary: #354052;
--color-text-tertiary: #676f83;
--color-text-quaternary: #98a2b2;
--color-text-disabled: #d0d5dc;
--color-border-subtle: rgb(16 24 40 / 0.04);
--color-border-default: rgb(16 24 40 / 0.08);
--color-border-hover: rgb(16 24 40 / 0.14);
--color-border-strong: #d0d5dc;
--color-card: #ffffff;
--color-card-hover: #f9fafb;
/* Dify primary blue */
--color-primary-50: #eff4ff;
--color-primary-100: #d1e0ff;
--color-primary-200: #b2caff;
--color-primary-500: #2970ff;
--color-primary-600: #155aef;
--color-primary-700: #004aeb;
--color-primary-800: #00359e;
--color-primary: var(--color-primary-600);
--color-primary-hover: var(--color-primary-700);
--color-primary-foreground: #ffffff;
/* Accent palette for tile icons (also re-declared in :root below so
Tailwind v4 doesn't tree-shake them — they're only used via inline
style in tile.tsx, which Tailwind's purger can't see). */
--color-accent-blue: #155aef;
--color-accent-indigo: #444ce7;
--color-accent-violet: #7a5af8;
--color-accent-cyan: #0ba5ec;
--color-accent-emerald: #17b26a;
--color-accent-amber: #f79009;
--color-accent-rose: #f04438;
--color-accent-gray: #475467;
--color-destructive: #d92d20;
--color-destructive-bg: #fef3f2;
--color-destructive-border: #fda29b;
--radius-sm: 6px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
--shadow-card: 0 1px 2px rgb(16 24 40 / 0.05);
--shadow-card-hover: 0 12px 24px -8px rgb(16 24 40 / 0.12), 0 4px 8px -4px rgb(16 24 40 / 0.06);
--font-sans: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
--font-mono: var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace;
}
/* Re-declare accents in :root so they survive Tailwind v4's purge of unused
@theme variables. Used by inline styles in tile.tsx (color-mix). */
:root {
--color-accent-blue: #155aef;
--color-accent-indigo: #444ce7;
--color-accent-violet: #7a5af8;
--color-accent-cyan: #0ba5ec;
--color-accent-emerald: #17b26a;
--color-accent-amber: #f79009;
--color-accent-rose: #f04438;
--color-accent-gray: #475467;
}
.dark {
--color-bg-primary: #14181f;
--color-bg-secondary: #1a1f29;
--color-bg-tertiary: #232936;
--color-bg-section: #181d26;
--color-text-primary: #f5f7fa;
--color-text-secondary: #c8ccd5;
--color-text-tertiary: #98a2b2;
--color-text-quaternary: #676f83;
--color-text-disabled: #4a525e;
--color-border-subtle: rgb(255 255 255 / 0.05);
--color-border-default: rgb(255 255 255 / 0.08);
--color-border-hover: rgb(255 255 255 / 0.14);
--color-border-strong: #354052;
--color-card: #1a1f29;
--color-card-hover: #232936;
--color-primary: var(--color-primary-500);
--color-primary-hover: #4187ff;
--shadow-card: 0 1px 2px rgb(0 0 0 / 0.4);
--shadow-card-hover: 0 12px 24px -8px rgb(0 0 0 / 0.5), 0 4px 8px -4px rgb(0 0 0 / 0.3);
}
html,
body {
height: 100%;
}
body {
background: var(--color-bg-secondary);
color: var(--color-text-primary);
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Dify-style typography utilities */
.system-2xs-medium-uppercase {
font-size: 10px;
line-height: 14px;
font-weight: 500;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.system-xs-regular {
font-size: 12px;
line-height: 16px;
font-weight: 400;
}
.system-xs-medium {
font-size: 12px;
line-height: 16px;
font-weight: 500;
}
.system-sm-medium {
font-size: 14px;
line-height: 20px;
font-weight: 500;
}
.system-sm-semibold {
font-size: 14px;
line-height: 20px;
font-weight: 600;
}
/* Scrollbar polish */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
scrollbar-width: none;
}

View File

@@ -0,0 +1,37 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { ThemeProvider } from "@/components/theme-provider";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin", "latin-ext"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin", "latin-ext"],
});
export const metadata: Metadata = {
title: "Colsys AI",
description: "Interní AI portál společnosti Colsys.",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="cs"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
suppressHydrationWarning
>
<body className="min-h-full flex flex-col">
<ThemeProvider>{children}</ThemeProvider>
</body>
</html>
);
}

View File

@@ -0,0 +1,114 @@
import { redirect } from "next/navigation";
import { auth, signIn } from "@/auth";
import { Brand } from "@/components/brand";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
type SearchParams = Promise<{ callbackUrl?: string; error?: string }>;
export default async function LoginPage({
searchParams,
}: {
searchParams: SearchParams;
}) {
const { callbackUrl, error } = await searchParams;
const session = await auth();
if (session?.user) {
redirect(callbackUrl || "/");
}
const hasEntra =
!!process.env.AUTH_MICROSOFT_ENTRA_ID_ID &&
!!process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET;
const hasDevPassword = !!process.env.DEV_PORTAL_PASSWORD;
return (
<div className="flex min-h-full flex-col bg-[var(--color-bg-secondary)]">
<div className="flex flex-1 items-center justify-center px-4 py-12">
<div className="w-full max-w-sm">
<div className="mb-6 flex justify-center">
<Brand size="lg" />
</div>
<div className="rounded-xl border-[0.5px] border-[var(--color-border-default)] bg-[var(--color-card)] p-7 shadow-[var(--shadow-card)]">
<h1 className="text-lg font-semibold text-[var(--color-text-primary)]">
Přihlášení
</h1>
<p className="system-xs-regular mt-1 text-[var(--color-text-tertiary)]">
Pokračujte přihlášením přes firemní účet.
</p>
{error ? (
<div className="mt-5 rounded-lg border-[0.5px] border-[var(--color-destructive-border)] bg-[var(--color-destructive-bg)] px-3 py-2.5 text-xs text-[var(--color-destructive)]">
Přihlášení se nezdařilo. Zkuste to prosím znovu.
</div>
) : null}
{hasEntra ? (
<form
className="mt-6"
action={async () => {
"use server";
await signIn("microsoft-entra-id", {
redirectTo: callbackUrl || "/",
});
}}
>
<Button type="submit" className="w-full" size="lg">
Pokračovat přes Microsoft
</Button>
</form>
) : null}
{hasEntra && hasDevPassword ? (
<div className="my-6 flex items-center gap-3 text-xs text-[var(--color-text-quaternary)]">
<span className="h-px flex-1 bg-[var(--color-border-default)]" />
nebo
<span className="h-px flex-1 bg-[var(--color-border-default)]" />
</div>
) : null}
{hasDevPassword ? (
<form
className="mt-6 flex flex-col gap-3"
action={async (formData: FormData) => {
"use server";
await signIn("dev", {
password: formData.get("password"),
redirectTo: callbackUrl || "/",
});
}}
>
<label className="system-xs-medium text-[var(--color-text-secondary)]">
Vývojový přístup
</label>
<Input
name="password"
type="password"
placeholder="Přístupové heslo"
required
autoFocus
/>
<Button type="submit" variant="secondary" size="lg">
Přihlásit se heslem
</Button>
</form>
) : null}
{!hasEntra && !hasDevPassword ? (
<p className="mt-6 rounded-lg bg-[var(--color-bg-tertiary)] p-4 text-sm text-[var(--color-text-tertiary)]">
Není nakonfigurován žádný poskytovatel přihlášení. Nastavte{" "}
<code className="font-mono text-xs">DEV_PORTAL_PASSWORD</code>{" "}
nebo Microsoft Entra v prostředí.
</p>
) : null}
</div>
<p className="mt-6 text-center text-xs text-[var(--color-text-quaternary)]">
Interní AI portál společnosti Colsys
</p>
</div>
</div>
</div>
);
}

33
landing/src/app/page.tsx Normal file
View File

@@ -0,0 +1,33 @@
import { Header } from "@/components/header";
import { TileGrid } from "@/components/tile-grid";
import apps from "@/data/apps.json";
import type { AppTile } from "@/components/tile";
export default function Home() {
return (
<div className="flex min-h-full flex-col bg-[var(--color-bg-secondary)]">
<Header />
<main className="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-7 px-4 py-8 sm:px-8 sm:py-10">
<section className="flex flex-col gap-2">
<span className="system-2xs-medium-uppercase text-[var(--color-primary)]">
Interní AI portál
</span>
<h1 className="text-2xl font-semibold tracking-tight text-[var(--color-text-primary)] sm:text-3xl">
Vaše AI nástroje na jednom místě
</h1>
<p className="max-w-2xl text-sm text-[var(--color-text-tertiary)] sm:text-base">
Vyberte si průvodce úlohou, nebo zahajte volný chat. Vše běží na
firemních klíčích s rozpočty, sledováním nákladů a bez exportu
vašich dat ven.
</p>
</section>
<TileGrid apps={apps as AppTile[]} />
</main>
<footer className="mx-auto w-full max-w-7xl px-4 pb-10 pt-2 text-xs text-[var(--color-text-quaternary)] sm:px-8">
Nevkládejte do AI nástrojů hesla ani neredaktované osobní či citlivé
údaje.
</footer>
</div>
);
}

51
landing/src/auth.ts Normal file
View File

@@ -0,0 +1,51 @@
import NextAuth, { type NextAuthConfig } from "next-auth";
import Credentials from "next-auth/providers/credentials";
import MicrosoftEntraID from "next-auth/providers/microsoft-entra-id";
const providers: NextAuthConfig["providers"] = [];
if (
process.env.AUTH_MICROSOFT_ENTRA_ID_ID &&
process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET
) {
providers.push(
MicrosoftEntraID({
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID,
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
}),
);
}
if (process.env.DEV_PORTAL_PASSWORD) {
providers.push(
Credentials({
id: "dev",
name: "Development access",
credentials: {
password: { label: "Access password", type: "password" },
},
authorize: async (credentials) => {
const supplied =
typeof credentials?.password === "string" ? credentials.password : "";
if (supplied && supplied === process.env.DEV_PORTAL_PASSWORD) {
return {
id: "dev-user",
name: "Developer",
email: "dev@portal.local",
};
}
return null;
},
}),
);
}
export const { handlers, auth, signIn, signOut } = NextAuth({
providers,
pages: {
signIn: "/login",
},
session: { strategy: "jwt" },
trustHost: true,
});

View File

@@ -0,0 +1,32 @@
import Link from "next/link";
export function Brand({ size = "default" }: { size?: "default" | "lg" }) {
const dim = size === "lg" ? "h-9 w-9" : "h-7 w-7";
const text = size === "lg" ? "text-base" : "text-sm";
return (
<Link href="/" className="flex items-center gap-2.5">
<span
className={`${dim} flex items-center justify-center rounded-[8px] font-bold text-white`}
style={{
background:
"linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-indigo) 100%)",
boxShadow:
"0 1px 2px rgb(16 24 40 / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.18)",
}}
>
<span
className={size === "lg" ? "text-[15px]" : "text-[12px]"}
style={{ letterSpacing: "-0.04em" }}
>
C
</span>
</span>
<span
className={`${text} font-semibold tracking-tight text-[var(--color-text-primary)]`}
>
Colsys <span className="text-[var(--color-primary)]">AI</span>
</span>
</Link>
);
}

View File

@@ -0,0 +1,44 @@
import { auth, signOut } from "@/auth";
import { Brand } from "@/components/brand";
import { Button } from "@/components/ui/button";
import { ThemeToggle } from "@/components/theme-toggle";
import Link from "next/link";
export async function Header() {
const session = await auth();
const user = session?.user;
return (
<header className="sticky top-0 z-30 border-b-[0.5px] border-[var(--color-border-default)] bg-[color-mix(in_srgb,var(--color-bg-secondary)_82%,transparent)] backdrop-blur supports-[backdrop-filter]:bg-[color-mix(in_srgb,var(--color-bg-secondary)_70%,transparent)]">
<div className="mx-auto flex h-14 w-full max-w-7xl items-center justify-between gap-4 px-4 sm:px-8">
<Brand />
<div className="flex items-center gap-2">
{user?.email ? (
<span className="system-xs-regular hidden text-[var(--color-text-tertiary)] sm:inline">
{user.email}
</span>
) : null}
<ThemeToggle />
{user ? (
<form
action={async () => {
"use server";
await signOut({ redirectTo: "/login" });
}}
>
<Button variant="secondary" size="sm" type="submit">
Odhlásit
</Button>
</form>
) : (
<Link href="/login">
<Button variant="secondary" size="sm">
Přihlásit se
</Button>
</Link>
)}
</div>
</div>
</header>
);
}

View File

@@ -0,0 +1,29 @@
"use client";
import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";
import { useEffect } from "react";
function CrossSubdomainThemeCookie() {
const { resolvedTheme } = useTheme();
useEffect(() => {
if (!resolvedTheme) return;
// Cookie shared across *.klas.chat so sibling apps (e.g. dwg-counting) sync.
document.cookie =
`portal_theme=${resolvedTheme}; Path=/; Domain=.klas.chat; Max-Age=31536000; SameSite=Lax`;
}, [resolvedTheme]);
return null;
}
export function ThemeProvider({ children }: { children: React.ReactNode }) {
return (
<NextThemesProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<CrossSubdomainThemeCookie />
{children}
</NextThemesProvider>
);
}

View File

@@ -0,0 +1,25 @@
"use client";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
export function ThemeToggle() {
const { resolvedTheme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
const isDark = mounted && resolvedTheme === "dark";
return (
<Button
variant="ghost"
size="icon"
aria-label="Přepnout vzhled"
onClick={() => setTheme(isDark ? "light" : "dark")}
>
{isDark ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
</Button>
);
}

View File

@@ -0,0 +1,83 @@
"use client";
import { useMemo, useState } from "react";
import { Search } from "lucide-react";
import { Tile, type AppTile } from "@/components/tile";
import { Input } from "@/components/ui/input";
import { cn } from "@/lib/utils";
const ALL = "Vše";
export function TileGrid({ apps }: { apps: AppTile[] }) {
const [query, setQuery] = useState("");
const [activeCategory, setActiveCategory] = useState(ALL);
const categories = useMemo(() => {
const all = Array.from(new Set(apps.map((a) => a.category)));
return [ALL, ...all];
}, [apps]);
const filtered = useMemo(() => {
const q = query.trim().toLowerCase();
return apps.filter((a) => {
const matchesQuery =
!q ||
a.title.toLowerCase().includes(q) ||
a.description.toLowerCase().includes(q) ||
a.category.toLowerCase().includes(q);
const matchesCategory =
activeCategory === ALL || a.category === activeCategory;
return matchesQuery && matchesCategory;
});
}, [apps, query, activeCategory]);
return (
<div className="flex flex-col gap-5">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div className="relative w-full sm:max-w-xs">
<Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--color-text-quaternary)]" />
<Input
placeholder="Hledat aplikace…"
value={query}
onChange={(e) => setQuery(e.target.value)}
className="pl-9"
/>
</div>
<div className="no-scrollbar -mx-1 flex shrink-0 gap-1.5 overflow-x-auto px-1">
{categories.map((cat) => {
const isActive = cat === activeCategory;
return (
<button
key={cat}
type="button"
onClick={() => setActiveCategory(cat)}
className={cn(
"system-xs-medium shrink-0 rounded-lg border px-3 py-1.5 transition-colors",
isActive
? "border-[var(--color-primary)] bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-[var(--color-primary)]"
: "border-[var(--color-border-default)] bg-[var(--color-card)] text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-tertiary)] hover:text-[var(--color-text-secondary)]",
)}
>
{cat}
</button>
);
})}
</div>
</div>
{filtered.length === 0 ? (
<div className="rounded-lg border-[0.5px] border-dashed border-[var(--color-border-hover)] bg-[var(--color-card)] p-12 text-center">
<p className="system-sm-medium text-[var(--color-text-tertiary)]">
Žádné aplikace neodpovídají vyhledávání.
</p>
</div>
) : (
<div className="grid auto-rows-[1fr] grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4">
{filtered.map((app) => (
<Tile key={app.id} app={app} />
))}
</div>
)}
</div>
);
}

View File

@@ -0,0 +1,166 @@
"use client";
import * as Icons from "lucide-react";
import Link from "next/link";
import { ArrowUpRight } from "lucide-react";
import { useTheme } from "next-themes";
import { cn } from "@/lib/utils";
export type AppTile = {
id: string;
title: string;
description: string;
category: string;
icon: string;
accent: string;
href: string;
featured?: boolean;
/** Open in a new tab. Defaults to false — task-style apps replace the
current tab so the browser back button works naturally. Set true for
long-running sessions like the chat tile. */
newTab?: boolean;
/** Visual kind. "tool" (default) is a normal app tile. "cta" renders
a dashed-border invitation card visually distinct from the tools. */
kind?: "tool" | "cta";
};
const accentVar = (accent: string) => `var(--color-accent-${accent})`;
export function Tile({ app }: { app: AppTile }) {
const { resolvedTheme } = useTheme();
const LucideIcon =
(Icons[app.icon as keyof typeof Icons] as React.ComponentType<{
className?: string;
}>) ?? Icons.Sparkles;
const isExternal = app.href.startsWith("http");
const isDisabled = app.href === "#";
// Append current theme to internal-app URLs so they pick up the same scheme.
const isInternalApp = isExternal && app.href.includes(".klas.chat");
const hrefWithTheme = (() => {
if (!isInternalApp || !resolvedTheme) return app.href;
try {
const u = new URL(app.href);
u.searchParams.set("theme", resolvedTheme);
return u.toString();
} catch {
return app.href;
}
})();
const isCta = app.kind === "cta";
const content = isCta ? (
// ─── CTA / "request a new tool" — visually distinct ───
<div
className="group relative flex h-full flex-col items-center justify-center gap-3 overflow-hidden rounded-lg border border-dashed border-[var(--color-border-hover)] bg-transparent p-6 text-center transition-all duration-200 ease-in-out hover:border-solid hover:bg-[var(--color-card-hover)]"
style={{ borderColor: `color-mix(in srgb, ${accentVar(app.accent)} 35%, var(--color-border-hover))` }}
>
<div
className="flex h-12 w-12 items-center justify-center rounded-full"
style={{
background: `color-mix(in srgb, ${accentVar(app.accent)} 12%, transparent)`,
color: accentVar(app.accent),
}}
>
<LucideIcon className="h-6 w-6" />
</div>
<div>
<h3 className="system-sm-semibold text-[var(--color-text-primary)]">
{app.title}
</h3>
<p className="system-xs-regular mt-1.5 text-[var(--color-text-tertiary)]">
{app.description}
</p>
</div>
</div>
) : (
// ─── Standard tool tile ───
<div
className={cn(
"group relative flex h-full flex-col overflow-hidden rounded-lg border-[0.5px] border-[var(--color-border-default)] bg-[var(--color-card)] shadow-[var(--shadow-card)] transition-all duration-200 ease-in-out",
!isDisabled &&
"hover:bg-[var(--color-card-hover)] hover:shadow-[var(--shadow-card-hover)] hover:border-[var(--color-border-hover)]",
isDisabled && "opacity-70",
)}
>
<div className="flex items-start gap-3 px-[14px] pt-[14px] pb-3">
<div
className="flex h-11 w-11 shrink-0 items-center justify-center rounded-[10px]"
style={{
background: `color-mix(in srgb, ${accentVar(app.accent)} 12%, transparent)`,
color: accentVar(app.accent),
}}
>
<LucideIcon className="h-5 w-5" />
</div>
<div className="min-w-0 grow py-px">
<div className="flex items-start justify-between gap-2">
<h3 className="system-sm-semibold truncate text-[var(--color-text-secondary)]">
{app.title}
</h3>
{!isDisabled && (
<ArrowUpRight className="mt-0.5 h-4 w-4 shrink-0 text-[var(--color-text-quaternary)] opacity-0 transition-all group-hover:opacity-100" />
)}
</div>
<div className="system-2xs-medium-uppercase mt-0.5 truncate text-[var(--color-text-tertiary)]">
{app.category}
</div>
</div>
</div>
<div className="px-[14px] pb-3">
<p className="system-xs-regular line-clamp-3 text-[var(--color-text-tertiary)]">
{app.description}
</p>
</div>
{isDisabled && (
<div className="px-[14px] pb-[14px]">
<span className="system-2xs-medium-uppercase inline-flex items-center rounded-full bg-[var(--color-bg-tertiary)] px-2 py-1 text-[var(--color-text-tertiary)]">
Brzy k dispozici
</span>
</div>
)}
{!isDisabled && app.featured && (
<div className="px-[14px] pb-[14px]">
<span
className="system-2xs-medium-uppercase inline-flex items-center rounded-full px-2 py-1 text-[var(--color-primary-foreground)]"
style={{ background: accentVar(app.accent) }}
>
Doporučeno
</span>
</div>
)}
</div>
);
if (isDisabled) {
return <div className="h-full">{content}</div>;
}
if (isExternal) {
const inNewTab = app.newTab === true;
return (
<a
href={hrefWithTheme}
target={inNewTab ? "_blank" : "_self"}
rel={inNewTab ? "noopener noreferrer" : undefined}
className="h-full rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-secondary)]"
>
{content}
</a>
);
}
return (
<Link
href={app.href}
className="h-full rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-secondary)]"
>
{content}
</Link>
);
}

View File

@@ -0,0 +1,48 @@
import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--color-bg-primary)] disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
primary:
"bg-[var(--color-primary)] text-[var(--color-primary-foreground)] border border-[var(--color-border-subtle)] hover:bg-[var(--color-primary-hover)] shadow-[var(--shadow-card)]",
secondary:
"bg-[var(--color-card)] text-[var(--color-text-secondary)] border border-[var(--color-border-hover)] hover:bg-[var(--color-bg-secondary)] hover:border-[var(--color-border-strong)]",
tertiary:
"bg-[var(--color-bg-tertiary)] text-[var(--color-text-secondary)] hover:bg-[color-mix(in_srgb,var(--color-bg-tertiary)_60%,var(--color-text-tertiary)_15%)]",
ghost:
"text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-tertiary)]",
},
size: {
default: "h-9 px-4 text-sm rounded-lg",
sm: "h-8 px-3 text-xs rounded-md",
lg: "h-11 px-5 text-sm rounded-lg",
icon: "h-9 w-9 rounded-lg",
},
},
defaultVariants: {
variant: "primary",
size: "default",
},
},
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {}
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, ...props }, ref) => (
<button
ref={ref}
className={cn(buttonVariants({ variant, size }), className)}
{...props}
/>
),
);
Button.displayName = "Button";
export { buttonVariants };

View File

@@ -0,0 +1,18 @@
import * as React from "react";
import { cn } from "@/lib/utils";
export const Input = React.forwardRef<
HTMLInputElement,
React.InputHTMLAttributes<HTMLInputElement>
>(({ className, type, ...props }, ref) => (
<input
type={type}
ref={ref}
className={cn(
"flex h-9 w-full rounded-lg border border-[var(--color-border-hover)] bg-[var(--color-card)] px-3 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-quaternary)] transition-colors focus-visible:outline-none focus-visible:border-[var(--color-primary)] focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary)_25%,transparent)] disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
{...props}
/>
));
Input.displayName = "Input";

104
landing/src/data/apps.json Normal file
View File

@@ -0,0 +1,104 @@
[
{
"id": "open-chat",
"title": "Otevřený chat",
"description": "Plnohodnotný chat s nahráváním souborů, spouštěním kódu a přepínáním modelů.",
"category": "Chat",
"icon": "MessageSquare",
"accent": "indigo",
"href": "https://chat.klas.chat",
"featured": true,
"newTab": true
},
{
"id": "legal-notice",
"title": "Kontrola smluvních podmínek",
"description": "Nahrajte PDF smlouvu a získáte shrnutí rizik podle kontrolního seznamu plus PDF se zvýrazněnými spornými ustanoveními.",
"category": "Právo",
"icon": "Scale",
"accent": "rose",
"href": "https://smlouvy.klas.chat"
},
{
"id": "document-summarizer",
"title": "Shrnutí dokumentu",
"description": "Vložte text dokumentu a získejte stručný přehled v bodech, odstavcový souhrn, nebo TL;DR.",
"category": "Dokumenty",
"icon": "FileText",
"accent": "blue",
"href": "https://dify.klas.chat/workflow/Ej1QEZElWdP6zcLf"
},
{
"id": "email-drafter",
"title": "Návrh e-mailu",
"description": "Z odrážek vytvoří uhlazený e-mail v ČJ nebo AJ. Volitelný tón, podpis a odpověď na původní zprávu.",
"category": "Komunikace",
"icon": "Mail",
"accent": "emerald",
"href": "https://email.klas.chat"
},
{
"id": "invoice-extractor",
"title": "Extrakce faktur",
"description": "Nahrajte fakturu v PDF nebo jako sken a získáte editovatelná strukturovaná data připravená pro export do Excelu.",
"category": "Provoz",
"icon": "Receipt",
"accent": "amber",
"href": "https://faktury.klas.chat"
},
{
"id": "translator",
"title": "Překladač",
"description": "Firemní překlad mezi 20 jazyky se zachováním tónu, technických termínů a formátování.",
"category": "Komunikace",
"icon": "Languages",
"accent": "cyan",
"href": "https://prekladac.klas.chat"
},
{
"id": "dwg-rooms",
"title": "Extrakce místností z DWG",
"description": "Nahrajte výkres DWG nebo DXF a získejte editovatelnou tabulku místností připravenou pro export do Excelu.",
"category": "Technické",
"icon": "Building2",
"accent": "violet",
"href": "https://dwg.klas.chat"
},
{
"id": "dwg-counting",
"title": "Počítání symbolů z PDF výkresu",
"description": "Nahrajte PDF výkres, vyznačte symboly přímo ve výkresu a získejte počty s vyznačením v PDF nebo Excelu.",
"category": "Technické",
"icon": "ScanSearch",
"accent": "cyan",
"href": "https://dwg-counting.klas.chat"
},
{
"id": "vv-check",
"title": "Kontrola cen ve VV",
"description": "Nahrajte sešit s více výkazy výměr (VV). Aplikace najde stejnou položku v různých listech a upozorní na rozdílné jednotkové ceny.",
"category": "Technické",
"icon": "ScaleHorizontal",
"accent": "amber",
"href": "https://kontrola-vv.klas.chat"
},
{
"id": "vv-compare",
"title": "Porovnání VV (původní vs nový)",
"description": "Nahrajte dva soubory výkazu výměr. Aplikace vypíše změněné, přidané a odebrané položky a vytvoří strukturovaný Excel report.",
"category": "Technické",
"icon": "FileDiff",
"accent": "violet",
"href": "https://porovnani-vv.klas.chat"
},
{
"id": "feature-request",
"title": "Chybí vám nástroj?",
"description": "Pošlete nám návrh, co by AI portál měl umět.",
"category": "Návrhy",
"icon": "Lightbulb",
"accent": "amber",
"href": "https://navrhy.klas.chat",
"kind": "cta"
}
]

6
landing/src/lib/utils.ts Normal file
View File

@@ -0,0 +1,6 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

21
landing/src/proxy.ts Normal file
View File

@@ -0,0 +1,21 @@
import { auth } from "@/auth";
export default auth((req) => {
const { pathname } = req.nextUrl;
const isPublic =
pathname.startsWith("/login") ||
pathname.startsWith("/api/auth") ||
pathname.startsWith("/_next") ||
pathname === "/favicon.ico";
if (!req.auth && !isPublic) {
const url = new URL("/login", req.nextUrl);
url.searchParams.set("callbackUrl", pathname);
return Response.redirect(url);
}
});
export const config = {
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
};

34
landing/tsconfig.json Normal file
View File

@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
}