Initial commit

This commit is contained in:
2026-03-28 17:16:33 +03:00
commit fe9aff3fec
167 changed files with 23898 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/**
* Auth Configuration
* Controls whether authentication is required for the app
*/
export const authConfig = {
// If true, users must login to access the app
// If false, app is public with optional login
isAuthRequired: process.env.NEXT_PUBLIC_AUTH_REQUIRED === "true",
// Public routes that don't require authentication (when auth is required)
publicRoutes: ["/signin", "/signup", "/forgot-password"],
// Routes that should always be protected (even when auth is optional)
protectedRoutes: ["/admin", "/settings", "/profile"],
};
export const isPublicRoute = (pathname: string): boolean => {
return authConfig.publicRoutes.some((route) => pathname.includes(route));
};
export const isProtectedRoute = (pathname: string): boolean => {
return authConfig.protectedRoutes.some((route) => pathname.includes(route));
};
+15
View File
@@ -0,0 +1,15 @@
const isServer = typeof window === "undefined";
const apiUrl = isServer
? process.env.SERVER_API_URL || "http://localhost:3000/api"
: process.env.NEXT_PUBLIC_API_URL || "/api/backend";
const baseUrl = {
// Main API Endpoint (Backend)
// Logic: Server uses direct HTTP, Client uses Proxy to avoid Mixed Content
auth: apiUrl,
admin: apiUrl,
core: apiUrl,
};
export default baseUrl;
+14
View File
@@ -0,0 +1,14 @@
export type NavItem = {
label: string;
href: string;
protected?: boolean;
public?: boolean;
onlyPublic?: boolean;
visible?: boolean;
children?: NavItem[];
};
export const NAV_ITEMS: NavItem[] = [
{ label: "home", href: "/home", public: true },
{ label: "predictions", href: "/predictions", public: true },
];