zyket 1.2.11 → 1.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/.github/workflows/publish.yml +37 -37
  2. package/README.md +279 -279
  3. package/bin/cli.js +201 -201
  4. package/index.js +32 -32
  5. package/package.json +54 -50
  6. package/src/Middleware.js +3 -3
  7. package/src/extensions/Extension.js +10 -10
  8. package/src/extensions/bullboard/index.js +38 -38
  9. package/src/extensions/interactive-storage/index.js +162 -162
  10. package/src/extensions/interactive-storage/middlewares/MulterMiddleware.js +31 -31
  11. package/src/extensions/interactive-storage/routes/browse.js +31 -31
  12. package/src/extensions/interactive-storage/routes/create-folder.js +37 -37
  13. package/src/extensions/interactive-storage/routes/delete-folder.js +57 -57
  14. package/src/extensions/interactive-storage/routes/delete.js +41 -41
  15. package/src/extensions/interactive-storage/routes/download.js +47 -47
  16. package/src/extensions/interactive-storage/routes/info.js +37 -37
  17. package/src/extensions/interactive-storage/routes/upload.js +46 -46
  18. package/src/kernel/HTTPServer.js +31 -31
  19. package/src/kernel/index.js +78 -78
  20. package/src/services/Service.js +10 -10
  21. package/src/services/auth/auth.js +7 -7
  22. package/src/services/auth/index.js +199 -199
  23. package/src/services/bullmq/Worker.js +7 -7
  24. package/src/services/bullmq/index.js +92 -92
  25. package/src/services/cache/index.js +96 -96
  26. package/src/services/database/index.js +127 -127
  27. package/src/services/events/Event.js +6 -6
  28. package/src/services/events/index.js +59 -59
  29. package/src/services/express/Express.js +248 -248
  30. package/src/services/express/Middleware.js +7 -7
  31. package/src/services/express/RedirectResponse.js +8 -8
  32. package/src/services/express/Route.js +6 -6
  33. package/src/services/express/index.js +4 -4
  34. package/src/services/index.js +29 -29
  35. package/src/services/logger/index.js +80 -80
  36. package/src/services/s3/index.js +82 -82
  37. package/src/services/scheduler/Schedule.js +6 -6
  38. package/src/services/scheduler/index.js +47 -47
  39. package/src/services/socketio/Guard.js +10 -10
  40. package/src/services/socketio/Handler.js +10 -10
  41. package/src/services/socketio/SocketIO.js +159 -132
  42. package/src/services/socketio/index.js +4 -4
  43. package/src/services/template-manager/index.js +73 -73
  44. package/src/templates/default/config/cors.js +4 -4
  45. package/src/templates/default/config/swagger.js +15 -15
  46. package/src/templates/default/frontend/main.jsx +15 -15
  47. package/src/templates/default/frontend/src/hooks/useAuth.jsx +51 -51
  48. package/src/templates/default/frontend/src/hooks/useLayout.jsx +18 -18
  49. package/src/templates/default/frontend/src/layouts/auth/index.jsx +45 -45
  50. package/src/templates/default/frontend/src/layouts/auth/routes.js +17 -17
  51. package/src/templates/default/frontend/src/layouts/landing/index.jsx +61 -61
  52. package/src/templates/default/frontend/src/layouts/landing/routes.js +10 -10
  53. package/src/templates/default/frontend/src/layouts/panel/index.jsx +115 -115
  54. package/src/templates/default/frontend/src/layouts/panel/routes.js +10 -10
  55. package/src/templates/default/frontend/src/middlewares/LoggedMiddleware.jsx +21 -21
  56. package/src/templates/default/frontend/src/middlewares/NotLoggedMiddleware.jsx +14 -14
  57. package/src/templates/default/frontend/src/store/index.jsx +5 -5
  58. package/src/templates/default/frontend/src/store/storeAuth.jsx +14 -14
  59. package/src/templates/default/frontend/src/views/auth/index.jsx +4 -4
  60. package/src/templates/default/frontend/src/views/auth/register/index.jsx +4 -4
  61. package/src/templates/default/frontend/src/views/landing/index.jsx +4 -4
  62. package/src/templates/default/frontend/src/views/panel/dashboard/index.jsx +4 -4
  63. package/src/templates/default/frontend/styles.css +1 -1
  64. package/src/templates/default/src/guards/default.js +6 -6
  65. package/src/templates/default/src/handlers/connection.js +6 -6
  66. package/src/templates/default/src/handlers/message.js +8 -8
  67. package/src/templates/default/src/middlewares/default.js +7 -7
  68. package/src/templates/default/src/routes/[test]/message.js +26 -26
  69. package/src/templates/default/src/routes/index.js +22 -22
  70. package/src/templates/default/src/services/auth/auth.js +7 -7
  71. package/src/templates/default/src/services/auth/index.js +32 -32
  72. package/src/utils/EnvManager.js +65 -65
