Skip to content

Conversation

rixitgithub
Copy link
Contributor

@rixitgithub rixitgithub commented May 25, 2025

I have migrated the authentication to use only MongoDB so that it becomes easier for future developers

Summary by CodeRabbit

  • New Features

    • Introduced online debate rooms with real-time video, audio, chat, and phase-based management for user-vs-user and user-vs-bot debates.
    • Added AI-powered debate coaching, including argument strengthening and pros/cons challenges with instant feedback and scoring.
    • Enabled bot-vs-user debates with configurable bots, topics, stances, and phase timings.
    • Implemented detailed leaderboard, profile dashboards, Elo rating tracking, and match history visualization.
    • Provided tournament management, bracket views, and match logs.
    • Added transcript submission and automated debate judging with detailed verdicts and skill recommendations.
    • Enhanced navigation with responsive sidebar, header, breadcrumbs, and mobile drawer.
    • Added new UI components: charts, badges, tables, dialogs, tabs, selects, progress bars, and toasts.
    • Improved authentication with JWT, email verification, and password reset.
  • Bug Fixes

    • Standardized error handling and status codes across authentication and profile endpoints.
  • Chores

    • Updated backend and frontend dependencies to support new features and UI components.
    • Expanded and reorganized configuration files for environment management.
  • Documentation

    • Added About page and detailed in-app informational sections.

Zahnentferner and others added 30 commits December 3, 2024 10:38
…-Hide-Password-Functionality-46

password hide-visible feature added ( issue AOSSIE-Org#46 )
…DebateAI

- Added seamless post-sign-in user flow with navigation logic in React
- Implemented profile UI and /user backend routes with edit functionality
- Built leaderboard UI and /leaderboard API, sorting users by EloRating
- Created user and debate schemas in MongoDB with Go integration
- Seeded test data; updated config, auth, and dependencies for full stack support
…es and AI judgment using WebSocket and WebRTC
Copy link

coderabbitai bot commented May 25, 2025

Caution

Review failed

Failed to post review comments.

Walkthrough

This update introduces a comprehensive real-time online debate platform with structured debate phases, AI-powered judgment, and robust user management. Major changes include new backend services for debate rooms, user authentication, Elo-based leaderboards, and AI coaching, as well as frontend components for debate rooms, coaching, tournaments, and user profiles. WebSocket and WebRTC are used for real-time debate interactions.

Changes

Files/Groups Change Summary
backend/cmd/server/main.go, backend/config/*, backend/db/db.go, backend/models/*, backend/utils/* Added MongoDB-backed config, user, debate, and transcript models; seeded test data; established DB connection and directory setup; enhanced config struct for AI, SMTP, JWT, and database.
backend/controllers/auth.go, backend/controllers/leaderboard.go, backend/controllers/profile_controller.go, backend/controllers/debate_controller.go, backend/controllers/debatevsbot_controller.go, backend/controllers/transcript_controller.go Replaced Cognito with MongoDB for user management; implemented JWT auth, verification, password reset, leaderboard, profile, debate, debate-vs-bot, and transcript endpoints.
backend/routes/*, backend/middlewares/auth.go Introduced new route handlers for debate, coaching, rooms, transcripts, leaderboard, and user profile; added JWT-based authentication middleware.
backend/services/coach.go, backend/services/debatevsbot.go, backend/services/pros_cons.go, backend/services/transcriptservice.go Added AI-powered debate coaching, bot debate, pros/cons evaluation, and transcript judgment services using Gemini API.
backend/websocket/websocket.go Implemented new WebSocket handler for real-time debate signaling and chat; replaced and commented out legacy handler.
frontend/src/App.tsx, frontend/src/main.tsx, frontend/src/index.css Refactored app structure and routing; added new animation for floating emojis.
frontend/src/Pages/*, frontend/src/components/* Added pages and components for online debate room, bot selection, coaching, leaderboard, profile, tournaments, chat room, debate popup, header, sidebar, and various UI utilities.
frontend/src/services/*, frontend/src/utils/auth.ts Added service modules for leaderboard, profile, debate-vs-bot, and authentication token management.
frontend/package.json Added dependencies for Radix UI, Recharts, and other UI/charting libraries.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Frontend
  participant Backend
  participant MongoDB
  participant GeminiAI

  User->>Frontend: Login/Signup
  Frontend->>Backend: POST /signup or /login
  Backend->>MongoDB: Create/verify user, hash password
  Backend-->>Frontend: JWT token

  User->>Frontend: Start Debate (Online or Bot)
  Frontend->>Backend: Create Room or Debate (via API)
  Backend->>MongoDB: Create debate/room document
  Backend-->>Frontend: Room/Debate ID

  User->>Frontend: Join Debate Room
  Frontend->>Backend: WebSocket connect (room ID)
  Backend->>Frontend: Real-time signaling (WebSocket)
  User->>Frontend: Send/receive media & messages (WebRTC/WebSocket)

  User->>Frontend: Submit argument/transcript
  Frontend->>Backend: POST /submit-transcripts or /debatevsbot
  Backend->>GeminiAI: Evaluate/judge arguments
  GeminiAI-->>Backend: Judgment/feedback
  Backend->>MongoDB: Store results
  Backend-->>Frontend: Judgment/feedback

  User->>Frontend: View Leaderboard/Profile
  Frontend->>Backend: GET /leaderboard or /profile
  Backend->>MongoDB: Fetch user/debate stats
  Backend-->>Frontend: Stats, history, Elo, etc.
Loading

Possibly related issues

  • AOSSIE-Org/DebateAI#72: This PR directly implements a real-time online debate platform with structured phases, AI judgment, and WebSocket/WebRTC, which matches the objectives of this issue.

Poem

In burrows deep, the code did grow,
With WebSockets, bots, and Elo’s glow.
Debaters chat and argue live,
AI coaches help them thrive.
Tournaments, rooms, and leaderboards bloom—
The rabbit’s dream: debates resume!
🐇✨ Let’s hop to the next round soon!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants