Feat: Add leaderboard with Google Oauth accessible only to somaiya students#95
Feat: Add leaderboard with Google Oauth accessible only to somaiya students#95Om-Thanage wants to merge 8 commits intoMinavKaria:mainfrom
Conversation
|
@Om-Thanage is attempting to deploy a commit to the minavkaria's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
4ef1b6c to
680ade9
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive leaderboard feature with Google OAuth authentication specifically for Somaiya students. The implementation includes both frontend components and a dedicated backend service to handle student academic data.
Key changes:
- Full-stack leaderboard implementation with search, filtering, and pagination capabilities
- Google OAuth integration with domain restriction to @somaiya.edu emails
- Backend API service with MongoDB integration for student academic records
Reviewed Changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| notes-aid/src/hook/useDebounce.tsx | Custom hook for debouncing search input to optimize performance |
| notes-aid/src/components/ui/Input.tsx | Reusable input component with consistent styling |
| notes-aid/src/components/ui/Card.tsx | Card component system for consistent UI layout |
| notes-aid/src/components/lib/utils.ts | Utility functions for CSS class management |
| notes-aid/src/components/ThemeChanger.tsx | Bug fix for useEffect dependency array |
| notes-aid/src/components/Leaderboard.tsx | Main leaderboard component with comprehensive features |
| notes-aid/src/app/page.tsx | Added leaderboard navigation button to main page |
| notes-aid/src/app/leaderboard/page.tsx | Leaderboard page with OAuth authentication |
| notes-aid/package.json | Added OAuth and utility dependencies |
| leaderboard_backend/ | Complete backend service with Express, MongoDB, and authentication |
Files not reviewed (2)
- leaderboard_backend/package-lock.json: Language not supported
- notes-aid/package-lock.json: Language not supported
| document.documentElement.setAttribute("data-theme", currentTheme); | ||
| } | ||
| }, []); | ||
| }, [currentTheme]); |
There was a problem hiding this comment.
The useEffect dependency should include the initial load check. The current implementation may cause unnecessary re-renders when currentTheme changes, but the effect should only run on mount for initial setup.
| </div> | ||
| </div> | ||
| </div> | ||
| ); }; |
There was a problem hiding this comment.
There appears to be a formatting issue with extra spaces and incorrect indentation. The closing brace and semicolon should be properly formatted.
| ); }; | |
| ); | |
| }; |
| </div> | ||
| )} | ||
| </> | ||
| )} {/* Empty State */} |
There was a problem hiding this comment.
Missing line break between the closing JSX and the comment. This affects code readability and formatting consistency.
| )} {/* Empty State */} | |
| )} | |
| {/* Empty State */} |
| } catch (googleError) { | ||
|
|
||
| try { | ||
| const decoded = jwt.verify(token, process.env.JWT_SECRET || 'your-secret-key'); |
There was a problem hiding this comment.
Using a hardcoded fallback secret key 'your-secret-key' is a serious security vulnerability. The application should fail securely if JWT_SECRET is not configured rather than using a default value.
| const decoded = jwt.verify(token, process.env.JWT_SECRET || 'your-secret-key'); | |
| const decoded = jwt.verify(token, process.env.JWT_SECRET); |
leaderboard_backend/server.js
Outdated
| origin: ['http://localhost:3000', 'https://notes-aid.minavkaria.tech', 'https://notes-aid-git-fork-om-thanage-main-minavkarias-projects.vercel.app', 'https://notes-d0qrfpgl6-minavkarias-projects.vercel.app' | ||
| ], |
There was a problem hiding this comment.
The CORS origins array contains hardcoded URLs including what appear to be temporary deployment URLs. Consider using environment variables for these origins to improve maintainability and security.
| origin: ['http://localhost:3000', 'https://notes-aid.minavkaria.tech', 'https://notes-aid-git-fork-om-thanage-main-minavkarias-projects.vercel.app', 'https://notes-d0qrfpgl6-minavkarias-projects.vercel.app' | |
| ], | |
| origin: process.env.CORS_ORIGINS ? process.env.CORS_ORIGINS.split(',') : [], |
| </h3> | ||
|
|
||
| {selectedStudent.sgpa_list && selectedStudent.sgpa_list.length > 0 ? ( | ||
| <div className="space-y-3"> {selectedStudent.sgpa_list |
There was a problem hiding this comment.
Missing line break between the opening div tag and the array map method. This creates a formatting issue that affects code readability.
| <div className="space-y-3"> {selectedStudent.sgpa_list | |
| <div className="space-y-3"> | |
| {selectedStudent.sgpa_list |
…navKaria#113) * bookmark page, module rendering done * Bookmark page with states * Bookmark and Bookmark pages done * Bookmark and Bookmark page done * Fixed UI * UI fix
a466796 to
47a4a21
Compare
5c35ceb to
14e023d
Compare
No description provided.