Zionet Homework task
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:
- User Service: Manages user information and preferences.
- News Aggregator Service: Fetches and summarizes news articles.
- Notification Service: Sends the summarized news to the user's email.
+----------------------+ +----------------------+ +----------------------+
| 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
- Docker and Docker Compose installed
- Docker (https://www.docker.com/products/docker-desktop)
- Docker Compose (https://docs.docker.com/compose/)
- Dapr CLI installed
- Node.js and npm installed
git clone <repository-url>
cd <repository-directory>
-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.
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.