Skip to content

Added backend logic for team productivity leaderboard using GitLab data

srilatha bandari requested to merge demo into feature-team-productivity

What does this MR do?

This MR adds a new backend API endpoint /api/productivity that fetches and returns team-wise productivity data. It retrieves metrics such as total commits, total merge requests, open merge requests, and closed merge requests using backend configuration from the .env file. This enables integration with frontend dashboards to display a Team Productivity Leaderboard.

Motivation / Use Case

This feature allows tracking and monitoring of team productivity in a structured way. It helps teams and project managers analyze contribution levels, compare performance, and visualize productivity through dashboards. This API serves as the backend data source for the Team-Wise Productivity Leaderboard feature.

Implementation Notes

  • Created a new API route /api/productivity
  • Used environment variables from .env for secure backend configuration
  • Implemented async/await for data fetching
  • Added proper error handling using try-catch blocks
  • Added logging to help debug errors and monitor API execution
  • Ensured JSON response format for frontend compatibility
  • No breaking changes introduced
  • Fully backward compatible with existing system

How to Test

  1. Pull this branch to your local machine
  2. Ensure .env file contains required environment variables
  3. Start the backend server using: npm start or node server.js
  4. Open browser or Postman and go to: http://localhost:5000/api/productivity
  5. Verify that productivity data is returned in JSON format
  6. Check terminal logs for successful execution or error messages

Checklist

  • Feature is documented (in README or relevant doc files)
  • Code is clean, readable, and follows the project style
  • No breaking changes (or documented if there are)
  • Tests are added or updated
  • Feature works as intended in local testing

Related Issues or Discussions

#44 (closed)

Merge request reports

Loading