This commit is contained in:
cdricms
2025-01-15 11:54:39 +01:00
parent d18245736f
commit 683a8c3133
13 changed files with 165 additions and 69 deletions

View File

@@ -1,3 +1,4 @@
"use server";
import { AppSidebar } from "@/components/app-sidebar";
import {
Breadcrumb,
@@ -14,7 +15,7 @@ import {
SidebarTrigger,
} from "@/components/ui/sidebar";
export default function Page() {
export default async function Page() {
return (
<SidebarProvider>
<AppSidebar />

View File

@@ -1,35 +1,7 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "@/app/globals.css";
import Navbar from "@/components/nav-bar";
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="fr">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
return <>{children}</>;
}

View File

@@ -1,16 +1,14 @@
"use server"
"use server";
export default async function About() {
const res = await fetch("http://localhost:8000/api");
console.log(res);
return (
<div>
<div>
About us
will :
+explain what we
+pricing
+plannign for what will come next
About us will : +explain what we +pricing +plannign for what
will come next
</div>
</div>
)
);
}

View File

@@ -1,23 +1,5 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "@/app/globals.css";
import Navbar from "@/components/nav-bar";
import Footer from "@/components/footer";
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",
};
import Navbar from "@/components/nav-bar";
export default function RootLayout({
children,
@@ -25,14 +7,10 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="fr">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<Navbar />
{children}
<Footer />
</body>
</html>
<>
<Navbar />
{children}
<Footer />
</>
);
}

42
frontend/app/layout.tsx Normal file
View File

@@ -0,0 +1,42 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "@/app/globals.css";
import { SWRConfig } from "swr";
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 (
<SWRConfig
value={{
fetcher: (url: string) => fetch(url).then((res) => res.json()),
revalidateOnFocus: false,
}}
>
<html lang="fr">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
</SWRConfig>
);
}

19
frontend/deno.lock generated
View File

@@ -27,6 +27,7 @@
"npm:react-dom@19": "19.0.0_react@19.0.0",
"npm:react-icons@^5.4.0": "5.4.0_react@19.0.0",
"npm:react@19": "19.0.0",
"npm:swr@^2.3.0": "2.3.0_react@19.0.0",
"npm:tailwind-merge@^2.6.0": "2.6.0",
"npm:tailwindcss-animate@^1.0.7": "1.0.7_tailwindcss@3.4.17__postcss@8.4.49",
"npm:tailwindcss@^3.4.1": "3.4.17_postcss@8.4.49",
@@ -1226,6 +1227,9 @@
"object-keys"
]
},
"dequal@2.0.3": {
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="
},
"detect-libc@2.0.3": {
"integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw=="
},
@@ -2776,6 +2780,14 @@
"supports-preserve-symlinks-flag@1.0.0": {
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="
},
"swr@2.3.0_react@19.0.0": {
"integrity": "sha512-NyZ76wA4yElZWBHzSgEJc28a0u6QZvhb6w0azeL2k7+Q1gAzVK+IqQYXhVOC/mzi+HZIozrZvBVeSeOZNR2bqA==",
"dependencies": [
"dequal",
"react",
"use-sync-external-store"
]
},
"tailwind-merge@2.6.0": {
"integrity": "sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA=="
},
@@ -2939,6 +2951,12 @@
"tslib"
]
},
"use-sync-external-store@1.4.0_react@19.0.0": {
"integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==",
"dependencies": [
"react"
]
},
"util-deprecate@1.0.2": {
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
@@ -3051,6 +3069,7 @@
"npm:react-dom@19",
"npm:react-icons@^5.4.0",
"npm:react@19",
"npm:swr@^2.3.0",
"npm:tailwind-merge@^2.6.0",
"npm:tailwindcss-animate@^1.0.7",
"npm:tailwindcss@^3.4.1",

View File

@@ -4,11 +4,16 @@ const nextConfig: NextConfig = {
/* config options here */
output: "standalone",
async redirects() {
if (!process.env.BACKEND_PORT) {
throw new Error(
"Environment variable BACKEND_PORT is not defined.",
);
}
return [
{
destination: "/api",
source: `http://localhost:${process.env.BACKEND_PORT}`,
permanent: true,
source: "/api",
destination: `http://localhost:${process.env.BACKEND_PORT}`,
permanent: false,
},
];
},

View File

@@ -28,6 +28,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-icons": "^5.4.0",
"swr": "^2.3.0",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7"
},