feat: integrate TanStack Router and update routing structure

- Added TanStack Router for improved routing management.
- Created route tree and individual routes for login, index, add-product, inventory, and view-product.
- Implemented authentication checks for the inventory route.
- Introduced a landing page component.
- Updated App component to utilize RouterProvider and ToastContainer for notifications.
- Refactored CSS to use Tailwind CSS, removing custom styles.
- Added API configuration for backend URL management.
- Implemented authentication utilities for user sign-in and sign-out.
- Integrated i18next for internationalization with English and German language support.
- Created localization files for English and German languages.
This commit is contained in:
2026-05-26 14:59:16 +02:00
parent b3c3be5590
commit d6e29a74af
21 changed files with 706 additions and 419 deletions
+9
View File
@@ -0,0 +1,9 @@
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/app/add-product')({
component: RouteComponent,
})
function RouteComponent() {
return <div>Hello "/app/add-product"!</div>
}
+17
View File
@@ -0,0 +1,17 @@
import { createFileRoute, redirect } from "@tanstack/react-router";
import { isAuthenticated } from "../../utils/auth";
export const Route = createFileRoute("/app/inventory")({
beforeLoad: () => {
if (!isAuthenticated()) {
throw redirect({
to: "/login",
});
}
},
component: RouteComponent,
});
function RouteComponent() {
return <div>Hello "/app/inventory"!</div>;
}
+9
View File
@@ -0,0 +1,9 @@
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/app/view-product')({
component: RouteComponent,
})
function RouteComponent() {
return <div>Hello "/app/view-product"!</div>
}