progres day 1

This commit is contained in:
smanylov
2025-11-25 17:13:16 +07:00
parent 10668aa997
commit 40766ae67b
26 changed files with 1336 additions and 216 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
/* config options here */ /* output: 'export' */
}; };
export default nextConfig; export default nextConfig;
+1098 -11
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -9,10 +9,13 @@
"lint": "eslint" "lint": "eslint"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/postcss": "^4.1.17",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"next": "16.0.3", "next": "16.0.3",
"next-auth": "5.0.0-beta.30",
"react": "19.2.0", "react": "19.2.0",
"react-dom": "19.2.0" "react-dom": "19.2.0",
"tailwindcss": "^4.1.17"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20", "@types/node": "^20",
@@ -20,6 +23,7 @@
"@types/react-dom": "^19", "@types/react-dom": "^19",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "16.0.3", "eslint-config-next": "16.0.3",
"sass": "^1.94.2",
"typescript": "^5" "typescript": "^5"
} }
} }
+6
View File
@@ -0,0 +1,6 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
-1
View File
@@ -1 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 391 B

-1
View File
@@ -1 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 1.0 KiB

-1
View File
@@ -1 +0,0 @@
<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.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.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>

Before

Width:  |  Height:  |  Size: 1.3 KiB

-1
View File
@@ -1 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 128 B

-1
View File
@@ -1 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 385 B

