move next to web-front
This commit is contained in:
1 parent
cc219cdb26
commit
9e53a7b4fc
52 files changed
+1442
-175
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Design System Showcase | videoreg.ru',
|
||||
description:
|
||||
'Hidden design-system showcase for the Best Dashcams 2026 comparison experience.',
|
||||
robots: {
|
||||
follow: false,
|
||||
index: false,
|
||||
},
|
||||
};
|
||||
|
||||
type ShowcaseLayoutProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export default function ShowcaseLayout({ children }: ShowcaseLayoutProps) {
|
||||
return children;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
import { dashcamProducts } from '@/entities/dashcam/model/data';
|
||||
import { BestDashcamsPage } from '@/shared/ui/templates/BestDashcamsPage';
|
||||
|
||||
export const dynamicParams = false;
|
||||
export const revalidate = 3600;
|
||||
|
||||
export function generateStaticParams() {
|
||||
return [{ devRoot: '_dev' }];
|
||||
}
|
||||
|
||||
type ShowcasePageProps = {
|
||||
params: Promise<{
|
||||
devRoot: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export default async function ShowcasePage({ params }: ShowcasePageProps) {
|
||||
const { devRoot } = await params;
|
||||
|
||||
if (devRoot !== '_dev') {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <BestDashcamsPage products={dashcamProducts} />;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { revalidatePath, revalidateTag } from 'next/cache';
|
||||
import { getCachedVideoDashboard, VIDEO_COLLECTION_TAG } from '@/entities/video/api/videoCache';
|
||||
import { addVideo } from '@/entities/video/api/videoRepository';
|
||||
import { normalizeVideoDraft } from '@/entities/video/model/video';
|
||||
|
||||
export const revalidate = 3600;
|
||||
|
||||
export async function GET() {
|
||||
const dashboard = await getCachedVideoDashboard();
|
||||
|
||||
return NextResponse.json(dashboard, {
|
||||
headers: {
|
||||
'cache-control': 'public, max-age=60, s-maxage=3600, stale-while-revalidate=86400',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = (await request.json().catch(() => undefined)) as
|
||||
| { title?: string; owner?: string; sourceUrl?: string; status?: string }
|
||||
| undefined;
|
||||
|
||||
const video = await addVideo(normalizeVideoDraft(body ?? {}));
|
||||
revalidateTag(VIDEO_COLLECTION_TAG, { expire: 0 });
|
||||
revalidatePath('/');
|
||||
|
||||
return NextResponse.json({ video }, { status: 201 });
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--font-ui: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
||||
sans-serif;
|
||||
--font-tech: "IBM Plex Mono", Iosevka, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
||||
"Liberation Mono", monospace;
|
||||
|
||||
--surface-0: #f2eee6;
|
||||
--surface-1: #fbfaf6;
|
||||
--surface-2: #e8e1d5;
|
||||
--surface-3: #d8cfc0;
|
||||
--surface-inverse: #151a1c;
|
||||
|
||||
--text-primary: #202528;
|
||||
--text-muted: #667076;
|
||||
--text-subtle: #858076;
|
||||
--text-inverse: #f7f3ea;
|
||||
--text-on-accent: #f8fbfb;
|
||||
|
||||
--border-subtle: #d7cec0;
|
||||
--border-strong: #bdb3a4;
|
||||
|
||||
--accent: #56798a;
|
||||
--accent-strong: #385f70;
|
||||
--accent-soft: #dbe7e9;
|
||||
--accent-soft-border: #b7cbd1;
|
||||
|
||||
--warning: #8f7044;
|
||||
--warning-soft: #efe5d6;
|
||||
--warning-soft-border: #d7bea0;
|
||||
|
||||
--danger: #884b46;
|
||||
--danger-soft: #eadbd8;
|
||||
--danger-soft-border: #c9aaa5;
|
||||
|
||||
--success: #58705c;
|
||||
--success-soft: #dde8dd;
|
||||
--success-soft-border: #b8ccb9;
|
||||
|
||||
--focus: #56798a;
|
||||
--radius-sm: 4px;
|
||||
--radius-md: 6px;
|
||||
--radius-lg: 8px;
|
||||
--shadow-soft: 0 14px 34px rgb(32 37 40 / 8%);
|
||||
--shadow-raised: 0 22px 48px rgb(32 37 40 / 12%);
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--font-sans: var(--font-ui);
|
||||
--font-mono: var(--font-tech);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--surface-0: #101415;
|
||||
--surface-1: #171d1f;
|
||||
--surface-2: #202729;
|
||||
--surface-3: #2d3538;
|
||||
--surface-inverse: #f4efe6;
|
||||
|
||||
--text-primary: #f3efe8;
|
||||
--text-muted: #b7b2aa;
|
||||
--text-subtle: #948f87;
|
||||
--text-inverse: #161a1c;
|
||||
--text-on-accent: #f8fbfb;
|
||||
|
||||
--border-subtle: #30383b;
|
||||
--border-strong: #4b5559;
|
||||
|
||||
--accent: #7f9ead;
|
||||
--accent-strong: #b5ced7;
|
||||
--accent-soft: #1d3139;
|
||||
--accent-soft-border: #31505b;
|
||||
|
||||
--warning: #d0b184;
|
||||
--warning-soft: #352a1e;
|
||||
--warning-soft-border: #5a462b;
|
||||
|
||||
--danger: #d7aaa5;
|
||||
--danger-soft: #351f1f;
|
||||
--danger-soft-border: #583433;
|
||||
|
||||
--success: #a8c2aa;
|
||||
--success-soft: #1f3022;
|
||||
--success-soft-border: #38523b;
|
||||
|
||||
--shadow-soft: 0 14px 34px rgb(0 0 0 / 24%);
|
||||
--shadow-raised: 0 22px 48px rgb(0 0 0 / 32%);
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
min-height: 100%;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100%;
|
||||
margin: 0;
|
||||
background: var(--surface-0);
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-ui);
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
p,
|
||||
td,
|
||||
th {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--accent-soft);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
width: min(1180px, calc(100% - 32px));
|
||||
margin: 0 auto;
|
||||
padding: 24px 0 40px;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 6px;
|
||||
color: var(--accent-strong);
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.page-shell h1 {
|
||||
margin: 0;
|
||||
font-size: 2rem;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.page-shell h2 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.page-shell h3 {
|
||||
margin: 0;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.workbench {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
|
||||
gap: 20px;
|
||||
align-items: start;
|
||||
padding-top: 22px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background: var(--surface-1);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-soft);
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.field span {
|
||||
color: var(--text-muted);
|
||||
font-size: 0.82rem;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.field input,
|
||||
.field select {
|
||||
min-height: 42px;
|
||||
width: 100%;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface-1);
|
||||
color: var(--text-primary);
|
||||
padding: 9px 10px;
|
||||
}
|
||||
|
||||
.field input:focus,
|
||||
.field select:focus {
|
||||
border-color: var(--accent);
|
||||
outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
|
||||
}
|
||||
|
||||
.submit-button {
|
||||
min-height: 42px;
|
||||
border: 0;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--text-on-accent);
|
||||
cursor: pointer;
|
||||
font-weight: 750;
|
||||
}
|
||||
|
||||
.submit-button:hover {
|
||||
background: var(--accent-strong);
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(110px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.metric {
|
||||
min-height: 76px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-2);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.metric span {
|
||||
display: block;
|
||||
color: var(--text-muted);
|
||||
font-size: 0.76rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.metric strong {
|
||||
display: block;
|
||||
margin-top: 7px;
|
||||
font-size: 1.45rem;
|
||||
}
|
||||
|
||||
.video-list {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.video-card {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 14px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-1);
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.video-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.pill {
|
||||
min-height: 24px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface-2);
|
||||
color: var(--text-muted);
|
||||
padding: 4px 9px;
|
||||
font-size: 0.76rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pill.status-draft {
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.pill.status-published {
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.pill.status-archived {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.cache-panel {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, auto);
|
||||
gap: 8px;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
.cache-item {
|
||||
min-height: 42px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface-1);
|
||||
padding: 7px 10px;
|
||||
}
|
||||
|
||||
.cache-item span {
|
||||
display: block;
|
||||
color: var(--text-muted);
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.cache-item strong {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 0.84rem;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
border: 1px dashed var(--border-subtle);
|
||||
border-radius: var(--radius-lg);
|
||||
color: var(--text-muted);
|
||||
padding: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.topbar,
|
||||
.workbench {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.cache-panel {
|
||||
justify-content: stretch;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.page-shell {
|
||||
width: min(100% - 20px, 1180px);
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.page-shell h1 {
|
||||
font-size: 1.55rem;
|
||||
}
|
||||
|
||||
.cache-panel,
|
||||
.stats-grid,
|
||||
.video-card {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
scroll-behavior: auto !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export function GET() {
|
||||
return NextResponse.json({
|
||||
status: 'ok',
|
||||
service: 'videoreg-web',
|
||||
metadata: {
|
||||
commitSha: process.env.COMMIT_SHA ?? 'local',
|
||||
releaseId: process.env.RELEASE_ID ?? 'local',
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { listVideos } from '@/entities/video/api/videoRepository';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET() {
|
||||
await listVideos();
|
||||
|
||||
return NextResponse.json({
|
||||
status: 'ok',
|
||||
service: 'videoreg-web',
|
||||
metadata: {
|
||||
commitSha: process.env.COMMIT_SHA ?? 'local',
|
||||
releaseId: process.env.RELEASE_ID ?? 'local',
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { Metadata } from 'next';
|
||||
import './globals.css';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Video Registry',
|
||||
description: 'Operational video registry with primitive storage and aggressive caching.',
|
||||
};
|
||||
|
||||
type RootLayoutProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: RootLayoutProps) {
|
||||
return (
|
||||
<html id="top" lang="en">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { getCachedVideoDashboard } from '@/entities/video/api/videoCache';
|
||||
import { RegisterVideoForm } from '@/features/register-video/ui/RegisterVideoForm';
|
||||
import { CachePanel } from '@/widgets/cache-panel/ui/CachePanel';
|
||||
import { VideoDashboard } from '@/widgets/video-dashboard/ui/VideoDashboard';
|
||||
|
||||
export const revalidate = 3600;
|
||||
|
||||
export default async function Home() {
|
||||
const dashboard = await getCachedVideoDashboard();
|
||||
|
||||
return (
|
||||
<main className="page-shell">
|
||||
<header className="topbar">
|
||||
<div>
|
||||
<p className="eyebrow">videoreg.ru</p>
|
||||
<h1>Video Registry</h1>
|
||||
</div>
|
||||
<CachePanel metadata={dashboard.cache} />
|
||||
</header>
|
||||
|
||||
<div className="workbench">
|
||||
<RegisterVideoForm />
|
||||
<VideoDashboard dashboard={dashboard} />
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user