Index: backend/controllers/apiController.js
===================================================================
--- backend/controllers/apiController.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/controllers/apiController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -14,5 +14,5 @@
       return res.status(400).json({
         message: "Validation failed",
-        errors: valErrors, // Send back the specific errors
+        errors: valErrors,
         success: false,
       });
@@ -43,4 +43,5 @@
 
     try {
+      //Check if you can store isModerator in metadata to be refreneced in delete functions!
       const { data: authUser, error: authError } =
         await supabase.auth.admin.createUser({
@@ -48,5 +49,5 @@
           password,
           user_metadata: { username, name },
-          email_confirm: true,
+          // email_confirm: true,
         });
 
@@ -75,9 +76,9 @@
       );
       if (error && error.field) {
-        fieldErrors[error.field] = error.message; // fieldErrors becomes { username: "Username already in use" }
+        fieldErrors[error.field] = error.message;
         errorMessage = "Registration failed. Please check the details.";
         res.status(400).json({
           message: errorMessage,
-          errors: Object.keys(fieldErrors).length > 0 ? fieldErrors : undefined, // Sends errors: { username: "..." }
+          errors: Object.keys(fieldErrors).length > 0 ? fieldErrors : undefined,
           success: false,
         });
@@ -111,21 +112,5 @@
   try {
     const newUser = await prisma.users.create({
-      data: {
-        id: studentInstance.id,
-        username: studentInstance.username,
-        email: studentInstance.email,
-        name: studentInstance.name,
-        solved_problems: studentInstance.solvedProblems || 0,
-        points: studentInstance.points || 0,
-        rank: studentInstance.rank || "Novice",
-
-        postCounter: studentInstance.postCounter || 3,
-        postCheckCounter: studentInstance.postCheckCounter || 0,
-        isModerator: studentInstance.isModerator || false,
-        attempts: studentInstance.attempts || 0,
-        solvedDailyChallenge: studentInstance.solvedDailyChallenge || false,
-        daily_points: studentInstance.dailyPoints || 0,
-        daily_test_case_id: studentInstance.testCaseId || null,
-      },
+      data: studentInstance,
     });
     return { createdStudent: newUser, error: null };
Index: backend/controllers/forumController.js
===================================================================
--- backend/controllers/forumController.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/controllers/forumController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -12,5 +12,9 @@
 const createForumPost = async (req, res) => {
   const { title, content, authorId, authorName } = req.body;
-  console.log(title);
+  if (!title || !content || !authorId || !authorName) {
+    return res.status(400).json({
+      error: "Title, content, authorId, and authorName are required",
+    });
+  }
 
   try {
@@ -24,4 +28,5 @@
         title,
         content,
+        authorId,
         authorName,
       });
@@ -30,10 +35,8 @@
 
       if (isProfane) {
-        console.log("Profanity detected!");
         return res.status(400).json({
           error: "Content contains inappropriate language",
         });
       } else if (filter.check(post.content)) {
-        console.log("Profanity detected in content!");
         return res.status(400).json({
           error: "Content contains inappropriate language",
@@ -41,5 +44,4 @@
       } else if (post.content.length > 200) {
         try {
-          // Await the helper function
           await createReviewPost(req);
 
@@ -49,5 +51,4 @@
           });
         } catch (reviewError) {
-          // If submitPostForReview throws an error
           console.error("Error submitting post for review:", reviewError);
           return res.status(500).json({
@@ -80,10 +81,5 @@
       }
       const savedPost = await prisma.forum_posts.create({
-        data: {
-          title: post.title,
-          content: post.content,
-          author_id: authorId,
-          author_name: post.authorName,
-        },
+        data: post,
       });
 
@@ -94,8 +90,4 @@
         message: "Forum post created successfully",
         post: savedPost,
-      });
-    } else {
-      return res.status(403).json({
-        error: "You have reached your post limit for today",
       });
     }
@@ -122,39 +114,39 @@
 }
 //Dali treba?
-const createApprovedForumPost = async (req, res) => {
-  const { title, content, authorId, authorName } = req.body;
-
-  try {
-    const user = await prisma.users.findUnique({
-      where: { id: authorId },
-    });
-
-    const post = new ForumPost({
-      title,
-      content,
-      authorName,
-    });
-
-    const savedPost = await prisma.forum_posts.create({
-      data: {
-        title: post.title,
-        content: post.content,
-        author_id: authorId,
-        author_name: post.authorName,
-      },
-    });
-
-    post.id = savedPost.id;
-    await decrementPostCounter(authorId);
-
-    res.status(201).json({
-      message: "Approved post published successfully",
-      post: savedPost,
-    });
-  } catch (err) {
-    console.error("Server error:", err);
-    res.status(500).json({ error: "Internal server error" });
-  }
-};
+// const createApprovedForumPost = async (req, res) => {
+//   const { title, content, authorId, authorName } = req.body;
+
+//   try {
+//     const user = await prisma.users.findUnique({
+//       where: { id: authorId },
+//     });
+
+//     const post = new ForumPost({
+//       title,
+//       content,
+//       authorName,
+//     });
+
+//     const savedPost = await prisma.forum_posts.create({
+//       data: {
+//         title: post.title,
+//         content: post.content,
+//         author_id: authorId,
+//         author_name: post.authorName,
+//       },
+//     });
+
+//     post.id = savedPost.id;
+//     await decrementPostCounter(authorId);
+
+//     res.status(201).json({
+//       message: "Approved post published successfully",
+//       post: savedPost,
+//     });
+//   } catch (err) {
+//     console.error("Server error:", err);
+//     res.status(500).json({ error: "Internal server error" });
+//   }
+// };
 
 const getForumPosts = async (req, res) => {
@@ -179,4 +171,5 @@
           content: post.content,
           authorName: post.author_name,
+          authorId: post.author_id,
           dateCreated: post.date_created,
           commentCount: post.comment_count,
@@ -244,4 +237,5 @@
       authorName: authorName,
       authorId: authorId,
+      postId: post_id,
     });
     const profane = filter.check(comment.content);
@@ -254,10 +248,5 @@
 
     const savedComment = await prisma.comments.create({
-      data: {
-        post_id: post_id,
-        content: comment.content,
-        author_id: authorId,
-        author_name: comment.authorName,
-      },
+      data: comment,
     });
     await prisma.forum_posts.update({
@@ -279,6 +268,6 @@
 
 const getComments = async (req, res) => {
-  const postId = req.query.post_id;
-  console.log("Fetching comments for post_id:", postId);
+  const { postId } = req.params;
+
   if (!postId) {
     return res
@@ -370,4 +359,4 @@
 
   deleteComment,
-  createApprovedForumPost,
-};
+  // createApprovedForumPost,
+};
Index: backend/controllers/reviewController.js
===================================================================
--- backend/controllers/reviewController.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/controllers/reviewController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -19,5 +19,5 @@
         content: post.content,
         author_id: authorId,
-        author_name: post.authorName,
+        author_name: post.author_name,
       },
     });
@@ -30,5 +30,4 @@
 const getReviewPosts = async (req, res) => {
   try {
-    console.log("Fetching to be reviewed posts");
     const page = parseInt(req.query.page) || 0;
     const limit = parseInt(req.query.limit) || 5;
@@ -51,6 +50,4 @@
       });
 
-      console.log("Found review posts:", posts.length);
-
       const forumPosts = posts.map(
         (post) =>
@@ -64,6 +61,4 @@
           })
       );
-
-      console.log("Formatted posts:", forumPosts.length);
 
       res.status(200).json(forumPosts);
