peppa/apps/web/app/(app)/layout.tsx
Асель 2b0f2fd984 PEP-1: web platform with Gitea login, projects, goals, tasks, sessions
- web: Gitea OAuth2 login, signed session cookie, everything behind login;
  inbox with answers, project board (goals → tasks), task page with
  OpenSpec artifacts, questions and session controls; new project form;
  auto-refresh, light/dark, mobile
- users + projects.owner_id; tokens AES-256-GCM encrypted; owner-only access
- provisionProject (runner): new or existing Gitea repo, peppa-bot
  collaborator, template + openspec init, push, rollback; used by web and
  peppa project create (replaces scripts/bootstrap-project.sh)
- peppa web login-link, peppa project owner; Gitea OAuth app script
- bins/template resolved via PEPPA_ROOT (works inside the Next build)
- testkit: mock-gitea + 10 tests (42 e2e total, all green)
- OpenSpec: pep-1-web-platform archived into specs web-auth,
  project-provisioning, web-workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:55:02 +05:00

29 lines
878 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from "next/link";
import type { ReactNode } from "react";
import { requireUser } from "@/lib/auth";
export const dynamic = "force-dynamic";
export default async function AppLayout({ children }: { children: ReactNode }) {
const user = await requireUser();
return (
<>
<header className="top">
<Link href="/" className="brand">🐷 Peppa</Link>
<nav>
<Link href="/">Входящие</Link>
<Link href="/projects/new">Новый проект</Link>
</nav>
<div className="me">
{user.avatarUrl && <img src={user.avatarUrl} alt="" width={24} height={24} />}
<span>{user.login}</span>
<form action="/logout" method="post">
<button className="link">Выйти</button>
</form>
</div>
</header>
<main>{children}</main>
</>
);
}