Index: backend/controllers/forumController.js
===================================================================
--- backend/controllers/forumController.js	(revision 8d2edcc82db1c928bbd29ecf82c2ba6152ba974c)
+++ backend/controllers/forumController.js	(revision f40e145c6e4a34e965397450f8b71f3a87cb754f)
@@ -3,5 +3,6 @@
 // Placeholder for forum post functions
 const createForumPost = async (req, res) => {
-  const { title, content, authorId, authorName } = req.body;
+  const { title, content, authorId, authorName } = req.body
+  console.log(title,content,authorId,authorName)
 
   try {
@@ -25,8 +26,13 @@
 const getForumPosts = async (req, res) => {
   try {
+    const page = parseInt(req.query.page) || 0;
+    const limit = parseInt(req.query.limit) || 5;
+    const offset = page * limit;
+
     const { data, error } = await supabase
       .from('forum_posts')
       .select('*')
-      .order('dateCreated', { ascending: false });
+      .order('date_created', { ascending: false })
+      .range(offset, offset + limit - 1); // Supabase range is inclusive
 
     if (error) {
@@ -121,5 +127,5 @@
       .select('*')
       .eq('post_id', postId)
-      .order('dateCreated', { ascending: false });
+      .order('date_created', { ascending: false });
 
     if (error) {
Index: client/src/CreatePost/CreatePost.jsx
===================================================================
--- client/src/CreatePost/CreatePost.jsx	(revision 8d2edcc82db1c928bbd29ecf82c2ba6152ba974c)
+++ client/src/CreatePost/CreatePost.jsx	(revision f40e145c6e4a34e965397450f8b71f3a87cb754f)
@@ -7,8 +7,41 @@
   const navigate = useNavigate();
 
-  const handleSubmit = (e) => {
+  const handleSubmit = async (e) => {
     e.preventDefault();
-    console.log("Post submitted:", { title, content });
-    // Add your submission logic here
+
+    const user = JSON.parse(localStorage.getItem('user'));
+
+    if (!user || !user.id || !user.name) {
+      alert("You must be logged in to create a post.");
+      navigate('/login');
+      return;
+    }
+
+    try {
+      const response = await fetch('/forum/posts', {
+        method: 'POST',
+        headers: {
+          'Content-Type': 'application/json',
+        },
+        body: JSON.stringify({
+          title,
+          content,
+          authorId: user.id,
+          authorName: user.name,
+        }),
+      });
+
+      if (!response.ok) {
+        throw new Error(`HTTP error! status: ${response.status}`);
+      }
+
+      const data = await response.json();
+      console.log('Post created successfully:', data);
+      alert('Post created successfully!');
+      navigate('/dashboard'); // Navigate back to the forum or dashboard
+    } catch (error) {
+      console.error('Error creating post:', error);
+      alert(`Failed to create post: ${error.message}`);
+    }
   };
 
Index: client/src/Dashboard/components/Forum.jsx
===================================================================
--- client/src/Dashboard/components/Forum.jsx	(revision 8d2edcc82db1c928bbd29ecf82c2ba6152ba974c)
+++ client/src/Dashboard/components/Forum.jsx	(revision f40e145c6e4a34e965397450f8b71f3a87cb754f)
@@ -1,3 +1,3 @@
-import React from "react";
+import React, { useState, useEffect } from "react";
 import { useNavigate } from "react-router-dom";
 import commentIcon from "../../assets/images/comment.svg";
@@ -6,28 +6,38 @@
 const Forum = () => {
   const navigate = useNavigate();
+  const [posts, setPosts] = useState([]);
+  const [page, setPage] = useState(0);
+  const [hasMore, setHasMore] = useState(true);
+  const postsPerPage = 5; // Number of posts to fetch per request
 
-  const posts = [
-    {
-      id: 1,
-      title: "How to learn React?",
-      author: "John Doe",
-      content:
-        "React is a popular JavaScript library for building user interfaces. Start by learning the basics of components, state, and props.",
-    },
-    {
-      id: 2,
-      title: "Best practices for Tailwind CSS",
-      author: "Jane Smith",
-      content:
-        "Tailwind CSS is a utility-first CSS framework. Use consistent class naming and leverage configuration files for customization.",
-    },
-    {
-      id: 3,
-      title: "Understanding JavaScript closures",
-      author: "Alice Johnson",
-      content:
-        "Closures are a fundamental concept in JavaScript. They allow functions to access variables from their outer scope even after the outer function has returned.",
-    },
-  ];
+  useEffect(() => {
+    fetchPosts();
+  }, [page]);
+
+  const fetchPosts = async () => {
+    try {
+      const response = await fetch(
+        `/forum/posts?page=${page}&limit=${postsPerPage}`
+      );
+      if (!response.ok) {
+        throw new Error(`HTTP error! status: ${response.status}`);
+      }
+      const data = await response.json();
+      if (page === 0) {
+        setPosts(data);
+      } else {
+        setPosts((prevPosts) => [...prevPosts, ...data]);
+      }
+      if (data.length < postsPerPage) {
+        setHasMore(false);
+      }
+    } catch (error) {
+      console.error("Error fetching forum posts:", error);
+    }
+  };
+
+  const handleLoadMore = () => {
+    setPage((prevPage) => prevPage + 1);
+  };
 
   return (
@@ -43,5 +53,5 @@
             >
               <h2 className="text-lg font-semibold">{post.title}</h2>
-              <p className="text-sm text-gray-500">By {post.author}</p>
+              <p className="text-sm text-gray-500">By {post.author_name}</p>
               <p className="mt-2 text-gray-700">{post.content}</p>
               <div className="mt-4 flex gap-4">
@@ -60,4 +70,11 @@
           ))}
         </div>
+        {hasMore && (
+          <div className="flex justify-center mt-6">
+            <button onClick={handleLoadMore} className="btn btn-outline">
+              Load More
+            </button>
+          </div>
+        )}
       </div>
 
Index: client/vite.config.js
===================================================================
--- client/vite.config.js	(revision 8d2edcc82db1c928bbd29ecf82c2ba6152ba974c)
+++ client/vite.config.js	(revision f40e145c6e4a34e965397450f8b71f3a87cb754f)
@@ -19,4 +19,9 @@
         secure: false,
       },
+      "/forum": {
+        target: "http://localhost:5001",
+        changeOrigin: true,
+        secure: false,
+      },
     },
   },
