Index: backend/controllers/forumController.js
===================================================================
--- backend/controllers/forumController.js	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ backend/controllers/forumController.js	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -180,4 +180,5 @@
   const { id } = req.params;
   const userId = req.user.sub;
+  console.log(userId);
 
   try {
Index: backend/controllers/taskController.js
===================================================================
--- backend/controllers/taskController.js	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ backend/controllers/taskController.js	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -1,47 +1,25 @@
 const { get } = require("http");
 const prisma = require("../lib/prisma");
-
-const getTaskByDate = async (req, res) => {
-  try {
-    const now = new Date();
-
-    const year = now.getUTCFullYear();
-    const month = now.getUTCMonth();
-    const day = now.getUTCDate();
-
-    let effectiveDay = day;
-    if (now.getUTCHours() < 7) {
-      effectiveDay = day - 1;
-    }
-
-    const startOfEffectiveDay = new Date(
-      Date.UTC(year, month, effectiveDay, 0, 0, 0, 0)
-    );
-
-    const startOfNextDay = new Date(startOfEffectiveDay);
-    startOfNextDay.setUTCDate(startOfEffectiveDay.getUTCDate() + 1);
-
-    // console.log(
-    //   "Querying between (UTC dates):",
-    //   startOfEffectiveDay.toISOString(),
-    //   "and",
-    //   startOfNextDay.toISOString()
-    // );
-
-    let tasks = await prisma.challenges.findMany({
-      where: {
-        solving_date: {
-          gte: startOfEffectiveDay,
-          lt: startOfNextDay,
-        },
-        expired: false,
-      },
-      include: {
-        test_cases: true,
-      },
-    });
-    if (tasks.length === 0) {
-      return res.status(404).json({ message: "No tasks found for this date" });
-    }
+const verifyModeratorStatus = require("../services/checkModeratorStatus");
+const getAllTasks = async (req, res) => {
+  const userId = req.user.sub;
+
+  try {
+    const isModerator = await verifyModeratorStatus(userId);
+    if (!isModerator) {
+      return res.status(403).json({ message: "Access denied" });
+    }
+    const page = parseInt(req.query.page) || 1;
+    const pageSize = parseInt(req.query.pageSize) || 10;
+
+    const [challenges, total] = await Promise.all([
+      prisma.challenges.findMany({
+        include: { test_cases: true },
+        orderBy: { solving_date: "desc" },
+        skip: (page - 1) * pageSize,
+        take: pageSize,
+      }),
+      prisma.challenges.count(),
+    ]);
 
     const safeSerialize = (data) => {
@@ -59,4 +37,91 @@
     };
 
+    const processedChallenges = challenges.map((challenge) => {
+      const safeChallenge = safeSerialize(challenge);
+      if (safeChallenge.test_cases) {
+        safeChallenge.test_cases = safeChallenge.test_cases.map((testCase) => ({
+          id: testCase.id,
+          input: testCase.input,
+          output: testCase.output,
+          challenge_id: testCase.challenge_id,
+        }));
+      }
+      return safeChallenge;
+    });
+
+    res.status(200).json({
+      challenges: processedChallenges,
+      total,
+      totalPages: Math.ceil(total / pageSize),
+      currentPage: page,
+      pageSize,
+    });
+  } catch (error) {
+    console.error("Error fetching all challenges:", error);
+    res.status(500).json({
+      message: "Internal server error",
+      error: error.message,
+      stack: process.env.NODE_ENV === "development" ? error.stack : undefined,
+    });
+  }
+};
+
+const getTaskByDate = async (req, res) => {
+  try {
+    const now = new Date();
+
+    const year = now.getUTCFullYear();
+    const month = now.getUTCMonth();
+    const day = now.getUTCDate();
+
+    let effectiveDay = day;
+    if (now.getUTCHours() < 7) {
+      effectiveDay = day - 1;
+    }
+
+    const startOfEffectiveDay = new Date(
+      Date.UTC(year, month, effectiveDay, 0, 0, 0, 0)
+    );
+
+    const startOfNextDay = new Date(startOfEffectiveDay);
+    startOfNextDay.setUTCDate(startOfEffectiveDay.getUTCDate() + 1);
+
+    // console.log(
+    //   "Querying between (UTC dates):",
+    //   startOfEffectiveDay.toISOString(),
+    //   "and",
+    //   startOfNextDay.toISOString()
+    // );
+
+    let tasks = await prisma.challenges.findMany({
+      where: {
+        solving_date: {
+          gte: startOfEffectiveDay,
+          lt: startOfNextDay,
+        },
+        expired: false,
+      },
+      include: {
+        test_cases: true,
+      },
+    });
+    if (tasks.length === 0) {
+      return res.status(404).json({ message: "No tasks found for this date" });
+    }
+
+    const safeSerialize = (data) => {
+      return JSON.parse(
+        JSON.stringify(data, (key, value) => {
+          if (value instanceof Date) {
+            return value.toISOString();
+          }
+          if (typeof value === "bigint") {
+            return value.toString();
+          }
+          return value;
+        })
+      );
+    };
+
     const processedTasks = tasks.map((task) => {
       const safeTask = safeSerialize(task);
@@ -139,4 +204,32 @@
   } catch (error) {
     console.error("Error fetching specific test case by ID:", error);
+    res
+      .status(500)
+      .json({ message: "Internal server error", error: error.message });
+  }
+};
+
+const getAllTestCasesForTask = async (req, res) => {
+  const { taskId } = req.params;
+  try {
+    const testCases = await prisma.test_cases.findMany({
+      where: { challenge_id: taskId },
+      select: {
+        id: true,
+        input: true,
+        output: true,
+        challenge_id: true,
+      },
+    });
+
+    if (testCases.length === 0) {
+      return res
+        .status(404)
+        .json({ message: "No test cases found for this task" });
+    }
+
+    res.status(200).json(testCases);
+  } catch (error) {
+    console.error("Error fetching all test cases for task:", error);
     res
       .status(500)
@@ -379,4 +472,39 @@
   }
 };
+
+const deleteTask = async (req, res) => {
+  const { id } = req.params;
+  const userId = req.user.sub;
+
+  try {
+    const isModeratorOrAdmin = await verifyModeratorStatus(userId);
+
+    if (isModeratorOrAdmin) {
+      await prisma.test_cases.deleteMany({
+        where: { challenge_id: id },
+      });
+
+      await prisma.challenges.delete({
+        where: { id },
+      });
+
+      res.status(200).json({
+        message: "Challenge and associated test cases deleted successfully",
+      });
+    } else {
+      res.status(403).json({
+        message: "You do not have permission to delete this challenge",
+      });
+    }
+  } catch (error) {
+    console.error("Error deleting challenge:", error);
+    res.status(500).json({
+      message: "Internal server error",
+      error: error.message,
+      stack: process.env.NODE_ENV === "development" ? error.stack : undefined,
+    });
+  }
+};
+
 module.exports = {
   getTaskByDate,
@@ -385,3 +513,6 @@
   fetchTestCaseForToday,
   evaluateTask,
-};
+  getAllTasks,
+  getAllTestCasesForTask,
+  deleteTask,
+};
Index: backend/routers/taskRouter.js
===================================================================
--- backend/routers/taskRouter.js	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ backend/routers/taskRouter.js	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -3,6 +3,8 @@
 const taskController = require("../controllers/taskController");
 
+router.get("/all", taskController.getAllTasks);
 router.get("/", taskController.getTaskByDate);
 router.get("/:id/test-case", taskController.fetchTestCaseForToday);
+router.get("/:id/test-cases", taskController.getAllTestCasesForTask);
 router.get("/test-cases/:testCaseId", taskController.getSpecificTestCaseById);
 router.put(
@@ -13,3 +15,5 @@
 router.post("/:id/evaluate", taskController.evaluateTask);
 
+router.delete("/:id", taskController.deleteTask);
+
 module.exports = router;
Index: client/src/App.jsx
===================================================================
--- client/src/App.jsx	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ client/src/App.jsx	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -13,5 +13,5 @@
 import DashboardLayout from "./Dashboard/DashboardLayout";
 import Logout from "./Dashboard/components/Logout";
-
+import ManageChallenges from "./Dashboard/components/ManageChallenges";
 export default function App() {
   return (
@@ -39,4 +39,5 @@
         <Route path="profile" element={<Profile />} />
         <Route path="leaderboard" element={<LeaderBoardEx />} />
+        <Route path="manage-challenges" element={<ManageChallenges />} />
       </Route>
     </Routes>
Index: client/src/Dashboard/components/ManageChallenges.jsx
===================================================================
--- client/src/Dashboard/components/ManageChallenges.jsx	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
+++ client/src/Dashboard/components/ManageChallenges.jsx	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -0,0 +1,187 @@
+import React, { useEffect, useState } from "react";
+import { getAllTasks, deleteTask } from "@/services/taskService";
+import { useAuth } from "@/contexts/AuthContext";
+const PAGE_SIZE = 10;
+
+const ManageChallenges = () => {
+  const [challenges, setChallenges] = useState([]);
+  const [currentPage, setCurrentPage] = useState(1);
+  const [totalPages, setTotalPages] = useState(1);
+  const [loading, setLoading] = useState(false);
+  const [expandedChallenge, setExpandedChallenge] = useState(null);
+  const { user } = useAuth();
+  useEffect(() => {
+    const fetchChallenges = async () => {
+      setLoading(true);
+      try {
+        const data = await getAllTasks(currentPage, PAGE_SIZE);
+        setChallenges(data.challenges);
+        console.log("Fetched challenges:", data.challenges);
+        setTotalPages(data.totalPages);
+      } catch (err) {
+        console.error("Failed to fetch challenges:", err);
+      } finally {
+        setLoading(false);
+      }
+    };
+    fetchChallenges();
+  }, [currentPage]);
+  const fetchTestCases = async (challengeId) => {
+    try {
+      setExpandedChallenge(
+        expandedChallenge === challengeId ? null : challengeId
+      );
+    } catch (err) {
+      console.error(
+        `Failed to fetch test cases for challenge ${challengeId}:`,
+        err
+      );
+    }
+  };
+
+  const deleteChallenge = async (challengeId) => {
+    try {
+      setLoading(true);
+      console.log(challengeId);
+      await deleteTask(challengeId);
+      setChallenges(
+        challenges.filter((challenge) => challenge.id !== challengeId)
+      );
+      console.log(`Challenge ${challengeId} deleted successfully.`);
+    } catch (err) {
+      console.error(`Failed to delete challenge ${challengeId}:`, err);
+    } finally {
+      setLoading(false);
+    }
+  };
+
+  return (
+    <div className="container mx-auto max-w-4xl p-6">
+      <div className="flex items-center justify-between mb-8">
+        <h1 className="text-3xl font-bold">Manage Challenges</h1>
+        <button className="btn border-amber-400 gap-2">
+          <svg
+            xmlns="http://www.w3.org/2000/svg"
+            className="w-5 h-5"
+            viewBox="0 0 24 24"
+            fill="none"
+            stroke="currentColor"
+            strokeWidth="2"
+          >
+            <path d="M12 5v14M5 12h14" />
+          </svg>
+          Add New Challenge
+        </button>
+      </div>
+
+      {loading ? (
+        <div className="flex justify-center items-center h-64">
+          <span className="loading loading-spinner loading-lg"></span>
+        </div>
+      ) : (
+        <div className="space-y-6">
+          {challenges.map((challenge) => (
+            <div key={challenge.id} className="card bg-base-200 shadow-md">
+              <div className="card-body">
+                <div className="flex justify-between items-center">
+                  <h2 className="card-title text-xl font-bold">
+                    {challenge.title
+                      .split("-")
+                      .map(
+                        (word) => word.charAt(0).toUpperCase() + word.slice(1)
+                      )
+                      .join(" ")}
+                  </h2>
+                  <div className="badge badge-tertiary p-4">
+                    {new Date(challenge.solving_date).toLocaleDateString()}
+                  </div>
+                </div>
+
+                <p className="text-base-content/80 mt-2 line-clamp-2">
+                  {challenge.content}
+                </p>
+
+                {challenge.examples && challenge.examples.length > 0 && (
+                  <div className="mt-4 card bg-base-300 p-3">
+                    <h3 className="font-medium mb-2">Examples:</h3>
+                    <div className="space-y-3">
+                      {challenge.examples.map((example, index) => (
+                        <div key={index} className="font-mono text-sm">
+                          <p className="pl-2 border-l-2 border-amber-400 mt-1">
+                            Input: "{example.input || "N/A"}" <br />
+                            Output: "{example.output || "N/A"}"
+                          </p>
+                        </div>
+                      ))}
+                    </div>
+                  </div>
+                )}
+
+                <div className="card-actions justify-between mt-4">
+                  <button
+                    className="btn btn-sm btn-teritary"
+                    onClick={() => fetchTestCases(challenge.id)}
+                  >
+                    {expandedChallenge === challenge.id
+                      ? "Hide Test Cases"
+                      : "Show Test Cases"}
+                  </button>
+
+                  <button
+                    className="btn btn-sm btn-error btn-outline"
+                    onClick={() => deleteChallenge(challenge.id)}
+                  >
+                    Delete
+                  </button>
+                </div>
+                {expandedChallenge === challenge.id && challenge.test_cases && (
+                  <div className="mt-4 card bg-base-300 p-3">
+                    <h3 className="font-medium mb-2">Test Cases:</h3>
+                    <div className="space-y-4 max-h-60 overflow-y-auto">
+                      {challenge.test_cases.map((testCase, index) => (
+                        <div key={testCase.id} className="card bg-base-100 p-3">
+                          <h4 className="font-medium">Test Case {index + 1}</h4>
+                          <div className="font-mono text-sm">
+                            <div className="pl-2 border-l-2 border-amber-400 mt-1">
+                              <p>Input:</p>
+                              <pre className="bg-base-300 p-1 rounded">
+                                {testCase.input || "N/A"}
+                              </pre>
+                            </div>
+                            <div className="pl-2 border-l-2 border-green-400 mt-2">
+                              <p>Expected Output:</p>
+                              <pre className="bg-base-300 p-1 rounded">
+                                {testCase.output || "N/A"}
+                              </pre>
+                            </div>
+                          </div>
+                        </div>
+                      ))}
+                    </div>
+                  </div>
+                )}
+              </div>
+            </div>
+          ))}
+        </div>
+      )}
+
+      <div className="flex justify-center gap-2 mt-8">
+        {Array.from({ length: totalPages }, (_, idx) => (
+          <button
+            key={idx + 1}
+            className={`btn btn-sm ${
+              currentPage === idx + 1 ? "border-amber-400" : "btn-ghost"
+            }`}
+            onClick={() => setCurrentPage(idx + 1)}
+            disabled={loading}
+          >
+            {idx + 1}
+          </button>
+        ))}
+      </div>
+    </div>
+  );
+};
+
+export default ManageChallenges;
Index: client/src/Dashboard/components/Navbar.jsx
===================================================================
--- client/src/Dashboard/components/Navbar.jsx	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ client/src/Dashboard/components/Navbar.jsx	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -24,5 +24,17 @@
       return true;
     }
-    if (path !== "/dashboard" && location.pathname.startsWith(path)) {
+    if (
+      path === "/dashboard/manage-posts" &&
+      location.pathname === "/dashboard/manage-posts"
+    ) {
+      return true;
+    }
+    if (
+      path === "/dashboard/manage-challenges" &&
+      location.pathname === "/dashboard/manage-challenges"
+    ) {
+      return true;
+    }
+    if (path !== "/dashboard" && location.pathname.startsWith(path + "/")) {
       return true;
     }
@@ -111,30 +123,72 @@
           </li>
           {user && user.isModerator && (
-            <li>
-              <button
-                className={`flex items-center gap-4 px-4 py-3 rounded-lg transition-colors ${
-                  isActive("/dashboard/manage-posts")
-                    ? "bg-[#FFB800] text-black"
-                    : "hover:bg-[#FFB800] hover:text-black"
-                }`}
-                onClick={() => navigate("/dashboard/manage-posts")}
-              >
-                <svg
-                  xmlns="http://www.w3.org/2000/svg"
-                  className="w-5 h-5"
-                  viewBox="0 0 24 24"
-                  fill="none"
-                  stroke="currentColor"
-                  strokeWidth="2"
+            <>
+              <li>
+                <button
+                  className={`flex items-center gap-4 px-4 py-3 rounded-lg transition-colors ${
+                    isActive("/dashboard/manage-posts")
+                      ? "bg-[#FFB800] text-black"
+                      : "hover:bg-[#FFB800] hover:text-black"
+                  }`}
+                  onClick={() => navigate("/dashboard/manage-posts")}
                 >
-                  <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
-                  <line x1="3" y1="9" x2="21" y2="9"></line>
-                  <line x1="3" y1="15" x2="21" y2="15"></line>
-                  <line x1="9" y1="3" x2="9" y2="21"></line>
-                  <line x1="15" y1="3" x2="15" y2="21"></line>
-                </svg>
-                Manage Posts
-              </button>
-            </li>
+                  <svg
+                    xmlns="http://www.w3.org/2000/svg"
+                    className="w-5 h-5"
+                    viewBox="0 0 24 24"
+                    fill="none"
+                    stroke="currentColor"
+                    strokeWidth="2"
+                  >
+                    <rect
+                      x="3"
+                      y="3"
+                      width="18"
+                      height="18"
+                      rx="2"
+                      ry="2"
+                    ></rect>
+                    <line x1="3" y1="9" x2="21" y2="9"></line>
+                    <line x1="3" y1="15" x2="21" y2="15"></line>
+                    <line x1="9" y1="3" x2="9" y2="21"></line>
+                    <line x1="15" y1="3" x2="15" y2="21"></line>
+                  </svg>
+                  Manage Posts
+                </button>
+              </li>
+              <li>
+                <button
+                  className={`flex items-center gap-4 px-4 py-3 rounded-lg transition-colors ${
+                    isActive("/dashboard/manage-challenges")
+                      ? "bg-[#FFB800] text-black"
+                      : "hover:bg-[#FFB800] hover:text-black"
+                  }`}
+                  onClick={() => navigate("/dashboard/manage-challenges")}
+                >
+                  <svg
+                    xmlns="http://www.w3.org/2000/svg"
+                    className="w-5 h-5"
+                    viewBox="0 0 24 24"
+                    fill="none"
+                    stroke="currentColor"
+                    strokeWidth="2"
+                  >
+                    <rect
+                      x="3"
+                      y="3"
+                      width="18"
+                      height="18"
+                      rx="2"
+                      ry="2"
+                    ></rect>
+                    <line x1="3" y1="9" x2="21" y2="9"></line>
+                    <line x1="3" y1="15" x2="21" y2="15"></line>
+                    <line x1="9" y1="3" x2="9" y2="21"></line>
+                    <line x1="15" y1="3" x2="15" y2="21"></line>
+                  </svg>
+                  Manage Challenges
+                </button>
+              </li>
+            </>
           )}
         </ul>
Index: client/src/Dashboard/components/Task.jsx
===================================================================
--- client/src/Dashboard/components/Task.jsx	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ client/src/Dashboard/components/Task.jsx	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -351,14 +351,14 @@
                       <div className="card bg-base-300">
                         <div className="card-body">
-                          <h3 className="card-title">Example</h3>
-                          <div className="space-y-2 mt-2">
-                            {task.examples.map((element, index) => {
-                              return (
-                                <p className="font-mono break-all" key={index}>
-                                  Input: "{element.input}" → Output: "
-                                  {element.output}"
+                          <h3 className="card-title">Examples:</h3>
+                          <div className="space-y-5 mt-2">
+                            {task.examples.map((example, index) => (
+                              <div key={index} className="font-mono text-sm">
+                                <p className="pl-2 border-l-2 border-amber-400 mt-1">
+                                  Input: "{example.input || "N/A"}" <br />
+                                  Output: "{example.output || "N/A"}"
                                 </p>
-                              );
-                            })}
+                              </div>
+                            ))}
                           </div>
                         </div>
Index: client/src/services/taskService.js
===================================================================
--- client/src/services/taskService.js	(revision b5a43410502182bb6f874ac6e134fb6128fcca58)
+++ client/src/services/taskService.js	(revision 762d72bbc4e364514d242d151af8cd168b0ad685)
@@ -8,4 +8,7 @@
   return await apiClient.get(`/task/${taskId}/test-case`);
 };
+export const getAllTestCasesForTask = async (taskId) => {
+  return await apiClient.get(`/task/${taskId}/test-cases`);
+};
 export const getSpecificTestCase = async (testCaseId) => {
   return await apiClient.get(`task/test-cases/${testCaseId}`);
@@ -15,4 +18,11 @@
     testCaseId,
   });
+};
+export const getAllTasks = async (page = 1, pageSize = 10) => {
+  return await apiClient.get(`/task/all?page=${page}&pageSize=${pageSize}`);
+};
+
+export const deleteTask = async (taskId) => {
+  return await apiClient.delete(`/task/${taskId}`);
 };
 
