+
Skip to content

amberIS01/PairUp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Internship Analytics Microservice

A RESTful API microservice built with Node.js and Express.js for analyzing internship application data and feedback.

Features

  • Top Applicants API: Get top 5 applicants by feedback score
  • Daily Stats API: Get daily application statistics
  • Feedback Summary API: Get feedback rating distribution

Tech Stack

  • Runtime: Node.js
  • Framework: Express.js
  • Middleware: CORS, JSON body parser
  • Data Storage: In-memory (for demo purposes)

Prerequisites

  • Node.js (v14 or later)
  • npm (comes with Node.js)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd internship-analytics
  2. Install dependencies:

    npm install

Running the Application

Start the development server:

npm start

The server will start on http://localhost:3000

API Endpoints

1. Get Top Applicants

  • URL: /api/applicants/top
  • Method: GET
  • Description: Returns top 5 applicants sorted by feedback score
  • Response:
    {
      "success": true,
      "data": [
        {
          "id": 4,
          "name": "Diana Prince",
          "feedbackScore": 4.9,
          "status": "accepted",
          "applicationDate": "2025-06-14"
        },
        ...
      ]
    }

2. Get Daily Stats

  • URL: /api/applicants/stats?date=YYYY-MM-DD
  • Method: GET
  • Query Parameters:
    • date (required): Date in YYYY-MM-DD format
  • Response:
    {
      "success": true,
      "data": {
        "date": "2025-06-15",
        "total": 3,
        "accepted": 2,
        "rejected": 0,
        "pending": 1
      }
    }

3. Get Feedback Summary

  • URL: /api/feedback/summary
  • Method: GET
  • Description: Returns count of feedback ratings
  • Response:
    {
      "success": true,
      "data": {
        "positive": 4,
        "neutral": 1,
        "negative": 2,
        "total": 7
      }
    }

Testing the API

You can test the API using tools like Postman or curl:

# Get top applicants
curl http://localhost:3000/api/applicants/top

# Get daily stats
curl "http://localhost:3000/api/applicants/stats?date=2025-06-15"

# Get feedback summary
curl http://localhost:3000/api/feedback/summary

Project Structure

internship-analytics/
├── node_modules/    # Dependencies
├── .gitignore       # Git ignore file
├── package.json     # Project metadata and dependencies
├── README.md       # This file
└── server.js       # Main application file

Future Improvements

  • Add persistent database (e.g., MongoDB, PostgreSQL)
  • Implement authentication and authorization
  • Add request validation
  • Write unit and integration tests
  • Add API documentation with Swagger/OpenAPI
  • Add logging
  • Implement rate limiting
  • Add input sanitization

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载