- Clone the repository:
git clone https://github.com/SagarKapoorin/Interview-Assignment.git cd Interview-Assignment - Install dependencies:
npm install
- Build the project:
npm run build
- Start the server:
npm run start
The project requires the following environment variables:
MONGO_URI- MongoDB connection stringredisUrl- Redis server URL for rate limiting
- Endpoint:
/reviews - Method:
POST - Request Body:
{ "review": "Your review text here" } - Description: Saves a review to the database.
- 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.
- MongoDB for storing reviews
- Redis for rate limiting
- Sentiment analysis using aggregation pipeline
- RESTful API endpoints
Made by Sagar Kapoor