Skip to content

Divv1524/DoubtDesk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

154 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DoubtDesk

An AI-powered collaborative classroom platform where students get instant doubt resolution, teachers manage virtual classrooms, and analytics drive better learning outcomes.

MIT License PRs Welcome GSSoC 2026 Live Demo


Table of Contents


Problem Statement

Students in colleges and universities face a recurring set of challenges that existing tools fail to address:

  • Doubts go unanswered. Asking questions in large lectures is intimidating, and instructors are not available around the clock.
  • No structured Q&A channel. WhatsApp and Telegram groups are chaotic — doubts get buried, and solutions are never archived or searchable.
  • Teachers lack visibility. Instructors have no data on which topics students struggle with until exam results arrive, which is too late to intervene.
  • Existing platforms miss the mark. Stack Overflow targets professional developers, not structured academics. ChatGPT lacks classroom context, anonymity, and teacher oversight.

DoubtDesk bridges this gap by combining AI-powered instant solving with real classroom structure, giving students answers in seconds and teachers insights in real time.


Solution

DoubtDesk provides a virtual classroom environment where:

  1. Students ask doubts via text or image (photo of a handwritten problem).
  2. AI instantly solves the doubt with step-by-step, simplified, and exam-ready explanations.
  3. Community and teachers can also answer, creating a layered support system.
  4. Analytics dashboard surfaces weak topics, peak doubt hours, and resolution rates so teachers can act proactively.
  5. Moderation engine keeps the platform academic and safe using AI content filtering with an escalating strike system.

Features

AI Doubt Solver

  • Type a question or upload a photo — AI solves it instantly using Groq-accelerated LLMs.
  • Structured output: Step-by-step breakdown, simplified explanation, and final answer.
  • Interactive follow-ups: click any step to ask for further clarification.
  • Full LaTeX rendering for math and science equations via KaTeX.
  • Persistent chat history for continuing previous AI sessions.

Virtual Classrooms

  • Teachers create classrooms with unique invite codes.
  • Students join using invite codes; recommended classrooms auto-surface by university and year.
  • Three doubt channels per class: AI Solve, Community Board, Teacher Lane.
  • Role-based views (Student vs Teacher) with distinct capabilities.
  • Anonymous posting — students are assigned randomized identifiers (e.g., Student_A7X) to encourage participation without fear.

Classroom Analytics

  • Topic Difficulty Heatmap — highlights which subjects have the most doubts.
  • Resolution Pulse — solved vs. pending ratio with circular progress visualization.
  • Peak Activity Timeline — 24-hour bar chart showing when students are most active.
  • Personal AI Mentor — per-student weak-topic detection after sufficient engagement.

Moderation and Safety

  • AI-powered content moderation flags abusive, off-topic, or spam content before it is posted.
  • 3-strike system with escalating temporary account blocks (3 days for first block, increasing for subsequent violations).
  • Full audit trail via moderation logs table for admin review.

Public Doubt Board

  • Open community board (no classroom required) with subject filters.
  • Like, reply, and mark doubts as solved.
  • Accessible to all authenticated users.

User Profiles

  • Personal dashboard showing doubts asked, replies given, and classrooms joined.
  • Activity statistics including helpful votes received.

Architecture

Student signs up --> Onboarding (university, year, role)
       |
       v
Joins/Creates a Classroom (via invite code)
       |
       v
+----------------------------------------------+
|  Ask a Doubt (Text or Image Upload)          |
|       |                                      |
|  +----------+--------------+---------------+ |
|  | AI Tab   | Community Tab| Teacher Tab   | |
|  | (Groq)   | (Peer Reply) | (Direct Ask)  | |
|  +----------+--------------+---------------+ |
|       |                                      |
|  Resolution + Follow-up Chat                 |
|       |                                      |
|  Analytics Dashboard (Insights for all)      |
+----------------------------------------------+

Tech Stack

Layer Technology Purpose
Framework Next.js 14 (App Router) Full-stack React framework with server-side rendering
Language TypeScript Static type safety across the codebase
Authentication Clerk User management, session handling, role-based access
AI Engine Groq API (Llama 3.3 / 4) Ultra-fast LLM inference for doubt solving and moderation
Database Neon PostgreSQL Serverless Postgres with branching and autoscaling
ORM Drizzle ORM Type-safe, SQL-like query builder
Background Jobs Inngest Reliable async workflows and event-driven processing
UI Components Tailwind CSS + shadcn/ui Utility-first styling with accessible component primitives
Math Rendering KaTeX Client-side LaTeX equation rendering
OCR / Vision Tesseract.js + Vision LLMs Image-based doubt input and handwriting recognition
Notifications Sonner Lightweight toast notification system
Deployment Vercel Edge-optimized hosting with CI/CD

