Skip to content

Chavi744/Personalizd-News-Update-Aggregator

Repository files navigation

Personalizd-News-Update-Aggregator

Zionet Homework task

Purpose

The News Aggregator System is designed to fetch news articles based on user preferences, summarize them using AI, and send the summarized news to the user's email. The system is composed of three microservices:

  1. User Service: Manages user information and preferences.
  2. News Aggregator Service: Fetches and summarizes news articles.
  3. Notification Service: Sends the summarized news to the user's email.

System Diagram

+----------------------+       +----------------------+       +----------------------+
|  User Service        |       |  News Aggregator     |       |  Notification Service|
|                      |       |  Service             |       |                      |
|  - Manages user info |<------|  - Fetches news      |------>|  - Sends email       |
|  - Provides user     |       |  - Summarizes news   |       |                      |
|    preferences       |       |  - Publishes news    |       |                      |
|                      |       |                      |       |                      |
+----------------------+       +----------------------+       +----------------------+
          ^                                   ^                           ^
          |                                   |                           |
          +-----------------------------------+---------------------------+
                               Dapr (Redis) for Pub/Sub

Steps to Run the Application Locally

Prerequisites

  1. Docker and Docker Compose installed
  2. Dapr CLI installed
  3. Node.js and npm installed

Clone the Repository

git clone <repository-url>
cd <repository-directory>

Set Up Environment Variables

-Create the .env file in news-aggregator-service directory with the following variables:

PORT=The port on which the service will run.
NEWS_API_KEY=API key for NewsData.io.
GEMINI_API_KEY=API key for Google Generative AI.
DAPR_HTTP_PORT_USER = The Dapr HTTP port of user-service
DAPR_HTTP_PORT_NOTIFICATION = The Dapr HTTP port of notification-service
DAPR_HTTP_PORT = The Dapr HTTP port

-Create the .env file in user-service directory with the following variables:

PORT=The port on which the service will run
MONGODB_URI=MongoDB uri

-Create the .env file in notification-service directory with the following variables:

PORT=The port on which the service will run
EMAIL_USER=our email address (for sending emails).
EMAIL_PASS=Your email password.

Build and Run the Services

Use Docker Compose to build and run the services.

docker-compose up --build

This command will start all the microservices along with MongoDB and Redis.

About

Zionet Homework task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published