Index: backend/controllers/forumController.js
===================================================================
--- backend/controllers/forumController.js	(revision f25586dfdba4538cd7064e7e0bd2162b272c75d6)
+++ backend/controllers/forumController.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
@@ -161,8 +161,6 @@
 
 const getForumPosts = async (req, res) => {
-  try {
-    console.log("Received query params:", req.query);
-    console.log("Request URL:", req.originalUrl);
-
+  console.log("BACKEND called");
+  try {
     // Extract parameters with strict type checking and debug output
     const page = req.query.page !== undefined ? parseInt(req.query.page) : 0;
@@ -172,5 +170,4 @@
     // Topic needs special handling
     const topic = req.query.topic || null;
-    console.log(`Topic parameter received: "${topic}"`);
 
     const sort = req.query.sort || null;
@@ -187,45 +184,18 @@
     // Filter by topic if provided
     if (topic && topic !== "all") {
-      try {
-        const trimmedTopic = topic.trim();
-        const dbPosts = await prisma.forum_posts.findMany({
-          where: { topic: trimmedTopic },
-          select: { id: true },
-        });
-        console.log(
-          `DIRECT DB QUERY: Found ${dbPosts.length} posts with topic "${trimmedTopic}"`
-        );
-
-        // Set the correct topic filter
-        whereCondition.topic = trimmedTopic;
-      } catch (err) {
-        console.error("Error in direct DB query:", err);
-        // Fallback to original behavior
-        whereCondition.topic = topic;
-      }
-
-      console.log("Final whereCondition.topic set to:", whereCondition.topic);
+      const trimmedTopic = topic.trim();
+
+      whereCondition.topic = trimmedTopic;
     }
 
     // Filter by specific date if provided
     if (date) {
-      console.log(`Filtering by specific date: "${date}"`);
-
-      try {
-        // Create a date object from the provided date string
-        const selectedDate = new Date(date);
-        console.log("SELECTED DATE", selectedDate);
-
-        // Ensure the date is valid
-        if (isNaN(selectedDate.getTime())) {
-          console.error(`Invalid date provided: "${date}"`);
-        } else {
-          // Set to beginning of the day (midnight)
-
-          // Add to where condition
-          whereCondition.date_created = selectedDate;
-        }
-      } catch (err) {
-        console.error(`Error processing date filter "${date}":`, err);
+      const selectedDate = new Date(date);
+
+      // Ensure the date is valid
+      if (isNaN(selectedDate.getTime())) {
+        console.error(`Invalid date provided: "${date}"`);
+      } else {
+        whereCondition.date_created = selectedDate;
       }
     }
@@ -234,5 +204,4 @@
     if (search && search.trim()) {
       const searchTerm = search.trim();
-      console.log(`Filtering by search text: "${searchTerm}"`);
 
       // Use Prisma's OR condition to search in both title and content
@@ -269,9 +238,5 @@
         Object.assign(whereCondition, searchCondition);
       }
-
-      console.log("Search condition applied:", JSON.stringify(searchCondition));
-    }
-
-    console.log("Using where condition:", JSON.stringify(whereCondition));
+    }
 
     // Determine ordering - using an array to support multiple sorting criteria
@@ -280,21 +245,13 @@
     // First, handle comment popularity sorting if specified
     if (commentSort === "most-popular") {
-      console.log("Applying MOST popular sorting");
       orderBy.push({ comment_count: "desc" });
 
       // Add date as secondary sort to make results consistent
       orderBy.push({ date_created: "desc" });
-      console.log(
-        "Added secondary date sorting (newest first) for consistency"
-      );
     } else if (commentSort === "least-popular") {
-      console.log("Applying LEAST popular sorting");
       orderBy.push({ comment_count: "asc" });
 
       // Add date as secondary sort to make results consistent
       orderBy.push({ date_created: "desc" });
-      console.log(
-        "Added secondary date sorting (newest first) for consistency"
-      );
     }
     // Only apply date sorting as primary sort if comment sorting isn't specified
@@ -302,13 +259,10 @@
       // Always apply date sorting (either as primary or secondary criterion)
       if (sort === "oldest") {
-        console.log("Applying oldest first date sorting as primary criterion");
         orderBy.push({ date_created: "asc" });
       } else {
-        console.log("Applying newest first date sorting as primary criterion");
         orderBy.push({ date_created: "desc" });
       }
     }
 
-    console.log("Final sort order:", JSON.stringify(orderBy));
     const totalCount = await prisma.forum_posts.count({
       where: whereCondition,
@@ -337,10 +291,4 @@
 
     // Enhanced debug output
-    console.log(`Returning ${forumPosts.length} posts with filters:`, {
-      whereCondition,
-      orderBy,
-      skip,
-      take,
-    });
 
     // Log topic distribution to help debug topic filtering issues
@@ -350,6 +298,4 @@
         topicsInResult[post.topic] = (topicsInResult[post.topic] || 0) + 1;
       });
-
-      console.log("TOPIC DISTRIBUTION IN RESULTS:", topicsInResult);
 
       // Check if filtering was successful
@@ -364,69 +310,4 @@
     }
 