Screenshots

Screenshots are located in the screenshots/ directory and will be updated as the UI evolves.

Landing Page

AI Solver

Classroom View

Analytics Dashboard


Demo Access

A live instance of DoubtDesk is deployed at doubt-desk-seven.vercel.app.

To explore the full classroom experience without setting up your own environment, use the sample classroom below after signing in:

Field Value
Classroom Invite Code DNOIRL

Steps to access:

  1. Visit the live demo.
  2. Sign up or sign in using Clerk authentication.
  3. Complete the onboarding flow (select your university, year, and role).
  4. Navigate to Classrooms and click Join Classroom.
  5. Enter the invite code DNOIRL to join the sample classroom.
  6. Explore all features: post a doubt, use the AI solver, view the community board, and check analytics.

Note for contributors: Using the demo classroom is strongly recommended before working on any issue. It provides context for how the platform works end-to-end.


Getting Started

Prerequisites

  • Node.js 18 or higher
  • npm (bundled with Node.js)
  • Git
  • API keys for the following services:
    • Clerk — Authentication
    • Neon — PostgreSQL database
    • Groq — AI inference

Installation

# 1. Fork the repository (click Fork on GitHub)

# 2. Clone your fork
git clone https://github.com/<your-username>/DoubtDesk.git
cd DoubtDesk

# 3. Install dependencies
npm install

# 4. Set up environment variables
cp .env.example .env
# Fill in your API keys (see Environment Variables below)

# 5. Start the development server
npm run dev
# Open http://localhost:3000

Environment Variables

Create a .env file in the project root with the following keys:

# Database (Neon PostgreSQL)
NEXT_PUBLIC_NEON_DB_CONNECTION_STRING=your_neon_connection_string

# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

# AI (Groq)
GROQ_API_KEY=gsk_...

Security: Never commit your .env file. It is already included in .gitignore.


Project Structure

DoubtDesk/
├── app/
│   ├── (auth)/              # Clerk authentication pages (sign-in, sign-up)
│   ├── api/                 # API routes
│   │   ├── doubts/          #   Doubt CRUD and like endpoints
│   │   ├── rooms/           #   Classroom creation, joining, management
│   │   ├── analytics/       #   Teacher analytics data endpoints
│   │   ├── ask-ai/          #   AI solver inference endpoint
│   │   ├── profile/         #   User profile data aggregation
│   │   └── inngest/         #   Background job webhook handler
│   ├── ask-ai/              # Standalone AI solver page
│   ├── dashboard/           # Analytics dashboard (teacher + student views)
│   ├── onboarding/          # First-time user onboarding flow
│   ├── profile/             # User profile page
│   ├── public-rooms/        # Public doubt board (no classroom required)
│   ├── rooms/               # Classroom list and individual classroom view
│   ├── layout.tsx           # Root layout (Clerk provider, global styles)
│   └── page.tsx             # Landing page
├── components/              # Reusable UI components
│   ├── ui/                  #   shadcn/ui primitives (Button, Card, Dialog, etc.)
│   ├── AskAIView.tsx        #   AI solver conversation component
│   ├── AskDoubt.tsx         #   Doubt submission modal
│   ├── DashboardLayout.tsx  #   Authenticated layout wrapper
│   ├── DoubtCard.tsx        #   Doubt display card with actions
│   └── Sidebar.tsx          #   Navigation sidebar
├── configs/
│   ├── db.tsx               # Neon database connection setup
│   └── schema.ts            # Drizzle ORM schema (all tables)
├── lib/
│   ├── moderation.ts        # AI content moderation and strike enforcement
│   ├── email.ts             # Warning and block notification email helpers
│   └── auth-utils.ts        # Authentication utility functions
├── inngest/                 # Background job definitions (Inngest functions)
├── scripts/                 # Developer utility and database migration scripts
├── screenshots/             # Application screenshots for documentation
└── middleware.tsx            # Clerk authentication and route protection middleware

Contributing

Contributions are welcome from developers of all experience levels. Whether you are fixing a typo, improving the UI, or building a new feature, your work is valued.

Before submitting a pull request, please read the full Contributing Guide.

