SagarKapoorin/Interview-Assignment

★ 0Forks 0TypeScriptGitHub ↗Compare

README

Interview Assignment

Live Demo

Live Link

Repository

GitHub Repository

Installation

  1. Clone the repository:
    git clone https://github.com/SagarKapoorin/Interview-Assignment.git
    cd Interview-Assignment
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build
  4. Start the server:
    npm run start

Environment Variables

The project requires the following environment variables:

  • MONGO_URI - MongoDB connection string
  • redisUrl - Redis server URL for rate limiting

API Endpoints

Submit a Review

  • Endpoint: /reviews
  • Method: POST
  • Request Body:
    {
      "review": "Your review text here"
    }
  • Description: Saves a review to the database.

Get Review Analysis

  • Endpoint: /analysis
  • Method: GET
  • Description: Retrieves sentiment analysis of reviews, including average sentiment score and total count of reviews.
  • Uses: MongoDB aggregation pipeline for data processing.

Features

  • MongoDB for storing reviews
  • Redis for rate limiting
  • Sentiment analysis using aggregation pipeline
  • RESTful API endpoints

Author

Made by Sagar Kapoor

Contributors

SagarKapoorin

Issues