Index: backend/ai/processRequestAi.js
===================================================================
--- backend/ai/processRequestAi.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/ai/processRequestAi.js	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -1,3 +1,3 @@
-const openai = require('./openaiClient');
+const openai = require("./openaiClient");
 
 /**
@@ -12,5 +12,5 @@
     IMPORTANT INSTRUCTIONS:
     - The forum allows content in both English and Macedonian languages
-    - Content in Macedonian about programming IS appropriate
+    - Content in Macedonian about programming excercises IS appropriate
     - The post should not contain offensive language, slurs or cussing in any language
     - The post MUST be related to programming, coding, or computer science topics
@@ -28,11 +28,11 @@
 
     const response = await openai.chat.completions.create({
-      model: 'gpt-3.5-turbo',
-      messages: [{ role: 'user', content: prompt }],
+      model: "gpt-4",
+      messages: [{ role: "user", content: prompt }],
       temperature: 0.2, // Even lower temperature for more consistent responses
     });
 
     const aiResponse = response.choices[0].message.content.trim();
-    const isAppropriate = aiResponse === 'APPROPRIATE';
+    const isAppropriate = aiResponse === "APPROPRIATE";
 
     return {
@@ -40,13 +40,13 @@
       isAppropriate,
       reason: isAppropriate
-        ? 'Content is appropriate'
-        : 'Content is not appropriate for a programming forum',
+        ? "Content is appropriate"
+        : "Content is not appropriate for a programming forum",
     };
   } catch (error) {
-    console.error('AI analysis error:', error);
+    console.error("AI analysis error:", error);
     return {
-      aiResponse: 'ERROR',
+      aiResponse: "ERROR",
       isAppropriate: true,
-      reason: 'AI analysis unavailable',
+      reason: "AI analysis unavailable",
     };
   }
Index: backend/challenges/initialChallenges.json
===================================================================
--- backend/challenges/initialChallenges.json	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/challenges/initialChallenges.json	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -469,5 +469,5 @@
   {
     "title": "frequency-deviation",
-    "description": "Given a string consisting of lowercase English letters, we define the frequency deviation of a substring as the difference between the maximum and the minimum frequencies of the characters in that substring.\n\nA substring of a string is formed by any contiguous segment of the string. For example, given \"bbacccc\", the character appearing most frequently is 'c' with $4$ occurrences. The character that appears the fewest times is 'a' with $1$ occurrence. The frequency deviation of the entire string is $4 - 1 = 3$.\n\nGiven a string, $s$, representing the input string, find the maximum possible frequency deviation of any of its substrings.",
+    "description": "Given a string consisting of lowercase English letters, we define the frequency deviation of a substring as the difference between the maximum and the minimum frequencies of the characters in that substring.\n\nA substring of a string is formed by any contiguous segment of the string. For example, given \"bbacccc\", the character appearing most frequently is 'c' with 4 occurrences. The character that appears the fewest times is 'a' with 1 occurrence. The frequency deviation of the entire string is 4 - 1 = 3.\n\nGiven a string, s, representing the input string, find the maximum possible frequency deviation of any of its substrings.",
     "examples": [
       {
Index: backend/controllers/forumController.js
===================================================================
--- backend/controllers/forumController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/controllers/forumController.js	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -30,4 +30,5 @@
         authorId,
         authorName,
+        dateCreated: new Date(),
       });
 
@@ -308,5 +309,4 @@
   const userId = req.user.sub;
   try {
-    // First get the comment to find its post_id
     const comment = await prisma.comments.findUnique({
       where: { id: commentId },
@@ -327,10 +327,8 @@
     }
 
-    // Delete the comment
     await prisma.comments.delete({
       where: { id: commentId },
     });
 
-    // Update comment count if post_id exists
     if (comment.post_id) {
       await prisma.forum_posts.update({
Index: backend/controllers/taskController.js
===================================================================
--- backend/controllers/taskController.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/controllers/taskController.js	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -322,5 +322,5 @@
           : 30;
       const totalScore = timeBonus + attemptScore + difficultyScore;
-      const userRank = getRankByPoints(totalScore + user.points);
+      const userRank = getRankByPoints(BigInt(totalScore) + user.points);
       const updatedUser = await prisma.users.update({
         where: {
Index: backend/models/ForumPost.js
===================================================================
--- backend/models/ForumPost.js	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/models/ForumPost.js	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -1,8 +1,16 @@
 class ForumPost {
-  constructor({ title, content, authorId, authorName, id, commentCount }) {
+  constructor({
+    title,
+    content,
+    authorId,
+    authorName,
+    id,
+    commentCount,
+    dateCreated,
+  }) {
     this.id = id;
     this.title = title;
     this.content = content;
-    this.date_created = new Date().toISOString(); // Set current date as default
+    this.date_created = dateCreated.toISOString() || new Date().toISOString();
     this.comment_count = commentCount;
     this.author_id = authorId;
Index: backend/supabase/functions/leaderboard/index.ts
===================================================================
--- backend/supabase/functions/leaderboard/index.ts	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ backend/supabase/functions/leaderboard/index.ts	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -1,11 +1,9 @@
-// Supabase Edge Function - leaderboard.ts
 import { serve } from "https://deno.land/std/http/server.ts";
 import { createClient } from "https://esm.sh/@supabase/supabase-js";
 import supabase from "../../../supabaseClient";
-// Cache constants
-const CACHE_DURATION = 5 * 60 * 1000; // 5 minutes
+
+const CACHE_DURATION = 5 * 60 * 1000;
 const PAGE_SIZE = 20;
 
-// Type for stored data
 type CacheEntry = {
   data: any;
@@ -14,5 +12,4 @@
 
 serve(async (req: Request): Promise<Response> => {
-  // Handle CORS preflight
   if (req.method === "OPTIONS") {
     return new Response(null, {
@@ -52,5 +49,4 @@
     const cacheKey = `leaderboard:${page}-${limit}`;
 
-    // Open KV store
     const kv = await Deno.openKv();
 
@@ -63,4 +59,5 @@
       now - cacheResult.value.timestamp < CACHE_DURATION
     ) {
+      console.log("entered");
       return new Response(
         JSON.stringify({ ...cacheResult.value.data, cached: true }),
@@ -70,21 +67,10 @@
             "Content-Type": "application/json",
             "Access-Control-Allow-Origin": "*",
-            "Cache-Control": "max-age=300", // Allow browser caching for 5 minutes
+            "Cache-Control": "max-age=300",
           },
         }
       );
     }
-
-    // Load env variables
-    // const supabaseUrl = Deno.env.get('SUPABASE_URL');
-    // const supabaseServiceKey = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY');
-
-    // if (!supabaseUrl || !supabaseServiceKey) {
-    //   throw new Error('Missing Supabase env variables');
-    // }
-
-    // const supabase = createClient(supabaseUrl, supabaseServiceKey);
-
-    // Pagination
+    console.log("not entered");
     const offset = (page - 1) * limit;
     const { data, error, count } = await supabase
Index: client/src/Dashboard/components/Forum.jsx
===================================================================
--- client/src/Dashboard/components/Forum.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ client/src/Dashboard/components/Forum.jsx	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -48,8 +48,16 @@
     try {
       await deleteForumPost(postId);
-      setPosts((prevPosts) => prevPosts.filter((post) => post.id !== postId));
       console.log("Post deleted successfully");
+
+      setLoading(true);
+      const data = await getForumPosts(0, postsPerPage);
+      setPosts(data);
+      setPage(0);
+      setHasMore(data.length >= postsPerPage);
+      setLoading(false);
     } catch (error) {
       console.error("Error deleting post:", error);
+
+      setLoading(false);
     }
   };
@@ -126,5 +134,4 @@
                       className="mt-4 flex justify-end"
                       onClick={(e) => {
-                        // Prevent clicking the post if the delete button was clicked
                         navigate(`/dashboard/forum-detail/${post.id}`, {
                           state: { post },
Index: client/src/Dashboard/components/Task.jsx
===================================================================
--- client/src/Dashboard/components/Task.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ client/src/Dashboard/components/Task.jsx	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -247,5 +247,5 @@
                 </div>
                 <h1 className="card-title text-4xl font-bold mb-6">
-                  Task for {today}
+                  Challenge for {today}
                 </h1>
                 <div className="divider"></div>
@@ -276,5 +276,5 @@
                       ></path>
                     </svg>
-                    <span>The task will be available for 24 hours</span>
+                    <span>The challenge will be available for 24 hours</span>
                   </div>
                 </div>
Index: client/src/LandingPage/components/LeaderBoardEx.jsx
===================================================================
--- client/src/LandingPage/components/LeaderBoardEx.jsx	(revision 6de5862002d17cb5a0ae2c2b77b12b173b2c1978)
+++ client/src/LandingPage/components/LeaderBoardEx.jsx	(revision f8f7409a427c52f39dffa0dafa25aed552a6c66e)
@@ -1,6 +1,6 @@
-import Navbar from '@/Dashboard/components/Navbar';
-import { useEffect, useState } from 'react';
-import { useLocation } from 'react-router-dom';
-import RankBadge from '../../utils/RankBadge';
+import Navbar from "@/Dashboard/components/Navbar";
+import { useEffect, useState } from "react";
+import { useLocation } from "react-router-dom";
+import RankBadge from "../../utils/RankBadge";
 
 const LeaderBoardEx = () => {
@@ -15,7 +15,7 @@
 
   useEffect(() => {
-    if (location.pathname === '/') {
+    if (location.pathname === "/") {
       setLanding(true);
-    } else if (location.pathname === '/dashboard/leaderboard') {
+    } else if (location.pathname === "/dashboard/leaderboard") {
       setLanding(false);
     }
@@ -24,4 +24,5 @@
   // Function to fetch leaderboard data
   const fetchLeaderboard = async (page = 1, append = false) => {
+    console.log("entered from leaderboard.jsx");
     try {
       if (append) {
@@ -38,7 +39,7 @@
         }/functions/v1/leaderboard?page=${page}&limit=20`,
         {
-          method: 'GET',
+          method: "GET",
           headers: {
-            'Content-Type': 'application/json',
+            "Content-Type": "application/json",
             Authorization: `Bearer ${import.meta.env.VITE_SUPABASE_ANON_KEY}`,
           },
@@ -53,5 +54,5 @@
 
       if (data.error) {
-        throw new Error(data.message || 'Failed to fetch leaderboard');
+        throw new Error(data.message || "Failed to fetch leaderboard");
       }
 
@@ -65,5 +66,5 @@
       setPagination(data.pagination);
     } catch (err) {
-      console.error('Error fetching leaderboard:', err);
+      console.error("Error fetching leaderboard:", err);
       setError(err.message);
     } finally {
@@ -93,8 +94,5 @@
   if (loading && leaderboard.length === 0) {
     return (
-      <div
-        data-theme="luxury"
-        className="min-h-screen flex bg-base-100"
-      >
+      <div data-theme="luxury" className="min-h-screen flex bg-base-100">
         {!landing ? <Navbar /> : null}
         <div className="flex w-full flex-col justify-center items-center p-20 gap-10">
@@ -108,8 +106,5 @@
   if (error && leaderboard.length === 0) {
     return (
-      <div
-        data-theme="luxury"
-        className="min-h-screen flex bg-base-100"
-      >
+      <div data-theme="luxury" className="min-h-screen flex bg-base-100">
         {!landing ? <Navbar /> : null}
         <div className="flex w-full flex-col justify-center items-center p-20 gap-10">
@@ -130,8 +125,5 @@
 
   return (
-    <div
-      data-theme="luxury"
-      className="min-h-screen flex bg-base-100"
-    >
+    <div data-theme="luxury" className="min-h-screen flex bg-base-100">
       {!landing ? <Navbar /> : null}
 
@@ -191,5 +183,5 @@
           <button
             className={`btn btn-lg ${
-              loadingMore ? 'btn-disabled' : 'btn-primary'
+              loadingMore ? "btn-disabled" : "btn-primary"
             }`}
             onClick={handleLoadMore}
@@ -202,5 +194,5 @@
               </>
             ) : (
-              'Load More'
+              "Load More"
             )}
           </button>
