From 21694c3e4dced8e3ab480874800eb8b04216201e Mon Sep 17 00:00:00 2001 From: B SIMAK AHMED <1NZ24CS030@newhorizonindia.edu> Date: Sun, 22 Nov 2026 14:06:18 +0530 Subject: [PATCH 1/5] chore: remove workspace maintenance bypass --- src/start.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/start.ts b/src/start.ts index 985ad9b..e3564cc 100644 --- a/src/start.ts +++ b/src/start.ts @@ -6,7 +6,7 @@ import { attachSupabaseAuth } from "@/integrations/supabase/auth-attacher"; const maintenanceSettingKey = "site.maintenance_mode"; function isAdminOrAuthPath(pathname: string) { - return /^\/(?:auth|mfa-setup|mfa-verify|forgot-password|reset-password|dashboard|admin|workspace)(?:\/|$)/.test( + return /^\/(?:auth|mfa-setup|mfa-verify|forgot-password|reset-password|dashboard|admin)(?:\/|$)/.test( pathname, ); } From de24b8c9bb424412b64d56f13766bc21e49fc20f Mon Sep 17 00:00:00 2001 From: B SIMAK AHMED <1NZ24CS030@newhorizonindia.edu> Date: Sun, 22 Nov 2026 14:06:22 +0530 Subject: [PATCH 2/5] chore: remove workspace maintenance bypass --- src/components/MaintenanceGate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MaintenanceGate.tsx b/src/components/MaintenanceGate.tsx index 7468a14..c6455c5 100644 --- a/src/components/MaintenanceGate.tsx +++ b/src/components/MaintenanceGate.tsx @@ -7,7 +7,7 @@ import { supabase } from "@/integrations/supabase/client"; const MAINTENANCE_SETTING_KEY = "site.maintenance_mode"; function isAdminOrAuthPath(pathname: string) { - return /^\/(?:auth|mfa-setup|mfa-verify|forgot-password|reset-password|dashboard|admin|workspace)(?:\/|$)/.test( + return /^\/(?:auth|mfa-setup|mfa-verify|forgot-password|reset-password|dashboard|admin)(?:\/|$)/.test( pathname, ); } From 8a4a74817ce991ebf4ebf4fd873e7f1b968b85a0 Mon Sep 17 00:00:00 2001 From: B SIMAK AHMED <1NZ24CS030@newhorizonindia.edu> Date: Sun, 22 Nov 2026 14:06:30 +0530 Subject: [PATCH 3/5] chore: remove workspace route from generated tree --- src/routeTree.gen.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 94e5288..8d49a66 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -26,7 +26,6 @@ import { Route as TermsRouteImport } from './routes/terms' import { Route as ThankYouRouteImport } from './routes/thank-you' import { Route as AuthenticatedAdminRouteImport } from './routes/_authenticated/admin' import { Route as AuthenticatedDashboardRouteImport } from './routes/_authenticated/dashboard' -import { Route as AuthenticatedWorkspaceRouteImport } from './routes/_authenticated/workspace' import { Route as BlogsSlugRouteImport } from './routes/blogs_.$slug' import { Route as AuthenticatedDashboardNewRouteImport } from './routes/_authenticated/dashboard.new' import { Route as AuthenticatedDashboardEditIdRouteImport } from './routes/_authenticated/dashboard.edit.$id' @@ -115,11 +114,6 @@ const AuthenticatedDashboardRoute = AuthenticatedDashboardRouteImport.update({ path: '/dashboard', getParentRoute: () => AuthenticatedRouteRoute, } as any) -const AuthenticatedWorkspaceRoute = AuthenticatedWorkspaceRouteImport.update({ - id: '/workspace', - path: '/workspace', - getParentRoute: () => AuthenticatedRouteRoute, -} as any) const BlogsSlugRoute = BlogsSlugRouteImport.update({ id: '/blogs_/$slug', path: '/blogs/$slug', @@ -155,7 +149,6 @@ export interface FileRoutesByFullPath { '/thank-you': typeof ThankYouRoute '/admin': typeof AuthenticatedAdminRoute '/dashboard': typeof AuthenticatedDashboardRouteWithChildren - '/workspace': typeof AuthenticatedWorkspaceRoute '/blogs/$slug': typeof BlogsSlugRoute '/dashboard/new': typeof AuthenticatedDashboardNewRoute '/dashboard/edit/$id': typeof AuthenticatedDashboardEditIdRoute @@ -177,7 +170,6 @@ export interface FileRoutesByTo { '/thank-you': typeof ThankYouRoute '/admin': typeof AuthenticatedAdminRoute '/dashboard': typeof AuthenticatedDashboardRouteWithChildren - '/workspace': typeof AuthenticatedWorkspaceRoute '/blogs/$slug': typeof BlogsSlugRoute '/dashboard/new': typeof AuthenticatedDashboardNewRoute '/dashboard/edit/$id': typeof AuthenticatedDashboardEditIdRoute @@ -201,7 +193,6 @@ export interface FileRoutesById { '/thank-you': typeof ThankYouRoute '/_authenticated/admin': typeof AuthenticatedAdminRoute '/_authenticated/dashboard': typeof AuthenticatedDashboardRouteWithChildren - '/_authenticated/workspace': typeof AuthenticatedWorkspaceRoute '/blogs_/$slug': typeof BlogsSlugRoute '/_authenticated/dashboard/new': typeof AuthenticatedDashboardNewRoute '/_authenticated/dashboard/edit/$id': typeof AuthenticatedDashboardEditIdRoute @@ -225,7 +216,6 @@ export interface FileRouteTypes { | '/thank-you' | '/admin' | '/dashboard' - | '/workspace' | '/blogs/$slug' | '/dashboard/new' | '/dashboard/edit/$id' @@ -247,7 +237,6 @@ export interface FileRouteTypes { | '/thank-you' | '/admin' | '/dashboard' - | '/workspace' | '/blogs/$slug' | '/dashboard/new' | '/dashboard/edit/$id' @@ -270,7 +259,6 @@ export interface FileRouteTypes { | '/thank-you' | '/_authenticated/admin' | '/_authenticated/dashboard' - | '/_authenticated/workspace' | '/blogs_/$slug' | '/_authenticated/dashboard/new' | '/_authenticated/dashboard/edit/$id' @@ -466,13 +454,11 @@ const AuthenticatedDashboardRouteWithChildren = interface AuthenticatedRouteRouteChildren { AuthenticatedAdminRoute: typeof AuthenticatedAdminRoute AuthenticatedDashboardRoute: typeof AuthenticatedDashboardRouteWithChildren - AuthenticatedWorkspaceRoute: typeof AuthenticatedWorkspaceRoute } const AuthenticatedRouteRouteChildren: AuthenticatedRouteRouteChildren = { AuthenticatedAdminRoute: AuthenticatedAdminRoute, AuthenticatedDashboardRoute: AuthenticatedDashboardRouteWithChildren, - AuthenticatedWorkspaceRoute: AuthenticatedWorkspaceRoute, } const AuthenticatedRouteRouteWithChildren = From 91b5bc2d54f7b235dc5a2f6e73b9b15b3aa0885b Mon Sep 17 00:00:00 2001 From: B SIMAK AHMED <1NZ24CS030@newhorizonindia.edu> Date: Sun, 22 Nov 2026 14:06:36 +0530 Subject: [PATCH 4/5] chore: remove workspace route mapping --- src/routeTree.gen.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 8d49a66..04f40e4 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -404,13 +404,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthenticatedDashboardRouteImport parentRoute: typeof AuthenticatedRouteRoute } - '/_authenticated/workspace': { - id: '/_authenticated/workspace' - path: '/workspace' - fullPath: '/workspace' - preLoaderRoute: typeof AuthenticatedWorkspaceRouteImport - parentRoute: typeof AuthenticatedRouteRoute - } '/blogs_/$slug': { id: '/blogs_/$slug' path: '/blogs/$slug' From d7eb92773acd0fc9e88b5bbd16deae9cfa522aec Mon Sep 17 00:00:00 2001 From: B SIMAK AHMED <1NZ24CS030@newhorizonindia.edu> Date: Sun, 22 Nov 2026 14:06:40 +0530 Subject: [PATCH 5/5] chore: remove private workspace page --- src/routes/_authenticated/workspace.tsx | 1721 ----------------------- 1 file changed, 1721 deletions(-) delete mode 100644 src/routes/_authenticated/workspace.tsx diff --git a/src/routes/_authenticated/workspace.tsx b/src/routes/_authenticated/workspace.tsx deleted file mode 100644 index 79bd9ad..0000000 --- a/src/routes/_authenticated/workspace.tsx +++ /dev/null @@ -1,1721 +0,0 @@ - -import { useEffect, useMemo, useState, type ReactNode } from "react"; -import { createFileRoute, redirect } from "@tanstack/react-router"; -import { useAuth } from "@/hooks/use-auth"; -import { SiteLayout } from "@/components/SiteLayout"; -import { - ArrowLeft, - BookOpen, - CalendarDays, - CheckCircle2, - BriefcaseBusiness, - ClipboardList, - GraduationCap, - Lightbulb, - Pencil, - Plus, - ShieldCheck, - Trash2, - TriangleAlert, - Wrench, -} from "lucide-react"; - -export const Route = createFileRoute("/_authenticated/workspace")({ - head: () => ({ - meta: [ - { title: "Workspace — CodeForge" }, - { name: "robots", content: "noindex, nofollow" }, - ], - }), - beforeLoad: async () => { - const { supabase } = await import("@/integrations/supabase/client"); - const { data: userData, error: userError } = await supabase.auth.getUser(); - - if (userError || !userData.user) { - throw redirect({ to: "/auth" }); - } - - const { data: roles, error: roleError } = await supabase - .from("user_roles") - .select("role") - .eq("user_id", userData.user.id); - - if (roleError) throw roleError; - - if (!(roles ?? []).some((role) => role.role === "admin")) { - return { workspaceAuthorized: false }; - } - - return { workspaceAuthorized: true }; - }, - component: Workspace, -}); - -const modules = [ - { id: "academics", title: "Academics", description: "Semester subjects, syllabus, CIEs, labs, end-semester exams and academic records.", icon: GraduationCap }, - { id: "backlogs", title: "Backlogs", description: "Track arrears, attempts, exam dates, preparation and cleared subjects.", icon: BookOpen }, - { id: "attendance", title: "Attendance", description: "Subject-wise attendance, target percentage, shortage warnings and attendance planning.", icon: ClipboardList }, - { id: "planner", title: "Planner & Today Brief", description: "Priorities, deadlines, revision tasks, timetable and upcoming exams in one view.", icon: CalendarDays }, - { id: "projects", title: "Projects & Skills", description: "Projects, practical learning, progress, evidence and skill development.", icon: Lightbulb }, - { id: "career", title: "Career & Placement", description: "Internships, applications, certifications, interview preparation and placement tracking.", icon: BriefcaseBusiness }, - { id: "toolbox", title: "IT Toolbox", description: "A curated collection of useful networking, Linux and IT utilities.", icon: Wrench }, - { id: "knowledge", title: "Knowledge Base", description: "Keep searchable troubleshooting notes, commands, solutions and learning resources.", icon: BookOpen }, -] as const; - -function Workspace() { - const { workspaceAuthorized } = Route.useRouteContext(); - const { user, signOut } = useAuth(); - const [activeModule, setActiveModule] = useState(null); - - if (!workspaceAuthorized) { - return ( - -
-
-
-
-
- ); - } - - return ( - -
-
-
- -
-
-
- - Private workspace -
- -

- Workspace -

- -

- Your private command center for academics, learning, projects and - career planning. -

- -

- {user?.email} -

-
- - -
-
- - {activeModule ? ( - activeModule === "academics" ? ( - setActiveModule(null)} /> - ) : ( - setActiveModule(null)} /> - ) - ) : ( -
-
-
-

- Personal modules -

-

- Your personal modules for academics, organization, projects, IT and career progress. -

-
- - - {modules.length} modules - -
- -
- {modules.map((module) => { - const Icon = module.icon; - - return ( -
-
- ); - })} -
-
- )} - -
-

- CodeForge Workspace · Private environment -

-
-
-
- ); -} - -/* --------------------------- workspace modules --------------------------- */ - -type WorkspaceModuleId = "academics" | "backlogs" | "attendance" | "planner" | "projects" | "career" | "toolbox" | "knowledge"; -type RecordStatus = "Not started" | "In progress" | "On hold" | "Completed"; -interface WorkspaceRecord { - id: string; - title: string; - category: string; - status: RecordStatus; - date: string; - number1: number | null; - number2: number | null; - details: string; - notes: string; - semester?: string; -} -interface ModuleStore { version: 1; records: WorkspaceRecord[]; } -const MODULE_STORAGE: Record, string> = { - backlogs: "codeforge:workspace:backlogs:v1", - attendance: "codeforge:workspace:attendance:v1", - planner: "codeforge:workspace:planner:v1", - projects: "codeforge:workspace:projects:v1", - career: "codeforge:workspace:career:v1", - knowledge: "codeforge:workspace:knowledge:v1", -}; -const STATUS_OPTIONS: RecordStatus[] = ["Not started", "In progress", "On hold", "Completed"]; -const MODULE_SETTINGS: Record, { - title: string; subtitle: string; itemLabel: string; categoryLabel: string; categories: string[]; - dateLabel: string; number1Label?: string; number2Label?: string; detailsLabel: string; notesLabel: string; - detailsPlaceholder: string; notesPlaceholder: string; statusOptions?: RecordStatus[]; -}> = { - backlogs: { title: "Backlogs", subtitle: "Keep arrears, attempts, exam dates and clearance history organized.", itemLabel: "Backlog subject", categoryLabel: "Subject / course", categories: ["Theory", "Lab", "Integrated", "Other"], dateLabel: "Next exam date", number1Label: "Attempts so far", detailsLabel: "Preparation / exam details", notesLabel: "Notes", detailsPlaceholder: "Syllabus, important topics, exam plan, registration details…", notesPlaceholder: "Add marks, results, reminders or anything to keep track of…" }, - attendance: { title: "Attendance", subtitle: "Track attended classes against total classes and plan to reach your target.", itemLabel: "Subject", categoryLabel: "Course / section", categories: ["Theory", "Lab", "Integrated", "Other"], dateLabel: "Last updated", number1Label: "Total classes held", number2Label: "Classes attended", detailsLabel: "Attendance notes", notesLabel: "Notes", detailsPlaceholder: "Class schedule, attendance rules, planned absences…", notesPlaceholder: "Additional notes…" }, - planner: { title: "Planner & Today Brief", subtitle: "Capture tasks, deadlines, revision and priorities in one place.", itemLabel: "Task / event", categoryLabel: "Type", categories: ["Study", "Assignment", "Exam", "Lab", "Personal", "Other"], dateLabel: "Due date", number1Label: "Priority (1–5)", detailsLabel: "Task details", notesLabel: "Notes", detailsPlaceholder: "What needs to be done? Break it into steps…", notesPlaceholder: "Extra context…" }, - projects: { title: "Projects & Skills", subtitle: "Track project milestones and skill development with progress and notes.", itemLabel: "Project / skill", categoryLabel: "Type", categories: ["Project", "Skill", "Course", "Practice", "Other"], dateLabel: "Target date", number1Label: "Progress (%)", detailsLabel: "Milestones / learning plan", notesLabel: "Evidence / notes", detailsPlaceholder: "Milestones, deliverables, learning steps…", notesPlaceholder: "Links, proof of work, reflections…" }, - career: { title: "Career & Placement", subtitle: "Manage applications, internships, certifications and interview preparation.", itemLabel: "Opportunity / activity", categoryLabel: "Type", categories: ["Internship", "Job", "Certification", "Interview prep", "Placement", "Other"], dateLabel: "Deadline / date", detailsLabel: "Details", notesLabel: "Notes / follow-up", detailsPlaceholder: "Role, company, eligibility, required skills, application link…", notesPlaceholder: "Follow-up details, preparation notes, contacts…" }, - knowledge: { title: "Knowledge Base", subtitle: "Save searchable notes, solutions, commands and troubleshooting references.", itemLabel: "Entry title", categoryLabel: "Category", categories: ["Networking", "Linux", "Windows", "Cloud", "Security", "General IT", "Other"], dateLabel: "Reference date", detailsLabel: "Content", notesLabel: "Source / extra notes", detailsPlaceholder: "Write the solution, procedure, commands, or knowledge…", notesPlaceholder: "Reference link, source, context…" }, -}; -const emptyRecord = (): WorkspaceRecord => ({ id: makeId(), title: "", category: "", status: "Not started", date: "", number1: null, number2: null, details: "", notes: "" }); -const validStatus = (value: unknown): RecordStatus => STATUS_OPTIONS.includes(value as RecordStatus) ? value as RecordStatus : "Not started"; -function sanitizeRecord(value: unknown): WorkspaceRecord | null { - if (!isRecord(value)) return null; - const numeric = (v: unknown) => typeof v === "number" && Number.isFinite(v) ? v : null; - return { id: toId(value.id), title: toText(value.title, 200), category: toText(value.category, 100), status: validStatus(value.status), date: toDate(value.date), number1: numeric(value.number1), number2: numeric(value.number2), details: toText(value.details, 12000), notes: toText(value.notes, 12000), semester: typeof value.semester === "string" && ["2","3","4","5","6","7","8"].includes(value.semester) ? value.semester : "" }; -} -function loadModuleStore(key: string): { store: ModuleStore; notice: string | null } { - try { - const raw = window.localStorage.getItem(key); - if (!raw) return { store: { version: 1, records: [] }, notice: null }; - const parsed: unknown = JSON.parse(raw); - if (!isRecord(parsed) || !Array.isArray(parsed.records)) throw new Error("Invalid stored module data"); - const records = parsed.records.slice(0, 1000).map(sanitizeRecord).filter((r): r is WorkspaceRecord => r !== null); - return { store: { version: 1, records }, notice: null }; - } catch { - return { store: { version: 1, records: [] }, notice: "Saved module data could not be loaded. A fresh list is shown; your original browser storage has not been overwritten yet." }; - } -} -function RecordForm({ moduleId, record, onSave, onCancel }: { moduleId: Exclude; record: WorkspaceRecord | null; onSave: (value: WorkspaceRecord) => void; onCancel: () => void }) { - const config = MODULE_SETTINGS[moduleId]; - const [value, setValue] = useState(record ?? emptyRecord()); - const [error, setError] = useState(""); - const setField = (field: keyof WorkspaceRecord, next: string | number | null) => setValue((prev) => ({ ...prev, [field]: next } as WorkspaceRecord)); - return
{ e.preventDefault(); if (!value.title.trim()) { setError(`Enter ${config.itemLabel.toLowerCase()}.`); return; } if (moduleId === "backlogs" && !value.semester) { setError("Select the semester for this backlog."); return; } if (moduleId === "attendance" && ((value.number1 ?? 0) < (value.number2 ?? 0) || !Number.isInteger(value.number1 ?? 0) || !Number.isInteger(value.number2 ?? 0))) { setError("Enter whole class counts and ensure attended classes do not exceed total classes held."); return; } if (moduleId === "backlogs" && value.number1 !== null && (!Number.isInteger(value.number1) || value.number1 < 0)) { setError("Attempts must be a whole number."); return; } if (moduleId === "planner" && value.number1 !== null && (!Number.isInteger(value.number1) || value.number1 < 1 || value.number1 > 5)) { setError("Priority must be between 1 and 5."); return; } if (moduleId === "projects" && value.number1 !== null && (value.number1 < 0 || value.number1 > 100)) { setError("Progress must be between 0 and 100."); return; } onSave({ ...value, title: value.title.trim(), category: value.category.trim() }); }}> -

{record ? "Edit entry" : "Add entry"}

-
- { setField("title", e.target.value); setError(""); }} placeholder={config.itemLabel} /> - - {moduleId === "backlogs" && } - {moduleId !== "knowledge" && } - setField("date", e.target.value)} /> - {config.number1Label && setField("number1", e.target.value === "" ? null : Number(e.target.value))} />} - {config.number2Label && setField("number2", e.target.value === "" ? null : Number(e.target.value))} />} -
-