+30
View File
@@ -0,0 +1,30 @@
'use server'
export async function testConnect() {
try {
const response = await fetch('http://localhost:8080/api/auth/register', {
method: 'POST',
body: JSON.stringify({
"firstName": "Serg",
"secondName": "Fedorovich",
"lastName": "Tankan",
"email": "gggpetst2test@e.ru",
"password": "1121231412"
}),
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
}
});
let parsed = await response.json();
console.log('all fine??');
console.log(parsed);
return parsed;
} catch (error) {
throw error;
}
}
+2 -24
View File
@@ -1,27 +1,10 @@
:root {
--background: #ffffff;
--foreground: #171717;
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}
html, html,
body { body {
max-width: 100vw;
overflow-x: hidden; overflow-x: hidden;
} }
body { body {
color: var(--foreground); font-family: 'Segoe UI', sans-serif;
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
* { * {
@@ -31,12 +14,7 @@ body {
} }
a { a {
color: inherit;
text-decoration: none; text-decoration: none;
} }
@media (prefers-color-scheme: dark) { @import "tailwindcss";
html {
color-scheme: dark;
}
}
+4 -17
View File
@@ -1,21 +1,9 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import NavLinks from '@/app/ui/nav-links'
import "./globals.css"; import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: "No copy",
description: "Generated by create next app", description: "No copy",
}; };
export default function RootLayout({ export default function RootLayout({
@@ -24,9 +12,8 @@ export default function RootLayout({
children: React.ReactNode; children: React.ReactNode;
}>) { }>) {
return ( return (
<html lang="en"> <html lang="ru">
<body className={`${geistSans.variable} ${geistMono.variable}`}> <body className={``}>
<NavLinks />
{children} {children}
</body> </body>
</html> </html>
+13
View File
@@ -0,0 +1,13 @@
import { Metadata } from 'next';
export const metadata: Metadata = {
title: 'Login',
};
export default function Home() {
return (
<div>
plz login
</div>
);
}
-141
View File
@@ -1,141 +0,0 @@
.page {
--background: #fafafa;
--foreground: #fff;
--text-primary: #000;
--text-secondary: #666;
--button-primary-hover: #383838;
--button-secondary-hover: #f2f2f2;
--button-secondary-border: #ebebeb;
display: flex;
min-height: 100vh;
align-items: center;
justify-content: center;
font-family: var(--font-geist-sans);
background-color: var(--background);
}
.main {
display: flex;
min-height: 100vh;
width: 100%;
max-width: 800px;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
background-color: var(--foreground);
padding: 120px 60px;
}
.intro {
display: flex;
flex-direction: column;
align-items: flex-start;
text-align: left;
gap: 24px;
}
.intro h1 {
max-width: 320px;
font-size: 40px;
font-weight: 600;
line-height: 48px;
letter-spacing: -2.4px;
text-wrap: balance;
color: var(--text-primary);
}
.intro p {
max-width: 440px;
font-size: 18px;
line-height: 32px;
text-wrap: balance;
color: var(--text-secondary);
}
.intro a {
font-weight: 500;
color: var(--text-primary);
}
.ctas {
display: flex;
flex-direction: row;
width: 100%;
max-width: 440px;
gap: 16px;
font-size: 14px;
}
.ctas a {
display: flex;
justify-content: center;
align-items: center;
height: 40px;
padding: 0 16px;
border-radius: 128px;
border: 1px solid transparent;
transition: 0.2s;
cursor: pointer;
width: fit-content;
font-weight: 500;
}
a.primary {
background: var(--text-primary);
color: var(--background);
gap: 8px;
}
a.secondary {
border-color: var(--button-secondary-border);
}
/* Enable hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
a.primary:hover {
background: var(--button-primary-hover);
border-color: transparent;
}
a.secondary:hover {
background: var(--button-secondary-hover);
border-color: transparent;
}
}
@media (max-width: 600px) {
.main {
padding: 48px 24px;
}
.intro {
gap: 16px;
}
.intro h1 {
font-size: 32px;
line-height: 40px;
letter-spacing: -1.92px;
}
}
@media (prefers-color-scheme: dark) {
.logo {
filter: invert();
}
.page {
--background: #000;
--foreground: #000;
--text-primary: #ededed;
--text-secondary: #999;
--button-primary-hover: #ccc;
--button-secondary-hover: #1a1a1a;
--button-secondary-border: #1a1a1a;
}
}
+3
View File
@@ -0,0 +1,3 @@
.mainContainter {
margin-left: 280px;
}
+6 -2
View File
@@ -1,5 +1,6 @@
import styles from "./page.module.css"; import styles from "./page.module.scss";
import { Metadata } from 'next'; import { Metadata } from 'next';
import Link from 'next/link';
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'Home page', title: 'Home page',
@@ -10,8 +11,11 @@ export default function Home() {
<div className={styles.page}> <div className={styles.page}>
<main className={styles.main}> <main className={styles.main}>
<div className={styles.intro}> <div className={styles.intro}>
Home page Home page11
</div> </div>
<Link key={'dashboard'}
href={'/pages/dashboard'}
>dash board</Link>
</main> </main>
</div> </div>
); );
+19
View File
@@ -0,0 +1,19 @@
import { Metadata } from 'next';
import Button from '@/app/ui/button'
export const metadata: Metadata = {
title: 'Dashboard',
};
export default function Home() {
return (
<div>
<main>
<div>
Dashboard
</div>
<Button/>
</main>
</div>
);
}
+11
View File
@@ -0,0 +1,11 @@
import NavLinks from '@/app/ui/nav-links'
import styles from '@/app/page.module.scss'
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="flex">
<NavLinks />
<div className={`${styles.mainContainter}`}>{children}</div>
</div>
);
}
+17
View File
@@ -0,0 +1,17 @@
import { Metadata } from 'next';
export const metadata: Metadata = {
title: 'page 1',
};
export default function Home() {
return (
<div>
<main>
<div>
page 1
</div>
</main>
</div>
);
}
+17
View File
@@ -0,0 +1,17 @@
import { Metadata } from 'next';
export const metadata: Metadata = {
title: 'page 2',
};
export default function Home() {
return (
<div>
<main>
<div>
page 2
</div>
</main>
</div>
);
}
+16
View File
@@ -0,0 +1,16 @@
'use client'
import { testConnect } from '@/app/api/action';
async function clickHandler() {
console.log('click');
testConnect();
}
export default function Button() {
return (
<button onClick={() => {
clickHandler();
}}>button</button>
);
}
+12
View File
@@ -0,0 +1,12 @@
import styles from './ui.module.scss';
export default function Logo() {
return (
<div className={`${styles.logo}`}>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2L2 7v10c0 5.55 3.84 9.74 9 11 5.16-1.26 9-5.45 9-11V7l-10-5z"></path>
</svg>
No copy
</div>
)
}
+17 -14
View File
@@ -3,23 +3,24 @@
import Link from 'next/link'; import Link from 'next/link';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
import clsx from 'clsx'; import clsx from 'clsx';
import styles from '@/app/page.module.css' import styles from './ui.module.scss'
import Logo from '@/app/ui/logo';
const links = [ const links = [
{ {
name: 'Home', name: 'Главная',
href: '/', href: '/pages/dashboard',
icon: 'HomeIcon' img: 'M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'
}, },
{ {
name: 'Page1', name: 'Page1',
href: '/page1', href: '/pages/page1',
icon: 'page1Icon', img: ''
}, },
{ {
name: 'Page2', name: 'Page2',
href: '/page2', href: '/pages/page2',
icon: 'page2Icon', img: ''
} }
]; ];
@@ -27,22 +28,24 @@ export default function NavLinks() {
const pathname = usePathname(); const pathname = usePathname();
return ( return (
<div className='bg-[#fafafa]'> <div className=''>
<nav className={`${styles.nav}` + " flex max-w-[800px] w-full"}> <nav className={`${styles.sidebar}`}>
<Logo />
{links.map((link) => { {links.map((link) => {
const LinkIcon = link.icon;
return ( return (
<Link <Link
key={link.name} key={link.name}
href={link.href} href={link.href}
className={clsx( className={clsx(
'flex h-[48px] grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3', `flex ${styles['nav-item']}`,
{ {
'bg-sky-100 text-blue-600': pathname === link.href, 'bg-[#5659f1]': pathname === link.href,
}, },
)} )}
> >
<LinkIcon /> <svg viewBox="0 0 24 24" fill="currentColor">
<path d={link.img}></path>
</svg>
<p className="hidden md:block">{link.name}</p> <p className="hidden md:block">{link.name}</p>
</Link> </Link>
); );
+36
View File
@@ -0,0 +1,36 @@
.sidebar {
width: 280px;
background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
padding: 30px 0;
border-radius: 0 30px 30px 0;
position: fixed;
height: 100vh;
overflow-y: auto;
z-index: 100;
}
.nav-item {
margin-bottom: 8px;
svg {
margin-right: 15px;
width: 20px;
height: 20px;
}
}
.logo {
display: flex;
align-items: center;
padding: 0 30px 40px;
color: white;
font-size: 24px;
font-weight: 600;
text-transform: uppercase;
svg {
width: 32px;
height: 32px;
margin-right: 15px;
}
}
+13
View File
@@ -0,0 +1,13 @@
import { NextResponse, NextRequest } from 'next/server';
const isLogin = true;
export function proxy(request: NextRequest) {
if (request.nextUrl.pathname !== '/login' && !isLogin) {
return NextResponse.redirect(new URL('/login', request.url));
}
}
export const config = {
matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)']
};
+10
View File
@@ -0,0 +1,10 @@
import type { Config } from 'tailwindcss';
const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
};
export default config;