Post questions about any subject and get help from the community.
// Create a new questionPOST /api/forum/questions{ title: "How do I solve quadratic equations?", details: "I'm struggling with understanding the quadratic formula...", tags: ["mathematics", "algebra", "equations"]}
Rich Formatting
Use markdown to format questions with code, formulas, and lists
Tag System
Categorize questions with relevant tags for easy discovery
Edit & Update
Update your questions anytime to add clarity or context
Public Viewing
All questions are publicly viewable by the community
Reputation is automatically calculated using database triggers:
-- Triggered when answer gets upvotedCREATE FUNCTION update_reputation_on_vote() RETURNS TRIGGER AS $$BEGIN INSERT INTO user_reputation (user_id, reputation) SELECT user_id, 10 FROM forum_answers WHERE id = NEW.answer_id ON CONFLICT (user_id) DO UPDATE SET reputation = user_reputation.reputation + 10; RETURN NEW;END;$$ LANGUAGE plpgsql;
POST /api/social/resources{ title: "Khan Academy - Calculus", url: "https://www.khanacademy.org/math/calculus", description: "Excellent video tutorials on calculus fundamentals", tags: ["calculus", "mathematics", "videos"], group_id: "optional-group-id" // Share with specific group}
CREATE TABLE shared_resources ( id UUID PRIMARY KEY, user_id UUID NOT NULL, group_id UUID, -- NULL for public resources title TEXT NOT NULL, url TEXT NOT NULL, description TEXT, tags TEXT[], created_at TIMESTAMPTZ DEFAULT NOW());
-- Users can view all questions (public)CREATE POLICY "Anyone can view questions" ON forum_questions FOR SELECT USING (true);-- Users can only edit their own contentCREATE POLICY "Users can update their own questions" ON forum_questions FOR UPDATE USING (auth.uid() = user_id);-- Group members can view group resourcesCREATE POLICY "Members can view group resources" ON shared_resources FOR SELECT USING ( group_id IS NULL OR EXISTS ( SELECT 1 FROM study_group_memberships WHERE group_id = shared_resources.group_id AND user_id = auth.uid() ) );
All your forum posts, answers, and shared resources are associated with your username. Choose a username you’re comfortable sharing publicly!
GET /api/social/groups // List your groups (auth required)POST /api/social/groups // Create group (auth required)POST /api/social/groups/join/:code // Join group (auth required)GET /api/social/groups/:id // Get group details (auth required)