Skip to content

Conversation

@Sappymukherjee214
Copy link
Contributor

  • Add adminMiddleware for role-based access control
  • Create GET /api/v1/admin/stats endpoint for admin statistics
  • Implement getAdminStats service to count users by role
  • Add admin dashboard UI with user statistics cards
  • Display total users, admins, regular users, and creators
  • Show recent 10 registered users in table format
  • Add proper error handling and authentication checks
  • Update routes to include admin dashboard path

- Add adminMiddleware for role-based access control
- Create GET /api/v1/admin/stats endpoint for admin statistics
- Implement getAdminStats service to count users by role
- Add admin dashboard UI with user statistics cards
- Display total users, admins, regular users, and creators
- Show recent 10 registered users in table format
- Add proper error handling and authentication checks
- Update routes to include admin dashboard path
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Sappymukherjee214, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational elements for an admin dashboard, providing administrators with a centralized view of user statistics. It integrates both backend and frontend components, enabling secure data retrieval and intuitive visualization of user demographics and recent activity. The changes ensure that administrative data is accessible only to authorized personnel while offering a clear, at-a-glance summary of the platform's user base.

Highlights

  • Admin Dashboard Backend: Introduced a new backend endpoint /api/v1/admin/stats to fetch user statistics, including total users, counts by role (admin, regular, creator), and the 10 most recently registered users.
  • Role-Based Access Control: Implemented an adminMiddleware to secure the new admin endpoint, ensuring that only authenticated users with 'admin' roles can access these statistics.
  • Admin Dashboard Frontend: Developed a new React component for the admin dashboard UI, which consumes the backend statistics and displays them visually using cards for user counts and a table for recent user registrations.
  • Routing and Error Handling: Added new routes for the admin dashboard on both the backend and frontend, and incorporated robust error handling and authentication checks within the dashboard component to manage access and display appropriate messages.
  • Constants for Admin Operations: Added new constants in user.constant.ts for messages related to admin statistics fetching and access control.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Sappymukherjee214
Copy link
Contributor Author

@abhishek-nexgen-dev I have added the admin dashboard foundation. Please assign it to me.

@abhishek-nexgen-dev abhishek-nexgen-dev self-assigned this Jan 8, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new admin dashboard feature, including backend endpoints for statistics and a frontend UI to display them. The changes are well-structured, with new middleware for admin access control and a dedicated service for fetching data.

My review focuses on improving performance, maintainability, and robustness. I've identified a few areas for improvement:

  • The backend can be optimized to use a single database query for statistics, significantly improving performance.
  • Error handling in the new admin middleware can be more precise with status codes.
  • The frontend has a hardcoded API URL which should be moved to environment variables.
  • There's some route definition redundancy in the frontend that could be cleaned up for better modularity.

Overall, this is a great addition. Addressing these points will make the implementation more efficient and maintainable.

@AMANkumar0004
Copy link

AMANkumar0004 commented Jan 8, 2026

@abhishek-nexgen-dev
community admin here
why are you self assigning this PR to yourself ??
assign to the contributor ASAP.
and add ECWoC label before merging

@abhishek-nexgen-dev
Copy link
Member

@AMANkumar0004 please check again

@abhishek-nexgen-dev
Copy link
Member

@Sappymukherjee214 bro can you attach some screenshot

@abhishek-nexgen-dev
Copy link
Member

@AMANkumar0004 bro by mistake i assign my self and after some time I got the rejection email

Bro please do some things

Screenshot_2026-01-09-15-33-28-29_e307a3f9df9f380ebaf106e1dc980bb6.jpg

Screenshot_2026-01-09-15-33-06-61_e307a3f9df9f380ebaf106e1dc980bb6.jpg

@abhishek-nexgen-dev
Copy link
Member

@Sappymukherjee214 add some screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants