Initial commit: NestJS NextJS pnpm monorepo
This commit is contained in:
commit
610dcf202b
175 files changed
+25172
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
import { articleFindById } from "../../../../actions/article.actions";
|
||||
import { ArticleMainForm } from "../../../../components/article/articleMain.form";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
import { manufacturerFindAll } from "../../../../actions/manufacturer.actions";
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>
|
||||
|
||||
}
|
||||
export default async function CatergoryUpdate({ params }: PageProps) {
|
||||
|
||||
|
||||
const { id } = await params
|
||||
const article = await articleFindById(id);
|
||||
const cats = await categoryFindAll();
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
|
||||
if(!article._id) {
|
||||
return (<div>
|
||||
<div>Artikel nicht gefunden</div>
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.article.url}>zurück1</Link>
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
const {name,category,variants} = article;
|
||||
console.log('Varianten:',article.variants)
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<ArticleMainForm initData={article} categories={cats} manufacturer={manufacturer}></ArticleMainForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.article.url}>zurück</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { manufacturerFindAll } from "../../../../actions/manufacturer.actions";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
import { ArticleMainForm } from "../../../../components/article/articleMain.form";
|
||||
import { articleCreate, articleFindAll } from "../../../../actions/article.actions";
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../../../apps/frontend/_config/sites";
|
||||
//import { sites } from "@/";
|
||||
|
||||
|
||||
interface Props {
|
||||
|
||||
}
|
||||
|
||||
export default async function ArticlePage({ }: Props) {
|
||||
|
||||
const cats = await categoryFindAll();
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
const artikel = await articleFindAll();
|
||||
|
||||
if(!manufacturer) return <div>Keine Hersteller gefunden</div>
|
||||
|
||||
return <>
|
||||
<ArticleMainForm categories={cats} manufacturer={manufacturer}></ArticleMainForm>
|
||||
<Link href={`${sites.article.url}`} className="text-sky-300">zurück</Link>
|
||||
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { manufacturerFindAll } from "../../../actions/manufacturer.actions";
|
||||
import { articleFindAll } from "../../../actions/article.actions";
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../../apps/frontend/_config/sites";
|
||||
import { ArticleList } from "../../../components/article/articleList";
|
||||
import { Icon, CirclePlus } from "lucide-react";
|
||||
|
||||
interface Props { }
|
||||
|
||||
export default async function ArticlePage({ }: Props) {
|
||||
|
||||
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
const artikel = await articleFindAll();
|
||||
|
||||
if (!manufacturer) return <div>Keine Hersteller gefunden</div>
|
||||
|
||||
return <div className="p-4 mb-4">
|
||||
<div className="">
|
||||
<Link href={`${sites.article.new.url}`} className="text-sky-300 text-black"><CirclePlus color="green" />neu </Link>
|
||||
</div>
|
||||
<ArticleList articles={artikel}></ArticleList>
|
||||
<Link href={`${sites.main.url}`} className="text-sky-300">zurück</Link>
|
||||
</div>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../_config/sites";
|
||||
import { CategoryForm } from "../../../components/category/categroy.form";
|
||||
|
||||
interface PageProps {
|
||||
|
||||
}
|
||||
|
||||
export default async function CatergoryUpdate({ }: PageProps) {
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
|
||||
<CategoryForm></CategoryForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.category.url}>zurück</Link>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../_config/sites";
|
||||
import { categoryFindAll } from "../../actions/category.actions";
|
||||
|
||||
|
||||
|
||||
export default async function CatergoryPage() {
|
||||
const cats = await categoryFindAll();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<div className="flex flex-col gap-8 mt-4 ms-4">
|
||||
|
||||
<div className="border-1 max-w-200 p-4">
|
||||
<div className="mb-4 cursor-pointer text-sky-500 hover:bg-sky-700">
|
||||
<Link href={`/category/new`}>Neu</Link>
|
||||
</div>
|
||||
{cats.map((cat) => (
|
||||
<div key={cat._id} className="flex gap-4 p-0">
|
||||
<div className="min-w-30">
|
||||
{cat.name}
|
||||
</div>
|
||||
<div className="cursor-pointer text-sky-500 ps-1 pe-1 hover:bg-sky-700">
|
||||
<Link href={`/category/update/${cat._id}`}>Update</Link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.main.url}>Home</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
import { CategoryForm } from "../../../../components/category/categroy.form";
|
||||
|
||||
import { categoryFindById } from "../../../../actions/category.actions";
|
||||
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>
|
||||
|
||||
}
|
||||
export default async function CatergoryUpdate({ params }: PageProps) {
|
||||
|
||||
|
||||
const { id } = await params
|
||||
const cat = await categoryFindById(id);
|
||||
|
||||
if(!cat._id) {
|
||||
return (<div>
|
||||
<div>Kategorie nicht gefunden</div>
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.category.url}>zurück</Link>
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<CategoryForm initData={cat} ></CategoryForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.category.url}>zurück</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { io } from 'socket.io-client';
|
||||
|
||||
const socket = io('http://localhost:3000');
|
||||
|
||||
export default function Home() {
|
||||
const [msg, setMsg] = useState('');
|
||||
const [messages, setMessages] = useState<string[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
socket.on('message', (data) => {
|
||||
console.log(data);
|
||||
setMessages((prev) => [...prev, data]);
|
||||
});
|
||||
|
||||
return () => {
|
||||
socket.off('message');
|
||||
};
|
||||
}, []);
|
||||
|
||||
const sendMessage = () => {
|
||||
socket.emit('message', msg);
|
||||
setMsg('');
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<input value={msg} onChange={(e) => setMsg(e.target.value)} />
|
||||
<button onClick={sendMessage}>Send</button>
|
||||
|
||||
<ul>
|
||||
{messages.map((m, i) => <li key={i}>{m}</li>)}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,26 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-sans: var(--font-geist-sans);
|
||||
--font-mono: var(--font-geist-mono);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--background: #0a0a0a;
|
||||
--foreground: #ededed;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--background);
|
||||
color: var(--foreground);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
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 = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../_config/sites";
|
||||
import { LocationForm } from "../../../components/location/location.form";
|
||||
|
||||
|
||||
|
||||
export default async function LocationNewPage() {
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col gap-4">
|
||||
<div>
|
||||
{sites.location.new.name}
|
||||
<LocationForm debug={true}></LocationForm>
|
||||
</div>
|
||||
|
||||
<Link href={sites.location.url}>zurück zu {sites.location.name}</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../_config/sites";
|
||||
import { locationTree } from "../../actions/location.actions";
|
||||
|
||||
import { LocationView } from "../../components/location/location.view";
|
||||
|
||||
|
||||
|
||||
export default async function LocationPage() {
|
||||
|
||||
|
||||
const treeNodes = await locationTree();
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<div>
|
||||
<Link href={sites.location.new.url}>{sites.location.new.name}</Link>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<LocationView data={treeNodes}></LocationView>
|
||||
|
||||
</div>
|
||||
|
||||
<Link href={sites.main.url}>Home</Link>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../_config/sites";
|
||||
import { ManufactuererForm } from "../../../components/manufacturer/manufacturer.form";
|
||||
|
||||
interface PageProps {
|
||||
|
||||
}
|
||||
|
||||
export default async function ManufacturerUpdate({ }: PageProps) {
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
|
||||
<ManufactuererForm></ManufactuererForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.manufacturer.url}>zurück</Link>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../_config/sites";
|
||||
import { manufacturerFindAll } from "../../actions/manufacturer.actions";
|
||||
|
||||
|
||||
|
||||
export default async function ManufacturerPage() {
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<div className="flex flex-col gap-8 mt-4 ms-4">
|
||||
|
||||
<div className="border-1 max-w-200 p-4">
|
||||
<div className="mb-4 cursor-pointer text-sky-500 hover:bg-sky-700">
|
||||
<Link href={sites.manufacturer.new.url}>Neu</Link>
|
||||
</div>
|
||||
{manufacturer.map((man) => (
|
||||
<div key={man._id} className="flex gap-4 p-0">
|
||||
<div className="min-w-30">
|
||||
{man.name}
|
||||
</div>
|
||||
<div className="cursor-pointer text-sky-500 ps-1 pe-1 hover:bg-sky-700">
|
||||
<Link href={`${sites.manufacturer.update.url}/${man._id}`}>Update</Link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.main.url}>Home</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import Link from "next/link";
|
||||
import { manufacturerFindById } from "../../../../actions/manufacturer.actions";
|
||||
import { ManufactuererForm } from "../../../../components/manufacturer/manufacturer.form";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>
|
||||
|
||||
}
|
||||
export default async function CatergoryUpdate({ params }: PageProps) {
|
||||
|
||||
|
||||
const { id } = await params
|
||||
const hersteller = await manufacturerFindById(id);
|
||||
|
||||
if(!hersteller._id) {
|
||||
return (<div>
|
||||
<div>Hersteller nicht gefunden</div>
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.manufacturer.url}>zurück</Link>
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<ManufactuererForm initData={hersteller} ></ManufactuererForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.manufacturer.url}>zurück</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../_config/sites";
|
||||
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="h-dvh bg-gray-100">
|
||||
<div className="min-h-[60] md:max-h-[60] bg-gray-300 ps-12 pt-4">Home Manager</div>
|
||||
<main className="flex flex-col border-1 border-gray-200 ">
|
||||
<div className="m-4 flex flex-col gap-2">
|
||||
<Link href={sites.article.url}>Artikel</Link>
|
||||
<Link href={sites.category.url}>Kategorien</Link>
|
||||
<Link href={sites.manufacturer.url}>Hersteller</Link>
|
||||
<Link href={sites.location.url}>{sites.location.name}</Link>
|
||||
<Link href={sites.stock.new.url}>{sites.stock.new.url}</Link>
|
||||
<Link href={sites.test.url}>Test</Link>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
import { LocationForm } from "../../../../components/location/location.form";
|
||||
import { articleFindAll } from "../../../../actions/article.actions";
|
||||
import { locationFindAll, locationTree } from "../../../../actions/location.actions";
|
||||
import { StockForm } from "../../../../components/stock/stock.form";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
|
||||
|
||||
|
||||
export default async function StockMovmentNewPage() {
|
||||
|
||||
const artikel = await articleFindAll();
|
||||
const orte = await locationTree();
|
||||
const kategorien = await categoryFindAll();
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col gap-4">
|
||||
<div>
|
||||
{sites.location.new.name}
|
||||
<StockForm article={artikel} orte={orte} categories={kategorien}></StockForm>
|
||||
</div>
|
||||
|
||||
<Link href={sites.location.url}>zurück zu {sites.location.name}</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import Image from "next/image";
|
||||
import { sharedFunction } from '@male/shared';
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../_config/sites";
|
||||
import { TestForm } from "../../components/test/testForm";
|
||||
import { CategoryForm } from "../../components/category/categroy.form";
|
||||
import { categoryFindAll } from "../../actions/category.actions";
|
||||
|
||||
console.log(sharedFunction)
|
||||
|
||||
export default async function Home() {
|
||||
const cats = await categoryFindAll();
|
||||
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
{cats.map((cat)=>(<div key={cat._id}>{cat.name}</div>))}
|
||||
<CategoryForm></CategoryForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.main.url}>Home</Link>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user