@@ -1,18 +1,18 @@
1
- import React from 'react';
2
- import { Route } from 'react-router-dom';
3
-
4
- export default function useLayout(routeList) {
5
-
6
- const routes = routeList.map((route, index) => {
7
- const middlewares = route.middlewares ? [...route.middlewares].reverse() : [];
8
- let element = <route.component />;
9
- middlewares.forEach((middleware) => {
10
- element = React.createElement(middleware, {}, element);
11
- });
12
- return <Route key={index} path={route.path} element={element} />;
13
- });
14
-
15
- return {
16
- routes,
17
- };
18
- }
1
+ import React from 'react';
2
+ import { Route } from 'react-router-dom';
3
+
4
+ export default function useLayout(routeList) {
5
+
6
+ const routes = routeList.map((route, index) => {
7
+ const middlewares = route.middlewares ? [...route.middlewares].reverse() : [];
8
+ let element = <route.component />;
9
+ middlewares.forEach((middleware) => {
10
+ element = React.createElement(middleware, {}, element);
11
+ });
12
+ return <Route key={index} path={route.path} element={element} />;
13
+ });
14
+
15
+ return {
16
+ routes,
17
+ };
18
+ }
@@ -1,45 +1,45 @@
1
- import { Navigate, Routes, Route } from "react-router-dom";
2
- import useLayout from "../../hooks/useLayout";
3
- import layoutRoutes from "./routes";
4
-
5
- export default function AuthLayout() {
6
- const { routes } = useLayout(layoutRoutes)
7
-
8
- return (
9
- <div className="min-h-screen bg-[#080808] text-white flex items-center justify-center relative overflow-hidden">
10
- <div
11
- className="absolute inset-0 pointer-events-none"
12
- style={{
13
- backgroundImage: `
14
- linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
15
- linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
16
- `,
17
- backgroundSize: "48px 48px",
18
- }}
19
- />
20
-
21
- <div className="absolute inset-0 pointer-events-none">
22
- <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
23
- </div>
24
-
25
- <div className="relative z-10 w-full max-w-sm px-8 py-10 space-y-8">
26
- <div className="flex flex-col items-center gap-4">
27
- <div className="w-11 h-11 bg-orange-500 rounded-md flex items-center justify-center">
28
- <span className="text-black font-black text-base tracking-tighter">PY</span>
29
- </div>
30
- <span className="text-white font-black text-2xl tracking-widest uppercase">Pnyise</span>
31
- </div>
32
-
33
- <Routes>
34
- {routes}
35
- <Route path="*" element={<Navigate to="/auth" replace />} />
36
- </Routes>
37
- </div>
38
-
39
- <div className="absolute bottom-6 text-xs text-zinc-700">
40
- © {new Date().getFullYear()} Zyket
41
- </div>
42
-
43
- </div>
44
- );
45
- }
1
+ import { Navigate, Routes, Route } from "react-router-dom";
2
+ import useLayout from "../../hooks/useLayout";
3
+ import layoutRoutes from "./routes";
4
+
5
+ export default function AuthLayout() {
6
+ const { routes } = useLayout(layoutRoutes)
7
+
8
+ return (
9
+ <div className="min-h-screen bg-[#080808] text-white flex items-center justify-center relative overflow-hidden">
10
+ <div
11
+ className="absolute inset-0 pointer-events-none"
12
+ style={{
13
+ backgroundImage: `
14
+ linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
15
+ linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
16
+ `,
17
+ backgroundSize: "48px 48px",
18
+ }}
19
+ />
20
+
21
+ <div className="absolute inset-0 pointer-events-none">
22
+ <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
23
+ </div>
24
+
25
+ <div className="relative z-10 w-full max-w-sm px-8 py-10 space-y-8">
26
+ <div className="flex flex-col items-center gap-4">
27
+ <div className="w-11 h-11 bg-orange-500 rounded-md flex items-center justify-center">
28
+ <span className="text-black font-black text-base tracking-tighter">PY</span>
29
+ </div>
30
+ <span className="text-white font-black text-2xl tracking-widest uppercase">Pnyise</span>
31
+ </div>
32
+
33
+ <Routes>
34
+ {routes}
35
+ <Route path="*" element={<Navigate to="/auth" replace />} />
36
+ </Routes>
37
+ </div>
38
+
39
+ <div className="absolute bottom-6 text-xs text-zinc-700">
40
+ © {new Date().getFullYear()} Zyket
41
+ </div>
42
+
43
+ </div>
44
+ );
45
+ }
@@ -1,18 +1,18 @@
1
- import AuthView from "../../views/auth";
2
- import AuthRegisterView from "../../views/auth/register";
3
- import NotLoggedMiddleware from "../../middlewares/NotLoggedMiddleware";
4
-
5
- export default [
6
- {
7
- name: "Auth",
8
- path: "/",
9
- component: AuthView,
10
- middlewares: [NotLoggedMiddleware],
11
- },
12
- {
13
- name: "Auth Register",
14
- path: "/register",
15
- component: AuthRegisterView,
16
- middlewares: [NotLoggedMiddleware],
17
- }
1
+ import AuthView from "../../views/auth";
2
+ import AuthRegisterView from "../../views/auth/register";
3
+ import NotLoggedMiddleware from "../../middlewares/NotLoggedMiddleware";
4
+
5
+ export default [
6
+ {
7
+ name: "Auth",
8
+ path: "/",
9
+ component: AuthView,
10
+ middlewares: [NotLoggedMiddleware],
11
+ },
12
+ {
13
+ name: "Auth Register",
14
+ path: "/register",
15
+ component: AuthRegisterView,
16
+ middlewares: [NotLoggedMiddleware],
17
+ }
18
18
  ]
@@ -1,61 +1,61 @@
1
- import { Navigate, Routes, Route, Link } from "react-router-dom";
2
- import useLayout from "../../hooks/useLayout";
3
- import layoutRoutes from "./routes";
4
-
5
- export default function LandingLayout() {
6
- const { routes } = useLayout(layoutRoutes)
7
-
8
-
9
- return (
10
- <div className="min-h-screen bg-[#080808] text-white relative overflow-hidden">
11
- <div
12
- className="absolute inset-0 pointer-events-none"
13
- style={{
14
- backgroundImage: `
15
- linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
16
- linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
17
- `,
18
- backgroundSize: "48px 48px",
19
- }}
20
- />
21
-
22
- <div className="absolute inset-0 pointer-events-none">
23
- <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
24
- </div>
25
-
26
- <div className="relative z-10">
27
- <nav className="flex items-center justify-between px-8 py-6 max-w-7xl mx-auto">
28
- <div className="flex items-center gap-3">
29
- <div className="w-10 h-10 bg-orange-500 rounded-md flex items-center justify-center">
30
- <span className="text-black font-black text-sm tracking-tighter">PY</span>
31
- </div>
32
- <span className="text-white font-black text-xl tracking-widest uppercase">Pnyise</span>
33
- </div>
34
-
35
- <div className="flex items-center gap-6">
36
- <Link to="/auth" className="text-sm text-zinc-400 hover:text-white transition-colors">
37
- Sign In
38
- </Link>
39
- <Link
40
- to="/auth"
41
- className="text-sm bg-orange-500 hover:bg-orange-600 text-black font-semibold px-4 py-2 rounded-md transition-colors"
42
- >
43
- Get Started
44
- </Link>
45
- </div>
46
- </nav>
47
-
48
- <main className="px-8 py-12">
49
- <Routes>
50
- {routes}
51
- <Route path="*" element={<Navigate to="/" replace />} />
52
- </Routes>
53
- </main>
54
-
55
- <footer className="absolute bottom-0 w-full py-6 text-center text-xs text-zinc-700 border-t border-zinc-900">
56
- © {new Date().getFullYear()} Zyket. All rights reserved.
57
- </footer>
58
- </div>
59
- </div>
60
- );
61
- }
1
+ import { Navigate, Routes, Route, Link } from "react-router-dom";
2
+ import useLayout from "../../hooks/useLayout";
3
+ import layoutRoutes from "./routes";
4
+
5
+ export default function LandingLayout() {
6
+ const { routes } = useLayout(layoutRoutes)
7
+
8
+
9
+ return (
10
+ <div className="min-h-screen bg-[#080808] text-white relative overflow-hidden">
11
+ <div
12
+ className="absolute inset-0 pointer-events-none"
13
+ style={{
14
+ backgroundImage: `
15
+ linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
16
+ linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
17
+ `,
18
+ backgroundSize: "48px 48px",
19
+ }}
20
+ />
21
+
22
+ <div className="absolute inset-0 pointer-events-none">
23
+ <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
24
+ </div>
25
+
26
+ <div className="relative z-10">
27
+ <nav className="flex items-center justify-between px-8 py-6 max-w-7xl mx-auto">
28
+ <div className="flex items-center gap-3">
29
+ <div className="w-10 h-10 bg-orange-500 rounded-md flex items-center justify-center">
30
+ <span className="text-black font-black text-sm tracking-tighter">PY</span>
31
+ </div>
32
+ <span className="text-white font-black text-xl tracking-widest uppercase">Pnyise</span>
33
+ </div>
34
+
35
+ <div className="flex items-center gap-6">
36
+ <Link to="/auth" className="text-sm text-zinc-400 hover:text-white transition-colors">
37
+ Sign In
38
+ </Link>
39
+ <Link
40
+ to="/auth"
41
+ className="text-sm bg-orange-500 hover:bg-orange-600 text-black font-semibold px-4 py-2 rounded-md transition-colors"
42
+ >
43
+ Get Started
44
+ </Link>
45
+ </div>
46
+ </nav>
47
+
48
+ <main className="px-8 py-12">
49
+ <Routes>
50
+ {routes}
51
+ <Route path="*" element={<Navigate to="/" replace />} />
52
+ </Routes>
53
+ </main>
54
+
55
+ <footer className="absolute bottom-0 w-full py-6 text-center text-xs text-zinc-700 border-t border-zinc-900">
56
+ © {new Date().getFullYear()} Zyket. All rights reserved.
57
+ </footer>
58
+ </div>
59
+ </div>
60
+ );
61
+ }
@@ -1,10 +1,10 @@
1
- import LandingView from "../../views/landing";
2
-
3
- export default [
4
- {
5
- name: "Landing",
6
- path: "/",
7
- component: LandingView,
8
- middlewares: [],
9
- },
10
- ];
1
+ import LandingView from "../../views/landing";
2
+
3
+ export default [
4
+ {
5
+ name: "Landing",
6
+ path: "/",
7
+ component: LandingView,
8
+ middlewares: [],
9
+ },
10
+ ];
@@ -1,115 +1,115 @@
1
- import { Navigate, Routes, Route, Link, useLocation } from "react-router-dom";
2
- import useLayout from "../../hooks/useLayout";
3
- import layoutRoutes from "./routes";
4
-
5
- export default function PanelLayout() {
6
- const location = useLocation();
7
- const { routes } = useLayout(layoutRoutes);
8
-
9
- const navItems = [
10
- { name: "Dashboard", path: "/panel/dashboard", icon: "📊" },
11
- { name: "Settings", path: "/panel/settings", icon: "⚙️" },
12
- ];
13
-
14
- const isActive = (path) => location.pathname === path;
15
-
16
- return (
17
- <div className="min-h-screen bg-[#080808] text-white flex">
18
- {/* Sidebar */}
19
- <aside className="w-64 bg-[#0a0a0a] border-r border-zinc-900 flex flex-col">
20
- {/* Logo */}
21
- <div className="px-6 py-6 border-b border-zinc-900">
22
- <div className="flex items-center gap-3">
23
- <div className="w-10 h-10 bg-orange-500 rounded-md flex items-center justify-center">
24
- <span className="text-black font-black text-sm tracking-tighter">PY</span>
25
- </div>
26
- <span className="text-white font-black text-lg tracking-widest uppercase">Pnyise</span>
27
- </div>
28
- </div>
29
-
30
- {/* Navigation */}
31
- <nav className="flex-1 px-4 py-6 space-y-2">
32
- {navItems.map((item) => (
33
- <Link
34
- key={item.path}
35
- to={item.path}
36
- className={`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${
37
- isActive(item.path)
38
- ? "bg-orange-500 text-black font-semibold"
39
- : "text-zinc-400 hover:text-white hover:bg-zinc-900"
40
- }`}
41
- >
42
- <span className="text-lg">{item.icon}</span>
43
- <span className="text-sm">{item.name}</span>
44
- </Link>
45
- ))}
46
- </nav>
47
-
48
- {/* User Menu */}
49
- <div className="px-4 py-4 border-t border-zinc-900">
50
- <div className="flex items-center gap-3 px-4 py-3">
51
- <div className="w-9 h-9 bg-zinc-800 rounded-full flex items-center justify-center">
52
- <span className="text-xs font-semibold">U</span>
53
- </div>
54
- <div className="flex-1 min-w-0">
55
- <p className="text-sm font-medium truncate">User</p>
56
- <p className="text-xs text-zinc-500 truncate">user@example.com</p>
57
- </div>
58
- </div>
59
- <Link
60
- to="/auth"
61
- className="w-full mt-2 px-4 py-2 text-sm text-zinc-400 hover:text-white hover:bg-zinc-900 rounded-lg transition-colors flex items-center justify-center"
62
- >
63
- Logout
64
- </Link>
65
- </div>
66
- </aside>
67
-
68
- {/* Main Content */}
69
- <div className="flex-1 flex flex-col min-w-0 relative overflow-hidden">
70
- {/* Background Grid */}
71
- <div
72
- className="absolute inset-0 pointer-events-none"
73
- style={{
74
- backgroundImage: `
75
- linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
76
- linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
77
- `,
78
- backgroundSize: "48px 48px",
79
- }}
80
- />
81
-
82
- <div className="absolute inset-0 pointer-events-none">
83
- <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
84
- </div>
85
-
86
- {/* Header */}
87
- <header className="relative z-10 px-8 py-6 border-b border-zinc-900 bg-[#080808]/80 backdrop-blur-sm">
88
- <div className="flex items-center justify-between">
89
- <h1 className="text-2xl font-bold">Dashboard</h1>
90
- <div className="flex items-center gap-4">
91
- <button className="p-2 text-zinc-400 hover:text-white transition-colors">
92
- 🔔
93
- </button>
94
- </div>
95
- </div>
96
- </header>
97
-
98
- {/* Main Content Area */}
99
- <main className="relative z-10 flex-1 overflow-auto">
100
- <div className="p-8">
101
- <Routes>
102
- {routes}
103
- <Route path="*" element={<Navigate to="/panel/dashboard" replace />} />
104
- </Routes>
105
- </div>
106
- </main>
107
-
108
- {/* Footer */}
109
- <footer className="relative z-10 py-4 text-center text-xs text-zinc-700 border-t border-zinc-900">
110
- © {new Date().getFullYear()} Zyket. All rights reserved.
111
- </footer>
112
- </div>
113
- </div>
114
- );
115
- }
1
+ import { Navigate, Routes, Route, Link, useLocation } from "react-router-dom";
2
+ import useLayout from "../../hooks/useLayout";
3
+ import layoutRoutes from "./routes";
4
+
5
+ export default function PanelLayout() {
6
+ const location = useLocation();
7
+ const { routes } = useLayout(layoutRoutes);
8
+
9
+ const navItems = [
10
+ { name: "Dashboard", path: "/panel/dashboard", icon: "📊" },
11
+ { name: "Settings", path: "/panel/settings", icon: "⚙️" },
12
+ ];
13
+
14
+ const isActive = (path) => location.pathname === path;
15
+
16
+ return (
17
+ <div className="min-h-screen bg-[#080808] text-white flex">
18
+ {/* Sidebar */}
19
+ <aside className="w-64 bg-[#0a0a0a] border-r border-zinc-900 flex flex-col">
20
+ {/* Logo */}
21
+ <div className="px-6 py-6 border-b border-zinc-900">
22
+ <div className="flex items-center gap-3">
23
+ <div className="w-10 h-10 bg-orange-500 rounded-md flex items-center justify-center">
24
+ <span className="text-black font-black text-sm tracking-tighter">PY</span>
25
+ </div>
26
+ <span className="text-white font-black text-lg tracking-widest uppercase">Pnyise</span>
27
+ </div>
28
+ </div>
29
+
30
+ {/* Navigation */}
31
+ <nav className="flex-1 px-4 py-6 space-y-2">
32
+ {navItems.map((item) => (
33
+ <Link
34
+ key={item.path}
35
+ to={item.path}
36
+ className={`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${
37
+ isActive(item.path)
38
+ ? "bg-orange-500 text-black font-semibold"
39
+ : "text-zinc-400 hover:text-white hover:bg-zinc-900"
40
+ }`}
41
+ >
42
+ <span className="text-lg">{item.icon}</span>
43
+ <span className="text-sm">{item.name}</span>
44
+ </Link>
45
+ ))}
46
+ </nav>
47
+
48
+ {/* User Menu */}
49
+ <div className="px-4 py-4 border-t border-zinc-900">
50
+ <div className="flex items-center gap-3 px-4 py-3">
51
+ <div className="w-9 h-9 bg-zinc-800 rounded-full flex items-center justify-center">
52
+ <span className="text-xs font-semibold">U</span>
53
+ </div>
54
+ <div className="flex-1 min-w-0">
55
+ <p className="text-sm font-medium truncate">User</p>
56
+ <p className="text-xs text-zinc-500 truncate">user@example.com</p>
57
+ </div>
58
+ </div>
59
+ <Link
60
+ to="/auth"
61
+ className="w-full mt-2 px-4 py-2 text-sm text-zinc-400 hover:text-white hover:bg-zinc-900 rounded-lg transition-colors flex items-center justify-center"
62
+ >
63
+ Logout
64
+ </Link>
65
+ </div>
66
+ </aside>
67
+
68
+ {/* Main Content */}
69
+ <div className="flex-1 flex flex-col min-w-0 relative overflow-hidden">
70
+ {/* Background Grid */}
71
+ <div
72
+ className="absolute inset-0 pointer-events-none"
73
+ style={{
74
+ backgroundImage: `
75
+ linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
76
+ linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px)
77
+ `,
78
+ backgroundSize: "48px 48px",
79
+ }}
80
+ />
81
+
82
+ <div className="absolute inset-0 pointer-events-none">
83
+ <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_50%_50%,rgba(255,107,0,0.08),transparent_65%)]" />
84
+ </div>
85
+
86
+ {/* Header */}
87
+ <header className="relative z-10 px-8 py-6 border-b border-zinc-900 bg-[#080808]/80 backdrop-blur-sm">
88
+ <div className="flex items-center justify-between">
89
+ <h1 className="text-2xl font-bold">Dashboard</h1>
90
+ <div className="flex items-center gap-4">
91
+ <button className="p-2 text-zinc-400 hover:text-white transition-colors">
92
+ 🔔
93
+ </button>
94
+ </div>
95
+ </div>
96
+ </header>
97
+
98
+ {/* Main Content Area */}
99
+ <main className="relative z-10 flex-1 overflow-auto">
100
+ <div className="p-8">
101
+ <Routes>
102
+ {routes}
103
+ <Route path="*" element={<Navigate to="/panel/dashboard" replace />} />
104
+ </Routes>
105
+ </div>
106
+ </main>
107
+
108
+ {/* Footer */}
109
+ <footer className="relative z-10 py-4 text-center text-xs text-zinc-700 border-t border-zinc-900">
110
+ © {new Date().getFullYear()} Zyket. All rights reserved.
111
+ </footer>
112
+ </div>
113
+ </div>
114
+ );
115
+ }
@@ -1,11 +1,11 @@
1
- import PanelDashboardView from "../../views/panel/dashboard";
2
- import LoggedMiddleware from "../../middlewares/LoggedMiddleware";
3
-
4
- export default [
5
- {
6
- name: "Panel Dashboard",
7
- path: "/dashboard",
8
- component: PanelDashboardView,
9
- middlewares: [LoggedMiddleware],
10
- }
1
+ import PanelDashboardView from "../../views/panel/dashboard";
2
+ import LoggedMiddleware from "../../middlewares/LoggedMiddleware";
3
+
4
+ export default [
5
+ {
6
+ name: "Panel Dashboard",
7
+ path: "/dashboard",
8
+ component: PanelDashboardView,
9
+ middlewares: [LoggedMiddleware],
10
+ }
11
11
  ]
@@ -1,21 +1,21 @@
1
- import PropTypes from "prop-types";
2
- import { Navigate } from "react-router-dom";
3
- import useAuth from "../hooks/useAuth";
4
-
5
- export default function LoggedMiddleware({
6
- children
7
- }) {
8
- const { user, isPending } = useAuth();
9
-
10
- if (isPending) return null;
11
- if (!user) return <Navigate to={`/auth/login`} />; // Change this to your desired login route
12
-
13
- return children;
14
- }
15
-
16
- LoggedMiddleware.propTypes = {
17
- children: PropTypes.node.isRequired,
18
- roles: PropTypes.arrayOf(PropTypes.string),
19
- loginRoute: PropTypes.string,
20
- forbiddenRoute: PropTypes.string,
21
- };
1
+ import PropTypes from "prop-types";
2
+ import { Navigate } from "react-router-dom";
3
+ import useAuth from "../hooks/useAuth";
4
+
5
+ export default function LoggedMiddleware({
6
+ children
7
+ }) {
8
+ const { user, isPending } = useAuth();
9
+
10
+ if (isPending) return null;
11
+ if (!user) return <Navigate to={`/auth/login`} />; // Change this to your desired login route
12
+
13
+ return children;
14
+ }
15
+
16
+ LoggedMiddleware.propTypes = {
17
+ children: PropTypes.node.isRequired,
18
+ roles: PropTypes.arrayOf(PropTypes.string),
19
+ loginRoute: PropTypes.string,
20
+ forbiddenRoute: PropTypes.string,
21
+ };
@@ -1,15 +1,15 @@
1
- import PropTypes from 'prop-types';
2
- import { Navigate } from 'react-router-dom';
3
- import useAuth from '../hooks/useAuth';
4
-
5
- export default function NotLoggedMiddleware ({ children }) {
6
- const { user, isPending } = useAuth();
7
-
8
- if(isPending) return null;
9
- if(user) return <Navigate to={`/panel`} />; // Change this to your desired home route for logged in users
10
- return children;
11
- }
12
-
13
- NotLoggedMiddleware.propTypes = {
14
- children: PropTypes.node.isRequired
1
+ import PropTypes from 'prop-types';
2
+ import { Navigate } from 'react-router-dom';
3
+ import useAuth from '../hooks/useAuth';
4
+
5
+ export default function NotLoggedMiddleware ({ children }) {
6
+ const { user, isPending } = useAuth();
7
+
8
+ if(isPending) return null;
9
+ if(user) return <Navigate to={`/panel`} />; // Change this to your desired home route for logged in users
10
+ return children;
11
+ }
12
+
13
+ NotLoggedMiddleware.propTypes = {
14
+ children: PropTypes.node.isRequired
15
15
  };
@@ -1,5 +1,5 @@
1
- import { useStoreAuth } from './storeAuth';
2
-
3
- export { useStoreAuth };
4
-
5
-
1
+ import { useStoreAuth } from './storeAuth';
2
+
3
+ export { useStoreAuth };
4
+
5
+