@@ -89,5 +84,4 @@
   }
   try {
-    // Delete using Prisma
     await prisma.to_be_reviewed.delete({
       where: { id },
@@ -96,5 +90,4 @@
     res.status(204).send();
   } catch (err) {
-    // Prisma throws when record not found
     if (err.code === "P2025") {
       return res.status(404).json({ error: "Forum post not found" });
@@ -107,5 +100,4 @@
 const approveReviewPost = async (req, res) => {
   try {
-    console.log("Approving review post", req.params.id);
     const { id } = req.params;
     const userId = req.query.userId;
Index: backend/controllers/taskController.js
===================================================================
--- backend/controllers/taskController.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/controllers/taskController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -230,5 +230,5 @@
     str
       .toString()
-      .replace(/[^\w.-]/g, "") // keep only word chars, dot and hyphen
+      .replace(/[^\w.-]/g, "")
       .trim()
       .toLowerCase();
@@ -275,5 +275,5 @@
   const { id: taskId } = req.params;
   const { userOutput, testCaseId, userId } = req.body;
-  console.log(userOutput, testCaseId, userId);
+
   try {
     if (!testCaseId || !userOutput || !userId) {
@@ -311,5 +311,5 @@
       },
     });
-    console.log(task.difficulty);
+
     if (isOutputCorrect(userOutput, testCase.output, task.output_type)) {
       const timeBonus = getTimeBonus();
@@ -322,5 +322,5 @@
           : 30;
       const totalScore = timeBonus + attemptScore + difficultyScore;
-      const userRank = getRankByPoints(totalScore);
+      const userRank = getRankByPoints(totalScore + user.points);
       const updatedUser = await prisma.users.update({
         where: {
@@ -342,5 +342,4 @@
       }
 
-      console.log("User Rank:", userRank);
       await prisma.challenges.update({
         where: { id: taskId },
Index: backend/models/Comment.js
===================================================================
--- backend/models/Comment.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/models/Comment.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -3,7 +3,8 @@
     this.id = data.id;
     this.content = data.content;
-    this.authorName = data.authorName;
+    this.author_name = data.authorName;
     this.dateCreated = new Date();
-    this.authorId = data.authorId;
+    this.author_id = data.authorId;
+    this.post_id = data.postId;
   }
 }
Index: backend/models/ForumPost.js
===================================================================
--- backend/models/ForumPost.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/models/ForumPost.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -1,11 +1,11 @@
 class ForumPost {
-  constructor(data = {}) {
-    this.id = data.id;
-    this.title = data.title;
-    this.content = data.content;
-    this.authorName = data.authorName;
-    this.dateCreated = data.dateCreated || new Date();
-    this.comments = [];
-    this.comment_count = data.commentCount || 0;
+  constructor({ title, content, authorId, authorName, id, commentCount }) {
+    this.id = id;
+    this.title = title;
+    this.content = content;
+    this.date_created = new Date().toISOString(); // Set current date as default
+    this.comment_count = commentCount;
+    this.author_id = authorId;
+    this.author_name = authorName;
   }
 }
Index: backend/models/Student.js
===================================================================
--- backend/models/Student.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/models/Student.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -4,30 +4,12 @@
   constructor(data = {}) {
     super(data);
-    this.solvedProblems = data.solvedProblems || 0;
+
+    this.solved_problems = data.solved_problems || 0;
     this.rank = data.rank || "Novice";
     this.points = data.points || 0;
-    this.commentCounter = data.commentCounter || 3;
-    this.commentCheckCounter = data.commentCheckCounter || 0;
+
     this.postCounter = data.postCounter || 3;
     this.postCheckCounter = data.postCheckCounter || 0;
   }
-  // toJSON() {
-  //   return {
-  //     id: this.id,
-  //     username: this.username,
-  //     email: this.email,
-  //     name: this.name,
-  //     solvedProblems: this.solvedProblems,
-  //     rank: this.rank,
-  //     points: this.points,
-  //     commentCounter: this.commentCounter,
-  //     commentCheckCounter: this.commentCheckCounter,
-  //     postCounter: this.postCounter,
-  //     postCheckCounter: this.postCheckCounter,
-  //     isModerator: this.isModerator,
-  //     dailyPoints: this.dailyPoints,
-  //     testCaseId: this.testCaseId,
-  //   };
-  // }
 }
 
Index: backend/models/User.js
===================================================================
--- backend/models/User.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/models/User.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -7,6 +7,8 @@
     this.email = data.email;
     this.attempts = data.attempts || 0;
-    this.dailyPoints = data.dailyPoints || 0;
-    this.testCaseId = data.testCaseId || null;
+    this.solvedDailyChallenge = data.solvedDailyChallenge || false;
+
+    this.daily_points = data.daily_points || 0;
+    this.daily_test_case_id = data.daily_test_case_id || null;
   }
 
@@ -58,14 +60,4 @@
     return Object.keys(errors).length > 0 ? errors : null;
   }
-
-  // toJSON() {
-  //   return {
-  //     id: this.id,
-  //     username: this.username,
-  //     email: this.email,
-  //     isModerator: this.isModerator,
-
-  //   };
-  // }
 }
 
Index: backend/routers/forumRouter.js
===================================================================
--- backend/routers/forumRouter.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/routers/forumRouter.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -1,14 +1,14 @@
-const express = require('express');
+const express = require("express");
 const router = express.Router();
-const forumController = require('../controllers/forumController');
+const forumController = require("../controllers/forumController");
 
-router.post('/posts', forumController.createForumPost);
-router.get('/posts', forumController.getForumPosts);
+router.post("/posts", forumController.createForumPost);
+router.get("/posts", forumController.getForumPosts);
 
-router.delete('/posts/:id', forumController.deleteForumPost);
+router.delete("/posts/:id", forumController.deleteForumPost);
 
-router.delete('/comments/:commentId', forumController.deleteComment);
-router.post('/comments', forumController.createComment);
-router.get('/comments', forumController.getComments);
+router.delete("/comments/:commentId", forumController.deleteComment);
+router.post("/comments", forumController.createComment);
+router.get("/comments/:postId", forumController.getComments);
 
 module.exports = router;
Index: backend/scripts/dailyResets.js
===================================================================
--- backend/scripts/dailyResets.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/scripts/dailyResets.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -3,5 +3,5 @@
 
 async function dailyResets() {
-  const scriptExecutionTime = new Date(); // Time when the script actually runs
+  const scriptExecutionTime = new Date();
   console.log(
     `[${scriptExecutionTime.toISOString()}] Starting daily reset process (executed at local server time).`
Index: backend/scripts/deleteAllTestCases.js
===================================================================
--- backend/scripts/deleteAllTestCases.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/scripts/deleteAllTestCases.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -1,22 +1,21 @@
-const prisma = require('../lib/prisma');
+const prisma = require("../lib/prisma");
 
 async function deleteAllTestCases() {
   try {
-    console.log('Deleting all test cases...');
+    console.log("Deleting all test cases...");
 
     const result = await prisma.test_cases.deleteMany({});
 
-    console.log(`✅ Successfully deleted ${result.count} test cases`);
+    console.log(` Successfully deleted ${result.count} test cases`);
     return result.count;
   } catch (error) {
-    console.error('❌ Error deleting test cases:', error);
+    console.error("❌ Error deleting test cases:", error);
     throw error;
   } finally {
-    console.log('Disconnecting from database...');
+    console.log("Disconnecting from database...");
     await prisma.$disconnect();
   }
 }
 
-// Run the function
 deleteAllTestCases()
   .then((count) => {
@@ -25,5 +24,5 @@
   })
   .catch((error) => {
-    console.error('Script failed:', error);
+    console.error("Script failed:", error);
     process.exit(1);
   });
Index: backend/scripts/deleteAllUsers.js
===================================================================
--- backend/scripts/deleteAllUsers.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ backend/scripts/deleteAllUsers.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -1,24 +1,22 @@
-const supabase = require('../supabaseClient');
+const supabase = require("../supabaseClient");
 
 async function deleteAllUsers() {
-  // 1. Get all user IDs from the users table
   const { data: users, error: fetchError } = await supabase
-    .from('users')
-    .select('id');
+    .from("users")
+    .select("id");
   if (fetchError) {
-    console.error('Error fetching users:', fetchError);
+    console.error("Error fetching users:", fetchError);
     return;
   }
 
   if (!users || users.length === 0) {
-    console.log('No users found.');
+    console.log("No users found.");
     return;
   }
 
-  // 2. Delete users from Supabase Auth
   for (const user of users) {
     const { error: authError } = await supabase.auth.admin.deleteUser(user.id);
     if (authError) {
-      if (authError.status === 404 && authError.code === 'user_not_found') {
+      if (authError.status === 404 && authError.code === "user_not_found") {
         console.warn(`Auth user ${user.id} not found (already deleted).`);
       } else {
@@ -29,13 +27,13 @@
     }
   }
-  // 3. Delete all users from the users table
+
   const { error: tableError } = await supabase
-    .from('users')
+    .from("users")
     .delete()
-    .not('id', 'is', null);
+    .not("id", "is", null);
   if (tableError) {
-    console.error('Error deleting users from table:', tableError);
+    console.error("Error deleting users from table:", tableError);
   } else {
-    console.log('Deleted all users from users table.');
+    console.log("Deleted all users from users table.");
   }
 }
Index: client/src/CreatePost/CreatePost.jsx
===================================================================
--- client/src/CreatePost/CreatePost.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/CreatePost/CreatePost.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -7,7 +7,7 @@
   const [title, setTitle] = useState("");
   const [content, setContent] = useState("");
-  const [error, setError] = useState("");
+
   const [isSubmitting, setIsSubmitting] = useState(false);
-  const [redirectNeeded, setRedirectNeeded] = useState(false);
+
   const [modal, setModal] = useState({ isOpen: false, message: "", type: "" });
   const navigate = useNavigate();
Index: client/src/Dashboard/components/Forum.jsx
===================================================================
--- client/src/Dashboard/components/Forum.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/Dashboard/components/Forum.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -28,4 +28,5 @@
 
       const data = await getForumPosts(page, postsPerPage);
+      console.log(data);
       if (page === 0) {
         setPosts(data);
@@ -79,6 +80,6 @@
                     className="p-4 border rounded-lg shadow-sm hover:shadow-md transition  relative"
                   >
-                    {(post.authorName === user.name ||
-                      post.authorName === user.username ||
+                    {(post.author_name === user.name ||
+                      post.author_name === user.username ||
                       user.isModerator) && (
                       <button
@@ -114,6 +115,6 @@
 
                     <p className="text-m text-gray-500">
-                      By {post.authorName},{" "}
-                      <span>{post.dateCreated.split("T")[0]}</span>
+                      By {post.author_name},{" "}
+                      <span>{post.date_created?.split("T")[0]}</span>
                     </p>
                     <p className="mt-2 text-gray-400 text-xl">
Index: client/src/Dashboard/components/ForumPostDetail.jsx
===================================================================
--- client/src/Dashboard/components/ForumPostDetail.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/Dashboard/components/ForumPostDetail.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -109,5 +109,5 @@
               <div className="flex items-center gap-2 mt-2 md:mt-0">
                 <span className="badge badge-tertiary text-xs p-4 ">
-                  By {post.authorName}
+                  By {post.author_name}
                 </span>
               </div>
@@ -165,5 +165,5 @@
                                 onClick={(e) => {
                                   e.stopPropagation();
-                                  // Here you would add the delete confirmation and logic
+
                                   if (
                                     window.confirm(
@@ -171,5 +171,4 @@
                                     )
                                   ) {
-                                    // Call your delete comment function here
                                     console.log("Delete comment:", comment.id);
                                   }
@@ -185,5 +184,5 @@
                             )}
                             <span className="font-semibold text-base-content">
-                              {comment.authorName}
+                              {comment.author_name}
                             </span>
                             <span className="text-xs text-base-content/60">
Index: client/src/Dashboard/components/ManagePosts.jsx
===================================================================
--- client/src/Dashboard/components/ManagePosts.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/Dashboard/components/ManagePosts.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -1,6 +1,6 @@
 import React, { useState, useEffect } from "react";
-import { useNavigate } from "react-router-dom";
+
 import doneAll from "../../assets/images/done-all.svg";
-import trashIcon from "../../assets/images/delete.svg"; // Add this import
+import trashIcon from "../../assets/images/delete.svg";
 import Navbar from "./Navbar";
 import { useCallback } from "react";
@@ -12,5 +12,4 @@
 
 const ManagePosts = () => {
-  const navigate = useNavigate();
   const [posts, setPosts] = useState([]);
   const [page, setPage] = useState(0);
@@ -47,5 +46,4 @@
   };
   const fetchPostsData = useCallback(async () => {
-    // Renamed to avoid conflict with posts state variable
     if (!user || !user.id) {
       setError("User not found. Please log in.");
@@ -126,9 +124,7 @@
         err.response?.data?.message || err.message || "Failed to approve post."
       );
-      // Optionally show an error modal/toast
     }
   };
   const openConfirmationModal = (type, item) => {
-    // item can be postId (string) for delete, or post (object) for approve
     if (type === "delete") {
       setModal({
@@ -144,5 +140,5 @@
         message: "Are you sure you want to approve this post?",
         type: "approve",
-        postId: item.id, // Store postId for consistency if needed, but 'post' object is key
+        postId: item.id,
         post: item,
       });
@@ -200,5 +196,5 @@
                 className="p-6 border border-base-300 bg-base-200 rounded-lg shadow-sm hover:shadow-md transition relative"
               >
-                <h1>{post.title}</h1>
+                <h1 className="text-2xl font-bold mb-2">{post.title}</h1>
                 <div className="absolute top-4 right-4 flex gap-2">
                   <button
@@ -224,20 +220,9 @@
                 </div>
 
-                <h2
-                  className="text-2xl font-semibold mb-1 cursor-pointer hover:underline text-primary"
-                  onClick={() => {
-                    // For review, direct navigation to detail might not be desired
-                    // unless you have a specific review detail view.
-                    // For now, clicking title does nothing or opens a modal with full content.
-                    console.log("Post title clicked (for review):", post.title);
-                  }}
-                >
-                  {post.title}
-                </h2>
                 <p className="text-sm text-base-content/70 mb-3">
-                  By {post.authorName} on{" "}
+                  By {post.author_name} on{" "}
                   <span>
-                    {post.dateCreated
-                      ? new Date(post.dateCreated).toLocaleDateString()
+                    {post.date_created
+                      ? new Date(post.date_created).toLocaleDateString()
                       : "N/A"}
                   </span>
@@ -274,5 +259,5 @@
             {modal.type === "approve" && (
               <div className="w-8 h-8 rounded-full bg-success flex items-center justify-center">
-                <svg /* SVG for approve */
+                <svg
                   className="w-5 h-5 text-success-content"
                   fill="none"
@@ -291,5 +276,5 @@
             {modal.type === "delete" && (
               <div className="w-8 h-8 rounded-full bg-error flex items-center justify-center">
-                <svg /* SVG for delete */
+                <svg
                   className="w-5 h-5 text-error-content"
                   fill="none"
Index: client/src/Dashboard/components/Navbar.jsx
===================================================================
--- client/src/Dashboard/components/Navbar.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/Dashboard/components/Navbar.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -36,5 +36,5 @@
                 <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
               </svg>
-              Task of the Day
+              Challenge of the Day
             </button>
           </li>
Index: client/src/Dashboard/components/Task.jsx
===================================================================
--- client/src/Dashboard/components/Task.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/Dashboard/components/Task.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -9,4 +9,5 @@
   updateUserDailyTestCaseId,
 } from "@/services/taskService";
+
 const Task = () => {
   const [showTask, setShowTask] = useState(false);
@@ -16,4 +17,5 @@
   const [isCorrect, setIsCorrect] = useState(null);
   const [isSubmitting, setIsSubmitting] = useState(false);
+  const [isUserOutputEmpty, setIsUserOutputEmpty] = useState(true);
 
   const today = new Date().toLocaleDateString();
@@ -36,5 +38,4 @@
     }
   }, [currentUser]);
-  const navigate = useNavigate();
 
   useEffect(() => {
@@ -42,5 +43,5 @@
       fetchTestCaseLogic(task.id);
     }
-  }, [task, showTask]);
+  }, [task]);
 
   async function fetchTaskForToday(date) {
@@ -163,6 +164,8 @@
 
   const handleStart = () => {
-    const today = new Date();
-    fetchTaskForToday(today);
+    if (!task) {
+      const today = new Date();
+      fetchTaskForToday(today);
+    }
 
     setShowTask(true);
@@ -178,5 +181,7 @@
     try {
       const userOutput = document.getElementById("userOutput").value;
-
+      if (userOutput.trim() === "") {
+        return;
+      }
       const result = await evaluate(
         task.id,
@@ -218,4 +223,7 @@
   }
 
+  const handleGoBack = () => {
+    setShowTask(false);
+  };
   return (
     <div data-theme="luxury" className="dashboard h-screen flex bg-base-100">
@@ -392,4 +400,8 @@
                           : "Enter your output here..."
                       }
+                      onChange={(e) => {
+                        const value = e.target.value;
+                        setIsUserOutputEmpty(value.trim() === "");
+                      }}
                       className={`textarea textarea-bordered textarea-lg w-full mb-4 ${
                         isCorrect === null
@@ -432,5 +444,5 @@
                       <button
                         onClick={() => {
-                          navigate("/dashboard/forum");
+                          handleGoBack();
                         }}
                         className="btn border-amber-400 btn-lg"
@@ -447,5 +459,7 @@
                         }`}
                         disabled={
-                          currentUser.solvedDailyChallenge || isSubmitting
+                          currentUser.solvedDailyChallenge ||
+                          isSubmitting ||
+                          isUserOutputEmpty
                         }
                       >
Index: client/src/contexts/AuthContext.jsx
===================================================================
--- client/src/contexts/AuthContext.jsx	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/contexts/AuthContext.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -102,4 +102,5 @@
     }
   }, [logout]);
+
   useEffect(() => {
     const checkStaleSession = () => {
@@ -127,5 +128,5 @@
       const now = Math.floor(Date.now() / 1000);
       const expiresIn = payload.exp - now;
-
+      console.log("Token expires in:", expiresIn, "seconds");
       if (expiresIn <= 0) {
         console.warn("Token already expired, handling expiration");
@@ -176,4 +177,5 @@
         const { data } = await supabase.auth.getSession();
         const session = data?.session;
+
         if (session?.user) {
           setUser(session.user);
@@ -181,17 +183,18 @@
           setupTokenExpiryLogout(session.access_token);
         }
-        const tokenExp = localStorage.getItem("token_exp");
-        if (tokenExp) {
-          const now = Math.floor(Date.now() / 1000);
-          const expiresIn = parseInt(tokenExp) - now;
-
-          if (expiresIn <= 0) {
-            await logout();
-          } else {
-            tokenExpiryTimeoutRef.current = setTimeout(() => {
-              logout();
-            }, expiresIn * 1000);
-          }
-        }
+        //check if this is needed
+        // const tokenExp = localStorage.getItem("token_exp");
+        // if (tokenExp) {
+        //   const now = Math.floor(Date.now() / 1000);
+        //   const expiresIn = parseInt(tokenExp) - now;
+
+        //   if (expiresIn <= 0) {
+        //     await logout();
+        //   } else {
+        //     tokenExpiryTimeoutRef.current = setTimeout(() => {
+        //       logout();
+        //     }, expiresIn * 1000);
+        //   }
+        // }
       } catch (error) {
         console.error("Error retrieving session:", error);
Index: client/src/services/forumService.js
===================================================================
--- client/src/services/forumService.js	(revision 5634f940ca943e75111813314a7b9eef12ea17aa)
+++ client/src/services/forumService.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
@@ -15,5 +15,5 @@
 
 export const getCommentsForPost = (postId) => {
-  return apiClient.get(`/forum/comments?post_id=${postId}`);
+  return apiClient.get(`/forum/comments/${postId}`);
 };
 export const createComment = (commentData) => {