Quick Start for Contributors

  1. Browse open issues on the Issues tab. Filter by good-first-issue or beginner-friendly labels.
  2. Comment on the issue to indicate you are working on it.
  3. Fork and clone the repository.
  4. Join the demo classroom using invite code DNOIRL to understand the product before writing code.
  5. Create a branch following the naming convention:
    • feature/add-dark-mode-toggle
    • fix/classroom-invite-validation
    • docs/update-readme-screenshots
  6. Make focused changes with clear, conventional commit messages.
  7. Test locally using npm run dev.
  8. Submit a PR against the main branch.

Commit Message Format

Follow the Conventional Commits standard:

feat: add loading skeleton to AI solver
fix: handle empty classroom state gracefully
docs: add screenshots to README
style: improve mobile responsiveness of classroom cards
refactor: extract doubt card into reusable component

Code Style

  • Use TypeScript with proper interfaces — avoid any types.
  • Follow the existing component structure in /components and /app.
  • Use Tailwind CSS for styling, matching the existing dark theme (slate-950 backgrounds, blue-500/600 accents, glassmorphism patterns).
  • Keep components focused: one file, one responsibility.

Issue Labels and Difficulty Levels

Difficulty Levels (GSSoC)

Label Points Description
level 1 Low Beginner-friendly tasks: documentation, small UI fixes, adding aria-labels
level 2 Medium Intermediate tasks: new API routes, component refactors, feature additions
level 3 High Advanced tasks: real-time systems, authentication flows, architectural changes

Category Labels

Label Description
good-first-issue Small, well-scoped tasks ideal for first-time contributors
beginner-friendly Slightly more involved but still approachable with guidance
bug Something is broken and needs fixing
enhancement New feature or improvement to existing functionality
documentation Improvements to README, guides, or inline code comments
frontend Changes to UI components, pages, or styling
backend Changes to API routes, database queries, or server logic
ai Changes to AI prompts, model handling, or content moderation
security Security-related fixes or hardening
ui/ux User interface and experience improvements
gssoc Part of the GirlScript Summer of Code program
priority: high Must be resolved urgently
priority: medium Should be addressed in the current cycle
priority: low Nice to have, no immediate deadline

Roadmap

The following is a prioritized list of planned enhancements. Contributions toward any of these are welcome.

Near-Term (v1.1)

Feature Description Status
Testing framework Set up Jest and React Testing Library for unit and integration tests Planned
404 page Custom not-found page matching the application design system Open issue
Footer component Consistent footer across all pages with navigation links Open issue
README screenshots Render inline screenshots with proper markdown image syntax Open issue
Profile page fixes TypeScript interfaces, stable user lookup, mobile nav, error states Open issue

Mid-Term (v1.2)

Feature Description Status
Real-time notifications WebSocket or SSE-based alerts for new doubts, replies, and mentions Open issue
Dark mode toggle System-aware and manual dark/light mode switching Open issue
Global search Full-text search across doubts with subject and topic filters Open issue
Helpful upvotes Allow students to upvote community replies as "helpful" Open issue
Rate limiting API-level rate limiting to prevent abuse and ensure fair usage Open issue
Separate login flows Distinct authentication paths for students and teachers Open issue

Long-Term (v2.0)

Feature Description Status
Multi-language support Internationalization (i18n) for Hindi, Tamil, Bengali, and other regional languages Planned
Mobile application React Native or PWA for native mobile experience Planned
Gamification Points, badges, and leaderboards to reward active participants Planned
Export and reports Teachers can export classroom analytics as PDF/CSV reports Planned
Admin dashboard Platform-wide moderation panel for project administrators Planned
AI tutor memory Persistent context across AI sessions for personalized tutoring Planned
Doubt de-duplication AI-powered detection of duplicate or similar doubts with auto-linking Planned
Video/voice doubts Support for audio and short video doubt submissions Planned
Classroom announcements Teachers can broadcast announcements to all classroom members Planned
Integration with LMS Connect with Google Classroom, Moodle, or Canvas for roster sync Planned

Code of Conduct

We are committed to providing a welcoming and harassment-free experience for everyone. Please read our Code of Conduct before participating.

In short: Be respectful, be constructive, be kind.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments


Built for students and teachers everywhere.

About

We built an anonymous, AI-powered doubt-solving platform integrated with classrooms where students can ask questions without fear and get instant answers

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.6%
  • Other 0.4%