-    // Log sorting analysis to help with debugging
-    if (forumPosts.length > 0) {
-      // Comment count analysis for popularity sort debugging
-      if (commentSort) {
-        console.log("COMMENT COUNT ANALYSIS:");
-        const counts = forumPosts.map((p) => p.comment_count);
-        console.log(
-          `- Min: ${Math.min(...counts)}, Max: ${Math.max(...counts)}`
-        );
-      }
-
-      // Date sorting and filtering analysis
-      console.log("DATE ANALYSIS:");
-      const dates = forumPosts.map((p) => new Date(p.date_created).getTime());
-
-      if (dates.length > 0) {
-        const minDate = new Date(Math.min(...dates));
-        const maxDate = new Date(Math.max(...dates));
-        console.log(
-          `- Posts date range: ${minDate.toISOString()} to ${maxDate.toISOString()}`
-        );
-
-        // If specific date filter was applied, verify it's working
-        if (date) {
-          const filterDate = new Date(date);
-          filterDate.setHours(0, 0, 0, 0);
-          const nextDay = new Date(filterDate);
-          nextDay.setDate(nextDay.getDate() + 1);
-
-          console.log(
-            `- Specific date filter: ${filterDate.toISOString()} to ${nextDay.toISOString()}`
-          );
-
-          // Check if all posts are within the filtered date range
-          const postsInRange = forumPosts.filter((p) => {
-            const postDate = new Date(p.date_created);
-            return postDate >= filterDate && postDate < nextDay;
-          });
-
-          console.log(
-            `- Posts matching date filter: ${postsInRange.length}/${forumPosts.length}`
-          );
-
-          if (postsInRange.length < forumPosts.length) {
-            console.warn(
-              "⚠️ WARNING: Some posts do not match the date filter!"
-            );
-          }
-        }
-      } else {
-        console.log("- No posts to analyze dates");
-      }
-
-      // First three posts details
-      console.log(
-        `FIRST THREE POSTS:`,
-        forumPosts.slice(0, 3).map((p) => ({
-          id: p.id,
-          topic: p.topic,
-          comments: p.comment_count,
-          date: new Date(p.date_created).toISOString().split("T")[0],
-        }))
-      );
-    }
-
     // Set cache control headers to prevent caching
     res.set("Cache-Control", "no-store, no-cache, must-revalidate, private");
@@ -439,9 +320,4 @@
     res.set("X-Filter-Applied", JSON.stringify(whereCondition));
     res.set("X-Sort-Order", JSON.stringify(orderBy));
-
-    console.log(
-      `RESPONSE: Sending ${forumPosts.length} posts with filter:`,
-      whereCondition
-    );
 
     res.status(200).json({ forumPosts, totalCount });
Index: backend/routers/forumRouter.js
===================================================================
--- backend/routers/forumRouter.js	(revision f25586dfdba4538cd7064e7e0bd2162b272c75d6)
+++ backend/routers/forumRouter.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
@@ -2,12 +2,4 @@
 const router = express.Router();
 const forumController = require("../controllers/forumController");
-
-// Debug middleware for the posts route
-router.use('/posts', (req, res, next) => {
-  console.log('Forum request received:');
-  console.log('  Query params:', req.query);
-  console.log('  URL:', req.originalUrl);
-  next();
-});
 
 router.post("/posts", forumController.createForumPost);
Index: backend/scripts/testmail.js
===================================================================
--- backend/scripts/testmail.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
+++ backend/scripts/testmail.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
@@ -0,0 +1,29 @@
+const nodemailer = require("nodemailer");
+require("dotenv").config();
+
+const port = parseInt(process.env.EMAIL_PORT, 10);
+
+const transporter = nodemailer.createTransport({
+  host: process.env.EMAIL_HOST,
+  port,
+  secure: port === 465,
+  auth: {
+    user: process.env.EMAIL_USER,
+    pass: process.env.EMAIL_PASS,
+  },
+});
+
+const mailOptions = {
+  from: process.env.EMAIL_USER, // Must match your Yahoo address!
+  //   to: "dimitar.arsov@students.finki.ukim.mk",
+  to: "dimitararsov04@gmail.com",
+  subject: "Test Email from FinkiRanked Yahoo SMTP",
+  text: "This is a test email sent from your Yahoo account using Nodemailer.",
+};
+
+transporter.sendMail(mailOptions, (error, info) => {
+  if (error) {
+    return console.error("Error sending email:", error);
+  }
+  console.log("Email sent:", info.response);
+});
Index: backend/services/emailService.js
===================================================================
--- backend/services/emailService.js	(revision f25586dfdba4538cd7064e7e0bd2162b272c75d6)
+++ backend/services/emailService.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
@@ -1,8 +1,9 @@
-const nodemailer = require('nodemailer');
+const nodemailer = require("nodemailer");
+const port = parseInt(process.env.EMAIL_PORT, 10);
 
 const transporter = nodemailer.createTransport({
   host: process.env.EMAIL_HOST,
-  port: parseInt(process.env.EMAIL_PORT, 10),
-  secure: process.env.EMAIL_PORT === '465',
+  port,
+  secure: port === 465,
   auth: {
     user: process.env.EMAIL_USER,
@@ -13,7 +14,7 @@
 const sendApprovalEmail = async (userEmail, postTitle) => {
   const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Your Forum Post has been Approved!',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Your Forum Post has been Approved!",
     html: `
         <h1>Success!</h1>
@@ -36,7 +37,7 @@
 const sendDeletionEmail = async (userEmail, postTitle) => {
   const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Your Forum Post has been discared',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Your Forum Post has been Discarded",
     html: `
         <h1>Your Forum Post contains harmfull or inappropriate language</h1>
@@ -59,7 +60,7 @@
 const sendDeletedFromForumEmail = async (userEmail, postTitle) => {
   const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Your Forum Post has been deleted',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Your Forum Post has been deleted",
     html: `
         <h1>Your Forum Post contains harmfull or inappropriate language</h1>
@@ -87,7 +88,7 @@
 ) => {
   const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Your Comment has been deleted',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Your Comment has been deleted",
     html: `
         <h1>Your Comment contains harmfull or inappropriate language</h1>
@@ -112,16 +113,16 @@
     .map((post, index) => {
       const date = new Date(post.created_at);
-      const formattedDate = date.toLocaleDateString('en-GB', {
-        day: 'numeric',
-        month: 'long',
-        year: 'numeric',
+      const formattedDate = date.toLocaleDateString("en-GB", {
+        day: "numeric",
+        month: "long",
+        year: "numeric",
       });
       return `<li style="margin-bottom: 8px;"><strong>${post.title}</strong> (Created: ${formattedDate})</li>`;
     })
-    .join('');
-  const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Action Required: Posts Awaiting Review',
+    .join("");
+  const mailOptions = {
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Action Required: Posts Awaiting Review",
     html: `
         <h1>Action Required: Posts Awaiting Review</h1>
@@ -150,7 +151,7 @@
 const sendModeratorManyPendingPostsEmail = async (userEmail, postsLength) => {
   const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Action Required: Posts Awaiting Review',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Action Required: Posts Awaiting Review",
     html: `
         <h1>Action Required: Posts Awaiting Review</h1>
@@ -175,16 +176,16 @@
     .map((post) => {
       const date = new Date(post.created_at);
-      const formattedDate = date.toLocaleDateString('en-GB', {
-        day: 'numeric',
-        month: 'long',
-        year: 'numeric',
+      const formattedDate = date.toLocaleDateString("en-GB", {
+        day: "numeric",
+        month: "long",
+        year: "numeric",
       });
       return `<li style="margin-bottom: 8px;"><strong>${post.title}</strong> (Created: ${formattedDate})</li>`;
     })
-    .join('');
-  const mailOptions = {
-    from: 'FinkiRanked',
-    to: userEmail,
-    subject: 'Hourly Reminder: Daily Challenge Posts Awaiting Review',
+    .join("");
+  const mailOptions = {
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
+    to: userEmail,
+    subject: "Hourly Reminder: Daily Challenge Posts Awaiting Review",
     html: `
         <h1>Hourly Reminder: Daily Challenge Posts Awaiting Review</h1>
@@ -214,5 +215,5 @@
 ) => {
   const mailOptions = {
-    from: 'FinkiRanked',
+    from: '"FinkiRanked" <finkiranked@gmail.com>',
     to: userEmail,
     subject: `New Comment on Your Post: "${postTitle}"`,
Index: client/src/services/forumService.js
===================================================================
--- client/src/services/forumService.js	(revision f25586dfdba4538cd7064e7e0bd2162b272c75d6)
+++ client/src/services/forumService.js	(revision 8beb957641baef47d38e53ccc506cc6dad95c451)
@@ -12,9 +12,6 @@
   // Add filters to the URL if they exist
   if (filters) {
-    console.log("Service processing filters:", JSON.stringify(filters));
-
     // Add topic filter - make sure it's really topic=daily-challenge, not topic=daily%2Dchallenge
     if (filters.topic && filters.topic !== "all") {
-      console.log(`Adding topic filter: ${filters.topic}`);
       url += `&topic=${filters.topic}`;
     }
@@ -22,13 +19,5 @@
     // Add sort filter - always include date sort preference
     if (filters.dateSort) {
-      console.log(`Adding date sort filter: ${filters.dateSort}`);
       url += `&sort=${filters.dateSort}`;
-
-      // Log the expected behavior
-      if (filters.dateSort === "oldest") {
-        console.log("Expecting posts sorted with oldest first");
-      } else {
-        console.log("Expecting posts sorted with newest first");
-      }
     }
 
@@ -45,28 +34,8 @@
         if (!isNaN(dateObj.getTime())) {
           const formattedDate = dateObj.toISOString().split("T")[0];
-          console.log(`Adding specific date filter: ${formattedDate}`);
+
           url += `&date=${formattedDate}`;
 
           // Log combined filter details when using specific date with other filters
-          if (filters.topic && filters.topic !== "all") {
-            console.log(
-              `COMBINED FILTERS: Topic=${filters.topic} with specific date=${formattedDate}`
-            );
-          }
-
-          if (filters.commentSort && filters.commentSort !== "none") {
-            console.log(
-              `COMBINED FILTERS: Specific date=${formattedDate} with ${filters.commentSort} sorting`
-            );
-          }
-
-          if (filters.dateSort === "oldest") {
-            console.log(
-              `COMBINED FILTERS: Specific date=${formattedDate} with oldest-first sorting`
-            );
-            console.log(
-              "NOTE: When using specific date, time-of-day ordering still applies"
-            );
-          }
         } else {
           console.error("Invalid date object:", filters.selectedDate);
@@ -79,23 +48,5 @@
     // Add comment sort filter
     if (filters.commentSort && filters.commentSort !== "none") {
-      console.log(`Adding comment sort filter: ${filters.commentSort}`);
       url += `&commentSort=${filters.commentSort}`;
-
-      // Add debug info about the expected effect
-      if (filters.commentSort === "most-popular") {
-        console.log("Expecting posts sorted by highest comment count first");
-      } else if (filters.commentSort === "least-popular") {
-        console.log("Expecting posts sorted by lowest comment count first");
-      }
-
-      // Log the combined filter details
-      if (filters.topic && filters.topic !== "all") {
-        console.log(
-          `COMBINED FILTERS: Topic=${filters.topic} with ${filters.commentSort} sorting`
-        );
-        console.log(
-          `Expected behavior: First filter by ${filters.topic}, then sort by comment count`
-        );
-      }
     }
 
@@ -103,177 +54,12 @@
     if (filters.searchText && filters.searchText.trim()) {
       const searchTerm = encodeURIComponent(filters.searchText.trim());
-      console.log(`Adding text search filter: "${filters.searchText.trim()}"`);
+
       url += `&search=${searchTerm}`;
-
-      // Log combined filter details when using search with other filters
-      if (filters.topic && filters.topic !== "all") {
-        console.log(
-          `COMBINED FILTERS: Topic=${
-            filters.topic
-          } with text search="${filters.searchText.trim()}"`
-        );
-      }
-
-      if (filters.selectedDate) {
-        console.log(
-          `COMBINED FILTERS: Text search="${filters.searchText.trim()}" with specific date filtering`
-        );
-      }
     }
   }
-
-  console.log("Making API request to:", url);
 
   try {
     // Use apiClient to ensure authentication works properly
     const apiResponse = await apiClient.get(url);
-
-    // We'll only use this log to see what's coming from the API
-
-    // Check sorting accuracy and filtering correctness
-    if (apiResponse && apiResponse.length > 1) {
-      // 1. Check specific date filtering accuracy if applied
-      if (filters && filters.selectedDate) {
-        try {
-          // Ensure we have a proper Date object
-          const filterDate =
-            filters.selectedDate instanceof Date
-              ? new Date(filters.selectedDate)
-              : new Date(String(filters.selectedDate));
-
-          // Only proceed if we have a valid date
-          if (!isNaN(filterDate.getTime())) {
-            filterDate.setHours(0, 0, 0, 0); // Normalize to start of day
-
-            const nextDay = new Date(filterDate);
-            nextDay.setDate(nextDay.getDate() + 1);
-
-            // Check if all posts are from the selected date
-            const invalidDatePosts = apiResponse.filter((post) => {
-              try {
-                const postDate = new Date(post.date_created);
-                return postDate < filterDate || postDate >= nextDay;
-              } catch (err) {
-                console.error("Error parsing post date:", post.date_created);
-                return true; // Count as invalid if we can't parse the date
-              }
-            });
-
-            if (invalidDatePosts.length > 0) {
-              console.log(
-                `⚠️ SPECIFIC DATE FILTER ISSUE: Found ${invalidDatePosts.length} posts outside selected date range`
-              );
-              console.log("First mismatched post:", {
-                id: invalidDatePosts[0].id,
-                date: new Date(invalidDatePosts[0].date_created).toISOString(),
-                expectedDate: filterDate.toISOString().split("T")[0],
-              });
-            } else {
-              console.log(
-                `✓ Specific date filter applied correctly: All posts are from ${
-                  filterDate.toISOString().split("T")[0]
-                }`
-              );
-            }
-          } else {
-            console.error(
-              "Invalid date object for filtering validation:",
-              filters.selectedDate
-            );
-          }
-        } catch (err) {
-          console.error("Error validating date filtering:", err);
-        }
-      }
-
-      // 2. Analyze comment popularity sorting
-      if (filters && filters.commentSort && filters.commentSort !== "none") {
-        let isPopularitySorted = true;
-        for (let i = 0; i < apiResponse.length - 1; i++) {
-          if (filters.commentSort === "most-popular") {
-            if (
-              apiResponse[i].comment_count < apiResponse[i + 1].comment_count
-            ) {
-              isPopularitySorted = false;
-              break;
-            }
-          } else if (filters.commentSort === "least-popular") {
-            if (
-              apiResponse[i].comment_count > apiResponse[i + 1].comment_count
-            ) {
-              isPopularitySorted = false;
-              break;
-            }
-          }
-        }
-
-        console.log(
-          `Popularity sort check (${filters.commentSort}): ${
-            isPopularitySorted ? "✓ CORRECT" : "⚠️ NEEDS CLIENT FIXING"
-          }`
-        );
-
-        if (!isPopularitySorted) {
-          console.log("Will rely on client-side sorting for popularity");
-        }
-      }
-
-      // 3. Analyze date sorting (if comment sort is not active)
-      else if (filters && filters.dateSort) {
-        let isDateSorted = true;
-        for (let i = 0; i < apiResponse.length - 1; i++) {
-          const dateA = new Date(apiResponse[i].date_created).getTime();
-          const dateB = new Date(apiResponse[i + 1].date_created).getTime();
-
-          if (filters.dateSort === "oldest") {
-            if (dateA > dateB) {
-              isDateSorted = false;
-              break;
-            }
-          } else {
-            // Newest first (default)
-            if (dateA < dateB) {
-              isDateSorted = false;
-              break;
-            }
-          }
-        }
-
-        console.log(
-          `Date sort check (${filters.dateSort}): ${
-            isDateSorted ? "✓ CORRECT" : "⚠️ NEEDS CLIENT FIXING"
-          }`
-        );
-
-        if (!isDateSorted) {
-          console.log("Will rely on client-side sorting for date ordering");
-        }
-      }
-
-      // Log first few posts with dates to help with debugging
-      if (apiResponse.length > 0) {
-        console.log(
-          "Date ordering check:",
-          apiResponse.slice(0, 3).map((p) => ({
-            id: p.id,
-            date: new Date(p.date_created).toISOString(),
-            comments: p.comment_count,
-          }))
-        );
-      }
-    }
-
-    console.log(
-      `API response for ${url}:`,
-      apiResponse ? apiResponse.length : 0,
-      "posts"
-    );
-    if (apiResponse && apiResponse.length > 0) {
-      // Log a sample of topics to verify what we're getting
-      const topicSample = apiResponse
-        .slice(0, 3)
-        .map((p) => ({ id: p.id, topic: p.topic, title: p.title }));
-      console.log("First 3 posts:", topicSample);
-    }
 
     return apiResponse;
