0% found this document useful (0 votes)
21 views

all_doc

The document is a project report for an AI-Driven Newsletter with Website, submitted by a group of students for their Bachelor of Technology degree in Artificial Intelligence and Machine Learning. It outlines the project's objectives, methodology, and the motivation behind creating a dynamic and personalized newsletter service that leverages AI for content curation. The report also includes acknowledgments, a literature review, and a detailed structure of the project, emphasizing the need for a more flexible approach to newsletter subscriptions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

all_doc

The document is a project report for an AI-Driven Newsletter with Website, submitted by a group of students for their Bachelor of Technology degree in Artificial Intelligence and Machine Learning. It outlines the project's objectives, methodology, and the motivation behind creating a dynamic and personalized newsletter service that leverages AI for content curation. The report also includes acknowledgments, a literature review, and a detailed structure of the project, emphasizing the need for a more flexible approach to newsletter subscriptions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

AI-DRIVEN NEWSLETTER WITH WEBSITE

A Project Report
submitted in partial fulfillment of the
requirements for the award of the degree of

Bachelor of Technology
In
Artificial Intelligence and Machine Learning
by
B. Guna Sri Rama Santosh (21H71A6107) P. Chandra mouli (21H71A6105)
K. Venkata Surendra Dattu (21H71A6163) T. Rohith Sai (21H71A6136)

Under the esteemed guidance of


Mr. B. Murali krishna
Assistant Professor

Department of Artificial Intelligence

DVR & Dr. HS


MIC College of Technology
(Autonomous)

Kanchikacherla– 521180, NTR Dist, Andhra Pradesh

March, 2025

i
DECLARATION

We here by declare that

a. The work contained in this report is original and has been done by us under
the guidanceof our supervisor(s).

b. The work has not been submitted to any other Institute for obtaining any degree
or diploma.

c. We have followed the guidelines provided by the Institute in preparing the report.

d. We have conformed to the norms and guidelines given in the Ethical Code of
Conduct of the Institute.

e. Whenever we have used materials (data, theoretical analysis, figures, and text)
from other sources, we have given due credit to them by citing in the text of the
report and giving their details in the references.

Place: Kanchikacherla

Date: 17th Mar, 2025

TEAM MEMBERS

B. Guna Sri Rama Santosh (21H71A6107)


K. Venkata Surendra Dattu (21H71A6163)
P. Chandra mouli (21H71A6105)
T. Rohith Sai (21H71A6136)

ii
CERTIFICATE

This is to certify that the project report entitled “AI-Driven Newsletter with
Website” submitted by B. Guna Sri Rama Santosh (21H71A6107), K. Venkata
Surendra Dattu (21H71A6163), P. Chandra mouli (21H71A6105), T. Rohith Sai
(21H71A6136) to the DVR & Dr. HS MIC College of Technology in partial
fulfillment of the requirements for the award of the Degree Bachelor of Technology in
Artificial Intelligence and Machine Learning is a bonafide record of work carried
out by him/her under my/our guidance and supervision. The contents of this report, in
full or in parts, have not been submitted to any other Institute for the award of any
Degree.

Supervisor Head of the Department

Principal

Internal Examiner External Examiner

iii
ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of any task would be
incomplete without the mention of the people who made it possible and whose constant
guidance and engagement crown all the efforts with success. We thank our college
management and respected Sri D. PANDURANGA RAO, CEO for providing us the
necessary infrastructure to carry out the project work.

We express our sincere thanks to our beloved Principal Dr. T. Vamsee Kiran who has
been a great source of information for our work.

We would like to express our sincere thanks to Dr. G. Sai Chaitanya Kumar, Head,
Department of AI for extending his support to carry on this project work.

We would like to thank my project supervisor, Mr. B. Murali Krishna, Assistant


Professor, Department of AI for the guidance and support, especially for the valuable
ideas and knowledge shared to me throughout the Project.

We take this opportunity to express our thanks to one and all who directly or indirectly
helped us in bringing this effort to present form.

Finally, my special thanks go to my family for their continuous support and help
throughout my academic years and for their continual support and encouragement for
the completion of the project.

iv
CONTENTS

PAGE SECTIONS (if any) PAGE


NO.
TITLE I
DECLARATION II
CERTIFICATION III
ACKNOWLEDGEMENT IV
CONTENTS V
LIST OF FIGURES VII
LIST OF TABLES VIII
LIST OF ABBREVATIONS IX
ABSTRACT X
CHAPTER 1: 1.1 Introduction 1
INTRODUCTION 1.2 Motivation 2
1.3 Problem Statement 2
1.4 Objective of the project 3
CHAPTER 2: 2.1 Introduction 5
LITERATURE REVIEW 2.2 Traditional Newsletter Models 5
2.3 AI in CC & Personalization 5
2.4 Challenges in existing solution 6
2.5 Gap in Knowledge 6
CHAPTER 3: 3.1 Research Approach and Justification 7
METHODOLOGY 3.2 Methods Used 11
3.3 Why this Method is Appropriate ? 13
3.4 Data Collection & Processing 16
3.4.1 Data Collection
3.4.2 Data Processing
3.4.3 Automated Workflow
3.5 Workflow of the Methodology 19
3.6 Architecture 21
3.7 System Analysis 23
3.7.1 Functional Requirements

v
3.7.2 Non-Functional Requirements
3.8 System Specifications 26
3.9 UML diagrams 28
3.9.1 Use Case Diagram
3.9.2 Class Diagram
3.9.3 Sequence Diagram
3.9.4 Activity Diagram
3.10 Cost Analysis 39
CHAPTER 4: 4.1 Setting Up React & Material-UI 41
SOFTWARE 4.2 Setting Up Crew AI & Backend 43
INSTALLATION Services
CHAPTER 5: 5.1 Code Structure 48
IMPLEMENTATION 5.2 API Integration 51

CHAPTER 6: 6.1 Demonstration of Webpage 53


RESULT ANALYSIS 6.2 Newsletters Example in Webpage 58
6.3 Newsletter Via Mail 59
6.4 Performance 60
CHAPTER 7: 7.1 Planned Enhancements 62
FUTURE WORK 7.1.1 Multi-Topic Newsletter
7.1.2 Prompting-Based Topic Sel.
7.1.3 Multi-Threading Using R & C
7.1.4 Cloud Deployment
CHAPTER 8: 8. Conclusion 64
CONCLUSION

CHAPTER 9: 9. References 65
REFERNCES

vi
LIST OF TABLES

S.no Name Page No


3.1 Comparison with Other Software Development Models 10

5.1 API Integration 51

6.1 Performance Insights of Open AI & Deep Seek 60

7.1 Multi-topic Newsletter 62

7.2 Multi-Threading Using Redis & Celery 63

vii
LIST OF FIGURES

Fig no Name Page no


3.1 User Interaction with News Crew System 30

3.2 Admin Management of NewsCrew System 31

3.3 Class Diagram 34

3.4 Sequence Diagram 37

3.5 Activity Diagram 38

6.1 Landing Page 53

6.2 Signup Page 54

6.3 Signin Page 54

6.4 Admin dashboard 55

6.5 Users and subscribers 55

6.6 Access the Articles to View or delete 56

6.7 Settings to send newsletter and updating the topics 56

6.8 Users Dashboard 57

6.9 User settings to change the topic 57

6.10 Newsletters Example in Webpage 58

6.11 Newsletters Via Mail 59

6.12 OpenAI Dashboard 61

viii
LIST OF ABBREVIATIONS

WORD ABBREVIATION

REST Representational State Transfer

DRF Django REST Framework

AI Artificial Intelligence

API Application Program Interface

LLM Large Language Model

CRUD Create, Read, Update, Delete

JWT JSON Web Token

SMTP Simple Mail Transfer Protocol

UI User Interface

CORS Cross-Origin Resource Sharing

ix
ABSTRACT
In today's fast-paced digital world, staying updated with the latest news and trends is
more important than ever. With an overwhelming amount of information available
online, finding relevant and credible content can be a challenge. Our project, AI-Driven
Newsletter with Website, is designed to solve this problem by offering users a
personalized and automated newsletter service that delivers curated news based on their
interests. By leveraging artificial intelligence and automation, this platform ensures that
users receive timely, well-structured, and insightful news updates without the need to
sift through countless sources.

The system is built using a robust technology stack, combining Django for backend
processing and React for an interactive frontend, seamlessly integrated through a REST
API. The platform is designed to offer a smooth and user-friendly experience, featuring
a modern landing page that showcases the latest articles, a seamless subscription
process for personalized newsletters, and essential authentication functionalities such
as login, signup, and password recovery. Every component is designed to provide a
secure and efficient interaction for users, ensuring ease of access while maintaining
data integrity.

By combining artificial intelligence, intuitive design, and automated workflows, our AI


Newsletter with Website provides users with a smarter, more efficient way to stay
informed. Whether they are casual readers or industry professionals, this platform offers
a seamless and convenient solution for accessing the news that matters most.

Keywords: AI Newsletter, Django, React, REST API, CrewAI, Deepseek, SMTP,


Markdown, Axios, Token Authentication

x
CHAPTER 1

INTRODUCTION
1.1 Introduction

The advent of digital newsletters has revolutionized the way users consume content,
offering curated information on various topics of interest. However, most existing
newsletters are static, requiring users to subscribe to fixed topics with little flexibility.
In the era of artificial intelligence (AI), there is a growing need for a more dynamic and
personalized approach to news consumption.

With the rapid expansion of digital media and information overload, users often
struggle to find high-quality content tailored to their evolving interests. Traditional
newsletter services require users to manually search for, subscribe to, and unsubscribe
from newsletters based on their preferences. This process is cumbersome and does not
accommodate users who wish to frequently change their topics of interest without
repeated manual intervention.

This project leverages AI agents to create a dynamic newsletter subscription platform


that allows users to receive personalized content on topics of their choice. Unlike
traditional newsletters, which require users to manually search for and subscribe to
specific topics, this system provides a single platform where users can modify their
interests at any time. Additionally, users can access previous newsletters and even
combine multiple topics into a single newsletter using basic prompting. The backend is
built using Django REST Framework (DRF) and CrewAI, while the frontend is
developed using React and Vite, with Supabase (Postgres) as the database.

By integrating AI-driven content aggregation, this project ensures that users stay
informed on their preferred topics while avoiding redundant searches and subscription
management. The automated system saves time, improves user experience, and
enhances content discovery by utilizing AI-powered curation and retrieval mechanisms.

1
1.2 Motivation

The motivation for this project stems from the increasing demand for personalized
content consumption. Many users subscribe to newsletters based on their interests, but
over time, these interests may change. Currently, finding new newsletters and
unsubscribing from old ones is a repetitive and time-consuming process. Our project
eliminates this hassle by allowing users to dynamically modify their newsletter
preferences in a single platform.

Additionally, as the volume of online content continues to grow, users are often
overwhelmed by information scattered across various sources. Our project provides an
AI-assisted solution that curates and delivers relevant content directly to users, ensuring
they receive high-quality, topic-specific newsletters without the need for extensive
searching.

Furthermore, AI advancements have enabled the development of intelligent agents


capable of automating content curation. This project explores the practical application
of AI-driven content generation and distribution, making it more accessible and user-
friendly. By integrating AI agents, we provide a seamless experience where users
receive weekly newsletters tailored to their evolving interests without manually
searching for new subscriptions.

The ability to modify newsletter preferences on-demand is another crucial motivation


behind this project. Users can explore new topics without the hassle of unsubscribing
from one newsletter and subscribing to another. Additionally, the inclusion of historical
newsletters allows users to revisit past editions, ensuring they never miss out on
important content.

1.2 Problem Statement

Traditional newsletter platforms have limitations that hinder user flexibility and
engagement. The main challenges include:

2
• Fixed topic subscriptions that require manual searching and subscribing.
• Lack of dynamic modification options, forcing users to repeat the subscription
process if their interests change.
• Inability to receive multiple topics within a single newsletter.
• No access to previous newsletters once delivered.
• The overwhelming volume of online content makes it difficult to find reliable,
relevant information.
• Users are required to manage multiple newsletter subscriptions manually, which
is time-consuming and inefficient.

To address these issues, this project introduces an AI-powered solution that provides
users with a dynamic newsletter experience, allowing them to modify topics, receive
multi-topic newsletters, and access historical newsletters seamlessly. By leveraging
CrewAI, our system intelligently curates content from various sources, ensuring users
receive the most relevant and up-to-date information on their selected topics.

Moreover, the integration of AI-driven content retrieval minimizes the effort required
for users to stay informed, providing a more convenient and engaging content
consumption experience. This project aims to fill the gap in existing newsletter
solutions by offering a more adaptable and user-centric approach to news delivery.

1.3 Objective of the Project

The primary objectives of this project are:

1. To develop a dynamic newsletter platform that enables users to select and


modify topics of interest at any time.
2. To implement AI-powered content generation and curation using CrewAI
agents for personalized newsletter delivery.
3. To provide a seamless user experience through a web-based platform built using
Django (DRF) for the backend and React (Vite) for the frontend.
4. To allow users to access previous newsletters and integrate multiple topics into
a single newsletter using basic prompting.
5. To eliminate the hassle of repeatedly searching for and subscribing to new
newsletters as user interests evolve.

3
6. To automate content discovery and delivery using AI, reducing the need for
manual intervention.
7. To enhance user engagement by providing high-quality, relevant, and up-to-
date information on chosen topics.

By achieving these objectives, the project aims to enhance the flexibility and efficiency
of content consumption, leveraging AI to deliver a truly personalized newsletter
experience. This innovative approach to newsletter subscription and delivery sets a new
standard in how users engage with digital content, making the entire process more
interactive, adaptive, and user-friendly. The integration of AI not only improves content
discovery but also ensures that users remain engaged with the most relevant and timely
information in their areas of interest.

4
CHAPTER 2

LITERTATURE REVIEW
2.1 Introduction
A literature review serves as a critical evaluation of previous research related to a
specific area of study. This chapter aims to explore existing work on newsletters, AI-
driven content curation, and personalization techniques in news delivery. By assessing
prior research, we identify gaps in knowledge and establish the foundation for our study
on AI-powered dynamic newsletters.

2.2 Traditional Newsletter Models


Traditional newsletters have long been used to disseminate information on various
topics. These newsletters typically require users to subscribe to fixed topics and receive
periodic updates. Research by Smith et al. (2019) highlights that while newsletters
provide valuable content, they lack flexibility and do not cater to evolving user interests.
Users must manually search for new newsletters when their interests change, leading to
a time-consuming and repetitive subscription process.

Medium and Substack are popular newsletter platforms that allow content creators to
send personalized newsletters to subscribers. However, studies indicate that these
platforms rely on rigid subscription models, limiting user control over content
preferences. This gap underscores the need for a more dynamic approach that enables
real-time modification of subscription topics.

2.3 AI in Content Curation and Personalization


Artificial intelligence has revolutionized content delivery by offering personalized
recommendations based on user behavior. Platforms such as Google News and
Flipboard employ AI-driven algorithms to filter and suggest content based on users'
reading habits. According to a study by Kumar & Patel (2022), AI-powered
recommendation systems improve user engagement and satisfaction by presenting
relevant content dynamically.

However, while these platforms provide real-time content recommendations, they do


not offer structured newsletters that allow users to modify their topics of interest.

5
Current AI-driven content curation primarily focuses on passive recommendations
rather than proactive user-controlled personalization. This gap highlights the need for a
hybrid model that combines AI-based personalization with user-driven customization.

2.4 Challenges in Existing Solutions


Despite advancements in AI and content personalization, existing newsletter solutions
face several challenges:

• Fixed Subscription Models: Most newsletter services do not allow users to


modify their topic preferences dynamically.

• Manual Subscription Management: Users must manually search for, subscribe


to, and unsubscribe from newsletters based on their changing interests.

• Limited Multi-Topic Integration: Current newsletters typically focus on a single


topic rather than offering multi-topic customization within a single issue.

• Lack of Access to Previous Newsletters: Most platforms do not provide users


with an archive of their previously received newsletters.

Research by Johnson et al. (2021) suggests that an effective newsletter system should
allow for dynamic customization and historical access, which are currently absent in
mainstream platforms.

2.5 Gap in Knowledge


Existing research has extensively covered AI-driven content recommendations and
traditional newsletters separately, but little attention has been given to integrating AI-
powered dynamic topic selection into newsletter systems. This study aims to bridge this
gap by developing an AI-driven newsletter platform that allows users to:

1. Dynamically modify their topic preferences.

2. Receive multi-topic newsletters in a single issue.

3. Access previously delivered newsletters for reference.

6
CHAPTER 3

METHODOLOGY
3.1 Research Approach and Justification
The AI-powered Dynamic Newsletter System is developed using an Incremental
Model, which allows for the step-by-step enhancement of features while continuously
refining the system based on user feedback. The project integrates CrewAI, Django
REST Framework (DRF), React, and Supabase (PostgreSQL) to provide personalized
and dynamic newsletters on user-selected topics.

Research Approach

The research approach for this project follows a modular and iterative development
strategy, ensuring a structured yet flexible framework for implementation. The key
aspects of this approach include:

1. Incremental Development – The system is built in multiple, functional


increments, where each phase delivers a core feature. This ensures a smooth
transition from development to deployment.

2. AI-Driven Personalization – The project leverages AI agents via CrewAI to


dynamically fetch, summarize, and curate news articles based on user
preferences.

3. RESTful API Architecture – The backend is developed using Django REST


Framework (DRF), ensuring a modular, scalable, and secure system.

4. User-Centric Design – A React-based frontend is built to provide an intuitive


and user-friendly interface for managing subscriptions, accessing past
newsletters, and modifying preferences dynamically.

5. Database and Cloud Integration – Supabase, an open-source PostgreSQL


backend, is integrated for efficient data storage and real-time updates.

Incremental Model for Development

The Incremental Model was chosen because it enables step-by-step development and
testing, ensuring that each component is fully functional before adding new features.
Unlike traditional models like the Waterfall approach, which requires the entire system

7
to be built before testing, the incremental model allows for early detection of issues and
continuous refinement. This flexibility is crucial, as the project integrates multiple
technologies, including CrewAI, Django REST Framework (DRF), React, and
Supabase (PostgreSQL).

The project was divided into different functional increments, including:

• User Authentication & Profile Management – Implementing sign-up, login, and


secure authentication mechanisms.
• News Retrieval & AI Summarization – Integrating AI-based summarization
models to generate meaningful insights.
• Subscription Management – Allowing users to select, modify, and track their
newsletter topics.
• Automated Newsletter Dispatch – Ensuring timely email delivery using
background tasks.
• User Dashboard & Previous Newsletters – Providing an interface for users to
manage preferences and access historical newsletters.

By implementing the system incrementally, we minimized risks and ensured that each
feature was well-integrated and optimized before moving to the next stage.

Justification for the Incremental Model

The Incremental Model was chosen due to its suitability for AI-driven applications that
require scalability, flexibility, and continuous learning from user interactions. The
major reasons behind selecting this model include:

1. Scalability & Modularity – Each component (user authentication, AI


summarization, subscription management, newsletter dispatch) is developed
and tested independently before integrating into the system.

2. Continuous Enhancement – AI-based models for news retrieval and


summarization can be improved over time without disrupting other
functionalities.

3. Risk Reduction – The development and integration of features occur in phases,


ensuring that early detection of errors or limitations can prevent major failures.

8
4. User Engagement & Feedback Loop – The model allows for the deployment of
initial features for early adopters, ensuring improvements are made based on
real-time feedback.

5. Efficient Resource Utilization – By implementing the system in increments,


development resources (both time and computational power) are optimized
effectively.

Implementation Phases

The system was implemented incrementally, with each phase focusing on core
functionality. This modular development ensures that each component is independently
functional while seamlessly integrating into the entire system.

Phase 1: Core Backend & API Development

• Implemented Django REST Framework (DRF) to structure the backend and API
functionalities.

• Established token-based authentication for secure access.

• Designed and developed the news fetching API to retrieve articles from external
sources like OpenAI, DeepSeek, and other providers.

• Built AI-based summarization models using CrewAI to generate concise,


readable newsletters.

Phase 2: Frontend Development and User Interaction

• Developed a React-based UI for seamless user interaction.

• Integrated API endpoints to allow users to sign up, log in, and select their
newsletter preferences.

• Designed a dashboard for users to access past newsletters and modify their
topics of interest dynamically.

Phase 3: Subscription Management and Newsletter Dispatch

• Implemented subscription management, allowing users to subscribe to multiple


topics.

• Built a system for guest subscriptions, where users can receive newsletters
without registering.

9
• Automated the newsletter dispatch system, ensuring timely and formatted email
delivery using background tasks.

Phase 4: Performance Optimization and AI Enhancements

• Integrated multi-topic selection, allowing users to specify multiple areas of


interest in a single newsletter.

• Enhanced the AI-driven summarization for improved readability and relevance.

• Optimized database queries in Supabase (PostgreSQL) for faster retrieval and


scalability.

• Implemented caching mechanisms to reduce API response times and server


load.

Phase 5: Security and Scalability Enhancements

• Implemented token-based authentication to prevent unauthorized access.

• Added rate limiting to prevent abuse of API endpoints.

• Enforced encryption of sensitive user data to ensure data security.

Comparison with Other Software Development Models

Development
Advantages Disadvantages Applicability to Project
Model

Rigid, not flexible for Not suitable as AI-based


Waterfall Clear structure,
AI-based applications require
Model easy to manage
improvements continuous updates

Requires active Good for rapid prototyping


Iterative, user
Agile Model collaboration, but may not suit structured
feedback-driven
constant adjustments AI pipeline development

Modular,
Requires careful Best suited for AI-driven,
Incremental scalable,
planning to avoid user-interactive
Model continuous
integration issues applications like ours
refinement

Table 3.1

10
The Incremental Model is the best fit because it allows for a structured yet flexible
development approach, ensuring that both AI-based improvements and user feedback
integration are seamlessly incorporated into the system.

3.2 Methods Used


The AI-powered Dynamic Newsletter System integrates multiple methodologies and
technologies to ensure seamless automation, personalization, and user engagement. The
key methods used in the system's development include:

1. AI-Driven News Retrieval & Summarization

Method: CrewAI for Intelligent News Processing

• CrewAI agents are used to fetch and summarize news articles based on user-
defined topics.

• The AI models leverage LLM-based APIs (OpenAI, DeepSeek, etc.) to generate


concise, readable, and engaging summaries.

• The system supports basic prompting, enabling users to receive newsletters on


multiple topics within a single dispatch.

Why this Method?

• Ensures personalized and dynamic content generation.

• Eliminates the need for manual curation, making newsletters real-time and
contextually relevant.

• Allows users to change preferences dynamically, eliminating the need to search


for different newsletters.

2. Backend Development & API Architecture

Method: Django REST Framework (DRF) for API Development

• Django REST Framework (DRF) provides a scalable and modular API backend.

• Implements CRUD operations for managing users, newsletter subscriptions,


and previous editions.

• Uses token-based authentication to ensure secure access to user data.

11
Why this Method?

• Scalability: Ensures the system can handle growing user traffic and expanding
datasets.

• Security: Protects user data and authentication mechanisms through JWT-based


authentication.

• Modular Approach: API endpoints enable seamless integration with various


frontend and external services.

3. Frontend Development

Method: React.js for Dynamic User Interface

• The React.js framework is used to build an intuitive and responsive web


interface.

• Provides users with the ability to:

o Sign up/Login

o Select & modify newsletter topic

o View past newsletters

Why this Method?

• Efficient State Management: Uses React’s state management to dynamically


update user preferences.

• Component-Based Architecture: Ensures reusability and modularity for easy


updates.

• Seamless API Integration: Fetches and updates user data in real time from the
backend.

4. Database Management

Method: Supabase (PostgreSQL) for Data Storage

• Supabase, an open-source alternative to Firebase, is used as the backend


database.

• Stores user information, subscription details, and past newsletters.

• Supports real-time updates, allowing dynamic changes to user preferences.

12
Why this Method?

• Real-Time Capabilities: Updates user selections and subscription status


instantly.

• Scalability: Efficiently handles large datasets, ensuring smooth performance.

• Security Features: Provides role-based access control (RBAC) to protect


sensitive user data.

5. Token-Based Authentication for User Security

Why This Method?

• Simplicity: Token-based authentication is easy to implement and manage,


making it an ideal choice for this project.

• Statelessness: The authentication system does not rely on sessions, reducing


server-side overhead.

• Security: Each API request requires a valid authentication token, ensuring


secure access to user data and protected newsletter subscriptions.

• Integration: Works seamlessly with Django REST Framework (DRF), making


it easier to authenticate users accessing the API.

3.3 Why This Method Was Most Appropriate?


The chosen methodology for developing the AI-powered dynamic newsletter system is
the Incremental Model, combined with RESTful API architecture and Basic Token
Authentication. This methodology was selected after carefully analyzing the project
requirements, ensuring a balance between scalability, efficiency, and user experience.
The incremental development approach allows for systematic improvements over time,
while the token-based authentication mechanism ensures secure and seamless user
interactions.

Personalized and Dynamic Newsletter Experience

The primary objective of this project is to offer personalized news updates based on
user interests. Traditional newsletter services require users to subscribe separately for
different topics, and if their interests change, they must unsubscribe and find new
sources. This process is time-consuming and often frustrating.

13
In contrast, our AI-powered dynamic newsletter system provides a seamless experience
where:

• Users select one topic of interest and receive news articles tailored to it.
• The system aggregates high-quality content from multiple sources, ensuring up-
to-date and relevant information.
• If a user loses interest in a topic, they can change their preference instantly
through the website, eliminating the need for multiple subscriptions.
• Users can also access their previous newsletters, allowing them to revisit past
news insights.
• This dynamic and user-centric approach makes the system more engaging and
efficient compared to existing solutions.

Why Basic Token Authentication Over JWT?

For authentication, Basic Token Authentication was chosen over JWT (JSON Web
Token) because it provides a simpler, more lightweight solution. JWT is commonly
used for authentication in highly distributed systems, but it comes with additional
overhead, such as token verification on each request and security considerations like
token expiration and refresh mechanisms.

Our project, being a newsletter-based system, does not require complex authentication
flows. Instead, a token-based approach ensures:

• Secure user authentication with minimal overhead.


• Easy implementation and integration with Django REST Framework (DRF).
• Quick validation without the need for decoding and signature verification, as
seen in JWT-based systems.
• Efficient handling of API requests without adding unnecessary computational
load.
• With this approach, users can securely log in and manage their newsletter
preferences while ensuring that the authentication mechanism remains simple,
effective, and scalable.
• RESTful API for Scalability and Seamless Communication

The backend architecture follows RESTful API principles, ensuring a modular and
scalable system. This design allows for smooth communication between the frontend

14
(React) and backend (Django + Supabase), making it easy to expand and integrate
additional features in the future.

Key benefits of using a RESTful API include:

• Separation of concerns – The backend focuses on data processing, while the


frontend handles user interactions.
• Scalability – New endpoints can be added without disrupting existing
functionalities.
• Interoperability – The API can be extended for mobile applications or third-
party integrations if required in the future.
• Performance optimization – Using caching mechanisms and database indexing
for faster response times.

The REST API-based architecture ensures that the system remains future-proof while
providing an efficient mechanism for handling dynamic content delivery.

AI-Powered Summarization for Better Content Delivery

A key differentiator of this system is the use of AI-based summarization to generate


concise and meaningful news highlights. Many traditional newsletters provide lengthy,
unfiltered news articles, making it difficult for users to quickly grasp key points.

Our system enhances content delivery by:

• Filtering out duplicate or irrelevant content from multiple news sources.


• Applying AI-based summarization to generate short, informative summaries.
• Ensuring better readability and engagement by presenting only the most
important details.
• This approach ensures that users receive high-quality, digestible news updates
without having to go through long-form articles.

Automation for Efficient Newsletter Dispatch

The system employs automated scheduling to ensure that newsletters are delivered on
time without manual intervention.

The newsletter dispatch mechanism includes:

• Content curation and formatting – Selecting relevant articles and structuring


them in a visually appealing format.

15
• Automated email delivery – Using background tasks to send newsletters at
scheduled intervals.
• Failure handling and retries – Ensuring reliability even if temporary failures
occur during dispatch.
• By automating this process, we enhance system efficiency, allowing users to
receive timely updates without delays.

Security Measures and Performance Optimization

To maintain security and protect user data, several measures have been implemented,
including:

• Basic Token Authentication to prevent unauthorized access.


• Rate limiting to prevent API abuse and excessive requests.
• Data encryption for sensitive user information, ensuring privacy.
• Caching mechanisms to optimize response times and reduce server load.
• These security and optimization strategies ensure that the system remains
reliable, efficient, and secure for all users.

3.4 Data Collection & Processing


Since our AI-powered newsletter system is designed to fetch and process news using
OpenAI and DeepSeek, the methodology focuses on utilizing LLM-based content
retrieval instead of traditional web scraping or APIs. This section outlines how data is
fetched, processed, and structured for personalized newsletter delivery.

3.4.1 Data Collection

Instead of collecting data from multiple APIs or scraping sources, our system directly
interacts with OpenAI and DeepSeek models to generate relevant news articles based
on the user's selected topic. This approach ensures:

• Fresh and up-to-date information tailored to the user's interest.

• Elimination of duplicate or low-quality sources, as LLMs generate or retrieve


refined content.

• No dependency on external news providers, reducing API rate limits and


restrictions.

16
OpenAI & DeepSeek for News Fetching

The system queries OpenAI's GPT-4o or DeepSeek's DeepSeek-Chat model with


prompts designed to:

• Retrieve the latest news related to a specific topic.

• Summarize and format the news for better readability.

• Generate insights and key takeaways for the user.

The NewsletterAgents module manages different LLM-based agents, such as:

• News Fetching Agent – Queries OpenAI or DeepSeek for relevant news based
on user input.

• News Analysis Agent – Extracts key points, trends, and contextual information.

• Editor Agent – Enhances the readability and flow of the generated content.

• Newsletter Compiler – Organizes and formats the content for structured email
delivery.

Dynamic Inputs for Personalized News

Each newsletter request dynamically generates customized news articles based on:

• User-selected topic (e.g., "AI advancements", "Stock Market Updates").

• Timestamp of request to fetch the latest updates.

• Keyword-based search prompts tailored to extract meaningful insights.

This eliminates the need for pre-stored data, making the process fully real-time and
personalized.

3.4.2 Data Processing

Once news content is generated by LLMs, it undergoes multiple processing steps to


ensure clarity, accuracy, and user engagement.

1. AI-Based Summarization & Structuring

Instead of sending full-length news articles, the system:

• Condenses information into easy-to-read summaries.

• Highlights key takeaways to improve comprehension.

17
• Adds context using AI-powered insights.

For instance, a Finance Newsletter would include:

• Market Trends – Summary of major market shifts.

• Stock Performance – Highlights of top-gaining and losing stocks.

• Expert Predictions – AI-generated analysis based on historical data.

This structured approach improves user retention and engagement.

2. Formatting & Content Refinement

Before sending, the Newsletter Compiler Agent:

• Formats the news in structured HTML for email delivery.

• Removes redundant or irrelevant details.

• Ensures consistency in tone and style for better readability.

3.4.3 Automated Workflow

3.1 Workflow of the System

1. User sets a topic → (e.g., "AI Trends")

2. News Fetching Agent queries OpenAI/DeepSeek → Retrieves latest news.

3. News Analysis Agent extracts key insights → Identifies trends, risks, and
summaries.

4. Newsletter Compiler organizes content → Formats and structures it for email.

5. Newsletter is sent to the user in a readable format.

3.2 CrewAI-Based Processing

The CrewAI framework manages the workflow, ensuring:

• Hierarchical Processing – Agents work in a structured manner.

• Dynamic Task Execution – Each task runs with fresh context.

• Automated Saving & Formatting – Outputs are stored efficiently.

18
3.5 Workflow of the Proposed Methodology
The NewsCrew System is designed to provide automated, AI-driven news fetching,
processing, personalization, and delivery. This workflow leverages ChatGPT API,
DeepSeek API, and Crew AI to ensure real-time, high-quality, and personalized news
content for users. The system follows a structured approach, moving through several
key stages:

Step 1: News Fetching (Using ChatGPT API & DeepSeek API)

At this stage, the system collects news from various online sources using ChatGPT API
and DeepSeek API. The purpose is to fetch the latest news articles, summarize them,
and filter out unnecessary information. The steps involved are:

1. Data Collection:

o The system sends API requests to ChatGPT and DeepSeek to gather


news articles from different online sources, including news websites,
blogs, and media platforms.

o News is retrieved in real-time to ensure up-to-date information is


available.

2. Content Summarization:

o The collected news articles are often lengthy. ChatGPT processes and
generates concise summaries to extract the most relevant points.

o The system ensures that unnecessary details, duplicate articles, and


redundant data are removed.

3. Content Categorization:

o The AI model classifies news articles into predefined categories such as


Politics, Technology, Business, Entertainment, Sports, and Health.

o This categorization helps in delivering personalized news to users based


on their interests.

Step 2: News Processing & Analysis (Using Crew AI)

Once the news articles are collected, the system processes them further to enhance
readability, relevance, and personalization.

19
1. Text Cleaning & Preprocessing:

o Irrelevant metadata, advertisements, and non-informative content are


removed.

o The text is formatted for better readability.

2. Duplicate Detection & Filtering:

o The AI system checks for repeated news from multiple sources and
removes redundant information to avoid spam-like content.

Step 3: User Selection & Personalization

The system ensures that each user receives customized news updates based on their
preferences.

1. User Subscription & Preference Settings:

o Users register and set preferences for news topics, sources, and
notification frequency.

o Preferences can be updated anytime through the user dashboard.

2. AI-Powered Recommendation System:

o The Crew AI agents analyze user behavior, reading patterns, and


previously accessed articles to improve recommendations.

o Articles are ranked based on relevance, sentiment, and user interest.

3. Automated Content Curation:

o News articles are filtered, sorted, and ranked for each user based on their
past interactions and reading history.

o Trending News & Breaking Updates are prioritized.

Step 4: Content Delivery & User Interaction

Once news articles are processed and personalized, they are delivered to users through
multiple channels:

1. Personalized Newsletters (Email-Based Delivery)

o Users receive daily or weekly newsletters containing handpicked news


articles based on their preferences.

20
2. Web Dashboard (On-Demand Access)

o Users can log in to their dashboard to browse the latest news and manage
subscriptions.

3. Push Notifications for Breaking News

o The system sends instant notifications for high-impact or trending news.

4. User Feedback Loop for Continuous Improvement

o Users can like, dislike, or mark articles as irrelevant, helping the system
improve future recommendations.

3.6 Architecture
The architecture of our NewsCrew System is designed for efficient news processing,
personalization, and delivery using React Vite for the frontend, Django with Django
REST Framework (DRF) for the backend, and third-party AI APIs for content
processing. The system follows a modular architecture with clear separations between
frontend, backend, and external services.

The system consists of the following key components:

1. Frontend (React )

• Provides a user-friendly interface for visitors and registered users.


• Allows users to subscribe to newsletters, manage subscriptions, and read AI-
curated news.
• Communicates with the backend via RESTful API requests.

2. Backend (Django & Django REST Framework)

• Manages user authentication, subscriptions, and news processing.


• Fetches and processes news using AI-powered APIs (ChatGPT API &
DeepSeek API).
• Handles interactions between the frontend and AI APIs.
• Stores and retrieves user preferences in a database.

3. APIs & External Services

• ChatGPT API & DeepSeek API: Used to fetch and process news articles
for better readability and summarization.

21
• Crew AI: Manages AI-driven news selection and categorization.
• Database (PostgreSQL or SQLite): Stores user details, preferences, and
processed news articles.

System Architecture Diagram

High-Level Workflow

1. User Registration & Login

• Users register or log in via the frontend (React Vite).


• Authentication is handled via Django REST Framework (JWT or Session
Authentication).

2. News Fetching & Processing

• Django backend sends requests to ChatGPT API & DeepSeek API for news
retrieval.
• Crew AI processes the news for topic-based categorization and
personalization.

3. Subscription Management

• Users can subscribe or change topics (instead of searching).


• The system updates user preferences and modifies the news selection
accordingly.

4. News Delivery

• Processed and categorized news is stored in the backend.


• Users receive personalized news on their dashboard.

Architecture Diagram Components

• Frontend (React Vite)

o UI components
o User authentication
o Subscription management
o API integration

22
• Backend (Django & DRF)

o User authentication
o News fetching
o AI processing integration
o Database management

• APIs & External Services

o ChatGPT API
o DeepSeek API
o Crew AI for intelligent processing

3.7 System Analysis


System analysis plays a crucial role in defining the scope, requirements, and
performance expectations of our AI-powered news delivery system. This section
elaborates on the functional and non-functional aspects of the system, ensuring smooth
operation and efficient user experience.

3.7.1 Functional Requirements

Functional requirements specify the core operations that the system must perform to
meet user expectations.

1. News Fetching & Generation

• The system integrates advanced AI models like ChatGPT API, DeepSeek API,
and CrewAI to fetch and generate news articles dynamically.

• The APIs work collaboratively to analyze various sources and generate concise,
well-structured news summaries.

• News articles are categorized based on relevance and user interest.

2. User Management

• Users must create an account and log in to access the platform.

• The system stores user preferences and allows them to modify their topic
selection after login.

• A search function is not included; instead, users can change their news
categories through the profile settings.

23
3. News Processing & Customization

• AI models process the fetched news content, ensuring it aligns with user
interests.

• The platform ensures high-quality, factual, and relevant news by filtering


redundant or misleading information.

• Personalized recommendations are generated based on previous user


interactions.

4. News Delivery System

• News articles are delivered directly to users via email using Google SMTP.

• The email service ensures reliability and security while distributing news
updates.

• Users receive scheduled news digests based on their preferences.

5. User Interface (UI) & Interaction

• The UI is designed using React Vite, ensuring a fast and responsive frontend
experience.

• Users can view news articles, update preferences, and receive notifications.

• The system maintains a minimalistic and intuitive design for better usability.

3.7.2 Non-Functional Requirements

Non-functional requirements define how the system performs under various conditions
and ensure efficiency, security, and reliability.

1. Performance

• The system must efficiently fetch, process, and deliver news articles with
minimal response time.

• Optimized API calls reduce latency, ensuring quick retrieval and delivery of
news.

• Efficient caching techniques help store frequently accessed data, improving


performance.

24
2. Scalability

• The backend, developed using Django REST Framework, supports multiple


concurrent users without performance degradation.

• The system is designed to handle increased traffic and can integrate additional
APIs for news aggregation in the future.

• The architecture allows easy upgrades and feature expansions.

3. Security

• User authentication is managed using Django’s built-in security mechanisms,


including hashed passwords and secure API authentication.

• Google SMTP ensures secure email communication, preventing unauthorized


access.

• API keys are stored securely to prevent data leaks and misuse.

• HTTPS and encryption protocols safeguard user data and communication.

4. Reliability & Maintainability

• The system ensures 99.9% uptime, with automatic error handling and recovery
mechanisms.

• Logs and monitoring tools track system performance and detect potential
failures.

• The backend is modular, making it easier to maintain and update components


independently.

5. Usability

• The platform offers a clean and intuitive UI, making navigation easy for all
users.

• The onboarding process is simple, with clear instructions on setting preferences.

• The system is accessible from multiple devices, ensuring a seamless experience


across different platforms.

25
3.8 System Specifications
System specifications define the technologies, frameworks, and tools used in
developing the AI-powered news delivery platform. This section provides an overview
of the tech stack, highlighting the role of each component in ensuring a smooth,
scalable, and efficient system.

Technology Stack

The system is built using modern web technologies, ensuring performance,


responsiveness, and security.

1. Frontend (User Interface & Experience)

• React (Vite Framework):

o Chosen for its fast rendering and efficient development environment.

o Ensures a smooth and interactive user experience.

o Optimized for performance with minimal build time.

• Material-UI (MUI):

o Provides a clean and professional UI design.

o Ensures a consistent and visually appealing user interface.

o Includes pre-built components for faster development.

2. Backend (Business Logic & API)

• Django (Python Web Framework):

o Handles user authentication, data processing, and API interactions.

o Provides built-in security mechanisms, reducing vulnerabilities.

o Ensures easy integration with AI models and email services.

• Django REST Framework (DRF):

o Used to build RESTful APIs for seamless frontend-backend


communication.

o Provides authentication, serialization, and API versioning.

26
3. Database Management

• PostgreSQL:

o Chosen for its scalability, performance, and reliability.

o Stores user preferences, news articles, and system logs.

o Supports advanced queries for efficient data retrieval.

o Ensures data consistency and integrity with ACID compliance.

4. AI Integration & News Processing

• Crew AI:

o Manages the workflow of AI agents handling different tasks.

o Optimizes responses for generating high-quality news articles.

o Coordinates API interactions and content processing.

• ChatGPT API & DeepSeek API:

o Fetches and summarizes news from various sources.

o Ensures relevant, concise, and fact-checked news content.

o Uses AI-driven insights to provide personalized recommendations.

5. Email Delivery System

• Google SMTP (Simple Mail Transfer Protocol):

o Ensures reliable and secure email delivery.

o Sends personalized news summaries to users based on preferences.

o Uses encryption for safe communication.

27
3.9 UML Diagrams
UML stands for Unified Modelling Language. UML is a standardized general-purpose
modelling language in the field of object-oriented software engineering. The standard
is managed, and was created by, the Object Management Group.

The goal is for UML to become a common language for creating models of
objectoriented computer software. In its current form UML is comprised of two major
components: a Meta-model and a notation. In the future, some form of method or
process may also be added to; or associated with, UML.

The Unified Modelling Language is a standard language for specifying, Visualization,


Constructing and documenting the artifacts of software system, as well as for business
modelling and other non-software systems.

The UML represents a collection of best engineering practices that have proven
successful in the modelling of large and complex systems.

The UML is a very important part of developing objects-oriented software and the
software development process. The UML uses mostly graphical notations to express
the design of software projects.

3.9.1 Use Case Diagram


• A use case diagram in the Unified Modeling Language (UML) is a type of
behavioral diagram defined by and created from a Use-case analysis.  Its
purpose is to present a graphical overview of the functionality provided by
a system in terms of actors, their goals (represented as use cases), and any
dependencies between those use cases.
• The main purpose of a use case diagram is to show what system functions
are performed for which actor. Roles of the actors in the system can be
depicted.

Use Case 1: User Interaction with NewsCrew System

Use Case Name: User Interaction

Actors: Visitor, Registered User

28
Description: This use case describes how a user (either a visitor or a registered user)
interacts with the NewsCrew System to browse news, subscribe to newsletters, manage
subscriptions, and access their user dashboard.

Preconditions:

• A visitor can access the website without logging in.

• A visitor can subscribe to newsletters without registration.

• A visitor can sign up to access additional features.

• A registered user can log in to manage their subscription and access the
dashboard.

Basic Flow:

1. A visitor accesses the NewsCrew system.

2. They can browse news articles without logging in.

3. If they wish to subscribe to newsletters, they can enter their email without
registration.

4. If they sign up and log in, they can access additional features.

5. A registered user can manage their newsletter subscriptions.

6. They can view the user dashboard, which includes their subscription details and
personalized content.

Use Case 2: Admin Management of NewsCrew System

Use Case Name: Admin Management

Actors: Admin, System

Description:

This use case details the administrative functions involved in managing newsletters,
users, and automated system tasks.

Preconditions:

• The admin must have valid credentials to log in.

• The system should be running scheduled tasks for automation.

29
Fig 3.1

30
Fig 3.2

Basic Flow:

1. The admin logs into the NewsCrew system.

2. They can access the admin dashboard.

3. The admin can create and manage newsletters.

4. They can process newsletters before sending them out.

5. The admin can send newsletters to both subscribed visitors and registered users.

6. They can manage user accounts, including authentication.

7. The system automatically runs scheduled cron jobs for email delivery and
updates.
31
3.9.2 Class Diagram

In software engineering, a class diagram in the Unified Modeling Language (UML) is


a type of static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, operations (or methods), and the relationships
among the classes. It explains which class contains information

User Class

• Represents a system user (either a registered user or a visitor).

• Attributes:

o id: int → Unique identifier for the user.

o username: String → Name of the user.

o email: String → User’s email address.

o password: String → Encrypted password for login.

• Methods:

o register() : void → Allows a new user to create an account.

o login() : boolean → Authenticates a user based on credentials.

o subscribe(topic: Newsletter) : void → Subscribes the user to a newsletter.

o forgot password() : void → Handles password recovery.

Admin Class

• Represents the system administrator responsible for managing newsletters and


users.

• Methods:

o login() : boolean → Allows the admin to authenticate.

o createNewsletter(topic: String, content: String) : void → Creates a new


newsletter.

o manageUsers() : void → Manages user accounts and subscriptions.

o manageNewsletters() : void → Handles newsletter distribution and editing.

32
o processNewsletter(content: String) : void → Processes and schedules
newsletters for delivery.

o sendNewsletter(content: String, subscribers: String) : void → Sends


newsletters to subscribed users.

Subscription Class

• Represents a user’s subscription to newsletters.

• Attributes:

o id: int → Unique identifier for the subscription.

o useremail: User → The email of the user subscribing to a newsletter.

o topic: Newsletter → The newsletter topic the user subscribes to.

• Methods:

o subscribe() : void → Subscribes the user to a newsletter topic.

o unsubscribe() : void → Unsubscribes the user from the newsletter.

Newsletter Class

• Represents a newsletter containing news articles or updates.

• Attributes:

o id: int → Unique identifier for the newsletter.

o topic: String → The subject or category of the newsletter.

o content: String → The actual newsletter content.

o publishDate: Date → The date when the newsletter is published.

• Methods:

o send() : void → Sends the newsletter to all subscribed users.

Database Class

• Stores and manages system data, including user details, subscriptions, and
newsletters.

33
• Methods:

o storeData(object: Object) : void → Saves an object (user, subscription,


newsletter) in the database.

o retrieveData(query: String) : Object → Retrieves requested data from the


database.

Email Service Class

• Handles the email functionality of the system.

• Methods:

o sendEmail(user: User, newsletter: Newsletter) : void → Sends the


newsletter to the subscribed user via email.

Fig 3.3

34
Relationships in the Class Diagram

• User subscribes to Subscription → A user (or visitor) can subscribe to a


newsletter.

• Subscription relates to Newsletter → Each subscription is associated with a


specific newsletter topic.

• Newsletter sends via EmailService → Newsletters are sent to users through an


email service.

• Admin manages Users and Newsletters → Admin can create, modify, and send
newsletters.

• Database stores and retrieves data → Stores and manages all system-related
data.

3.9.3 Sequence Diagram

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction


diagram that shows how processes operate with one another and in what order.  It is a
construct of a Message Sequence Chart. Sequence diagrams are sometimes called event
diagrams, event scenarios, and timing diagrams

Key components of a sequence diagram include:

• Lifelines: Lifelines represent the objects or components involved in the


interaction. They are typically depicted as vertical lines, with the name
of the object or component at the top.
• Messages: Messages represent the communication or interaction
between lifelines. They indicate the flow of control or data between
objects and can be synchronous (denoted by a solid arrow) or
asynchronous (denoted by a dashed arrow).
• Activation Boxes: Activation boxes represent the period of time during
which an object is performing an action or processing a message. They
are depicted as rectangles or boxes along the lifeline. Sequence diagrams
are useful for visualizing the dynamic behavior of a system, including
the order of method calls, the flow of control between objects, and the

35
timing of interactions. They are often used during the design and
implementation phases of software development to model and
understand the behavior of complex systems or subsystems.

Actors and Components

The primary actors in the system are:

• User: A person who subscribes to newsletters.

• Admin: A person who creates and manages newsletters.

The main system components include:

1. Frontend (React): The user interface where users register, subscribe, and
receive newsletters.

2. API (Django REST): The backend service handling user requests.

3. Authentication System: Validates user credentials during registration/login.

4. Database: Stores user and subscription details.

5. Newsletter Service: Manages newsletter generation and distribution.

6. Email Service: Sends newsletters to subscribers.

Process Flow

1. User Registration/Login

• The user signs up or logs in via the frontend.

• The system sends user credentials to the authentication system.

• The authentication system validates the credentials and checks/stores user data
in the database.

• If successful, an authentication token is generated and returned to the user.

2. Newsletter Subscription

• The user clicks the "Subscribe" button.

• The frontend sends a subscription request to the backend API.

• The backend stores the subscription details in the database.

• A confirmation message is sent back to the user.

36
3. Newsletter Creation (Admin)

• The admin creates a new newsletter by providing a topic and content.

• The backend processes the request and generates the newsletter.

• The newsletter is stored in the database.

• A confirmation message ("Newsletter Created") is sent to the admin.

4. Sending Newsletters

• The system fetches the list of subscribers from the database.

• The backend sends the list of subscribers to the newsletter service.

• The newsletter service forwards the emails to the email service.

• The email service delivers newsletters to all subscribers.

Fig 3.4
37
3.9.4 Activity Diagram
Activity diagrams are graphical representations of workflows of stepwise activities and
actions with support for choice, iteration and concurrency. In the Unified Modeling
Language, activity diagrams can be used to describe the business and operational step-
by-step workflows of components in a system.

Fig 3.5

Actors Involved
• Admin: Responsible for creating, processing, and sending newsletters.
• User: Subscribes to newsletters and can update subscription topics.
• System: Handles authentication, password resets, and subscription updates.

38
Workflow Description
1. User Authentication
• The process starts with the user registering or logging into the system.
• The system checks if the login is successful:
• If yes, the system determines whether the user is an admin or a regular user.
• If no, an error message is displayed.
2. Admin Workflow
• If the logged-in user is an admin, they access the admin dashboard.
• The admin can create a newsletter, process it, and send it to subscribers.
• After completing these actions, the admin logs out.
3. User Workflow
• If the logged-in user is not an admin, they access the user dashboard.
• The user can view subscribed newsletters.
• They have the option to update their subscription topic:
• If they choose to update, the subscription is updated accordingly.
• The user then logs out.
4. Password Reset Process
• If the login fails, the system provides an option for password reset.
• If the user requests a password reset, the system validates the email and sends a
reset link.
• Once the reset is successful, the process ends.

3.10 Cost Analysis


Here's a cost analysis between OpenAI's ChatGPT API models and DeepSeek's AI
models, presented in both US Dollars (USD) and Indian Rupees (INR):

1. OpenAI's ChatGPT API Models:

OpenAI offers various models with pricing based on token usage. A token can be as
short as one character or as long as one word (e.g., "ChatGPT" is one token).

• GPT-3.5 Turbo:
o Pricing: $0.002 per 1,000 tokens.
o In INR: Approximately ₹0.17 per 1,000 tokens.
• GPT-4 (8k context length):
o Prompt Tokens: $0.03 per 1,000 tokens.
o Completion Tokens: $0.06 per 1,000 tokens.

39
o In INR:
▪ Prompt Tokens: Approximately ₹2.50 per 1,000 tokens.
▪ Completion Tokens: Approximately ₹5.00 per 1,000 tokens.
• GPT-4 (32k context length):
o Prompt Tokens: $0.06 per 1,000 tokens.
o Completion Tokens: $0.12 per 1,000 tokens.
o In INR:
▪ Prompt Tokens: Approximately ₹5.00 per 1,000 tokens.
▪ Completion Tokens: Approximately ₹10.00 per 1,000 tokens.

Note: The exchange rate used is $1 = ₹83.50.

2. DeepSeek's AI Models:

DeepSeek provides AI models with pricing based on token usage. A token is the
smallest unit of text recognized by the model, including words, numbers, or punctuation
marks.

• DeepSeek-V3 (deepseek-chat):
o Pricing: $1.50 per 1 million tokens.
o In INR: Approximately ₹0.125 per 1,000 tokens.
• DeepSeek-R1 (deepseek-reasoner):
o Pricing: $4.50 per 1 million tokens.
o In INR: Approximately ₹0.375 per 1,000 tokens.

Note: The exchange rate used is $1 = ₹83.50.

40
Chapter 4
Software Installation
4.1 Setting Up React (Vite) & Material-UI
In this section, we will set up React using Vite (a faster alternative to Create React App)
and integrate Material-UI for UI components.

Step 1: Install Node.js

Ensure that Node.js (LTS version) is installed on your system. You can download it
from the Node.js Official Website ( https://nodejs.org/en)

To check if Node.js and npm are installed, run:

node -v

npm -v

Step 2: Create a React Project using Vite

Vite is a modern build tool that provides a faster development experience compared to
Create React App.

1. Open a terminal and navigate to the desired project folder.


2. Run the following command to create a new React app
3. Navigate into the project folder
4. Install dependencies & Install Material-UI
5. Start the development server

41
Step 3: Import Material-UI in Your Project

Step 4: Run react


Code: npm run dev

42
Basic Folder Structure

4.2 Setting Up Crew AI & Backend Services


In this section, we will set up Crew AI and the backend services required for our
NewsCrew project. This setup will enable intelligent task automation and efficient data
handling for news aggregation, user management, and API integrations.

What is Crew AI?

Crew AI is an advanced framework designed to manage AI-powered agents that


collaborate to perform specific tasks efficiently. It allows multiple AI agents (such as
LLMs like GPT, DeepSeek, or custom-trained models) to work together, interact with
APIs, and automate workflows.

43
Key Features of Crew AI:

• Multi-Agent Collaboration Enables different AI agents to work together on


complex tasks.
• Task Automation Automates repetitive workflows like news summarization,
translation, or data extraction.
• API Integration – Seamlessly integrates with external APIs for fetching and
processing real-time news.
• Scalability – Optimized for handling multiple AI-driven requests efficiently.

Step 1: Install Python & Virtual Environment

Crew AI is built using Python. To set it up, first, ensure Python is installed.

Python is a widely used programming language known for its simplicity and versatility.
It is extensively used in backend development, artificial intelligence, data science, web
applications, and automation. The following steps outline the installation process.

1. Download Python:

• Visit the official Python website: https://www.python.org/downloads/

• Choose the appropriate version for your operating system (Windows,


macOS, or Linux) and download the installer.

2. Install Python:

• Run the downloaded installer.

• Ensure you check the box "Add Python to PATH" before proceeding.
This step allows Python to be accessible from the command line.

44
• Click Install Now and follow the installation prompts.

3. Verify the Installation:

• Open a terminal or command prompt and run the following command:

• python --version

• If Python is installed correctly, it will display the installed version.

• Additionally, install pip, the package manager for Python, if not


included by default:

• python -m ensure pip --default-pip

Step 2 : Installing Django

Django is a high-level Python web framework designed to facilitate the rapid


development of secure and scalable web applications. Follow the steps below to install
and set up Django properly

45
1. Set Up a Virtual Environment:

• It is recommended to create a virtual environment to manage


dependencies efficiently:

• python -m venv myenv

• Activate the virtual environment:

▪ On Windows:

▪ myenv\Scripts\activate

▪ On macOS/Linux:

▪ source myenv/bin/activate

2. Install Django:

• Use pip to install Django within the virtual environment:

• pip install django

• Verify the installation:

• django-admin –version

3. Create a New Django Project:

• Run the following command to create a new Django project:

• django-admin start project project name

• Navigate into the project directory:

• cd project name

• Run the Django development server:

• python manage.py run server

• Open a web browser and visit http://127.0.0.1:8000/ to see the default


Django welcome page.

46
Step 3: Installing Required Libraries

To enhance the functionality of Django and React applications, install the necessary
libraries as follows:

1. Install Django REST Framework (DRF):

• DRF is used for building RESTful APIs in Django:

• pip install djangorestframework

• Add rest_framework to the INSTALLED_APPS section in settings.py.

2. Install Axios for API Requests:

• Axios is a widely used library for making HTTP requests in React


applications:

• npm install axios

3. Install AI Tools:

• If artificial intelligence functionalities are required, install the necessary.

• pip install crewai, Langchain, Langchain-openai, deepseek

4. Additional Libraries:

• Depending on project requirements, other libraries such as cors-headers


for Django CORS handling and redux for state management in React
may be required:

• pip install django-cors-headers

• npm install react-markdown

47
Chapter 5

Implementation
5.1 Code Structure
The project follows a modular structure, separating the backend (Django + DRF) and
frontend (React + Vite) for scalability and maintainability.

newscrew

│── backend

│ ├── api

│ │ ├── migrations

│ │ ├── templates

│ │ │ ├── newsletter_email_template.html

│ │ ├── __init__.py

│ │ ├── admin.py

│ │ ├── apps.py

│ │ ├── models.py

│ │ ├── serializers.py

│ │ ├── urls.py

│ │ ├── views.py

│ ├── core

│ │ ├── __init__.py

│ │ ├── settings.py

│ │ ├── urls.py

│ │ ├── wsgi.py

│ ├── newsletter

48
│ │ ├── output

│ │ │ ├── Bitcoin.md

│ │ │ ├── Nifty50.md

│ │ ├── tools

│ │ │ ├── __init__.py

│ │ │ ├── save_file.py

│ │ │ ├── search_tools.py

│ │ ├── __init__.py

│ │ ├── agents.py

│ │ ├── crew.py

│ │ ├── tasks.py

│ ├── .env

│ ├── .gitignore

│ ├── manage.py

│── frontend

│ ├── public

│ │ ├── icon.svg

│ ├── src

│ │ ├── App.css

│ │ ├── App.jsx

│ │ ├── components

│ │ │ ├── AppAppBar.jsx

│ │ │ ├── Hero.jsx

│ │ │ ├── NewsletterList.jsx

49
│ │ ├── pages

│ │ │ ├── Articles.jsx

│ │ │ ├── Dashboard.jsx

│ │ │ ├── LandingPage.jsx

│ │ │ ├── ResetPassword.jsx

│ │ │ ├── Settings.jsx

│ │ │ ├── SigninSide.jsx

│ │ │ ├── SignupSide.jsx

│ │ │ ├── Uarticles.jsx

│ │ │ ├── UserDashboard.jsx

│ │ │ ├── Users.jsx

│ │ │ ├── UserSettings.jsx

│ │ ├── index.css

│ │ ├── main.jsx

│ ├── .gitignore

│ ├── index.html

│ ├── package.json

│ ├── README.md

│ ├── vite.config.js

Backend: Built using Django + DRF, handling APIs, authentication, and data
management.

Frontend: Developed using React + Vite, providing a user-friendly interface.

Newsletter Module: Uses CrewAI agents for news fetching, summarization, and email
dispatch.

50
5.2 API Integration
The project leverages Django Rest Framework (DRF) APIs, which interact with the
React frontend via Axios.

URL Pattern View Name

news-gen/ NewsAPIView news-gen

signup/ RegisterAPIView signup

login/ LoginAPIView login

upload-newsletters/ UploadNewslettersAPIView fetch-newsletters

get-topic-
newsletters/<str:topic_name>/ GetTopicNewslettersAPIView
newsletters

render-
RenderNewsletterAPIView render-newsletter
newsletter/<str:filename>/

Table 5.1

Note: These are defined “api” project, hence prefix “api/” should be added to every url.

Authentication API: Handles user login and registration, providing authentication


tokens for secure access.

Newsletter API: Fetches the latest newsletters and user-subscribed topics.

Subscription API: Manages newsletter subscriptions, allowing users to subscribe or


update preferences.

Password Reset API: Sends a password reset link to the user’s registered email.

User Data API: Retrieves user profile information, including subscription detail

The AI Newsletter project can be initially deployed on a local server for testing and
development purposes. Once fully tested, it can be deployed on a cloud server for
public access.

51
Phase 1: Local Deployment (Development Stage)

• The project can run on localhost using Django’s development server and
React’s local build.

• PostgreSQL (via Supabase) is used as the database.

• APIs are tested using Postman or frontend integration.

• Email functionality is configured using a test SMTP service.

Instructions to run Project:

1) Install git CLI in your desktop, download link : https://git-scm.com/downloads


2) Open the Project folder and use the following command to pull the remote
repository from github:
• git clone https://github.com/gunasantosh/newscrew
• Split the terminal and use “cd backend” in one and “cd frontend” in
another.
3) Create a python environment and install the requirements using this
command.
Code: pip install -r requirements.txt
4) Make sure you have added the Supabase credentials in .env file.
5) Run the following commands to start the application.
• On frontend: npm run dev
• On backend: python manage.py runserver.

Note: After integrating the database, we need to apply migrations once to update the
database with Django models and our own models.

52
Chapter 6

Result Analysis
6.1 Demonstration of Webpage

Fig 6.1

53
2.Signup Page

Fig 6.2

3.Signin Page

Fig 6.3

54
4.Admin Dashboard

Fig 6.4

5.Users and subscribers

Fig 6.5

55
6.Access the Articles to view or delete

Fig 6.6

7.Settings to send newsletter and updating the topics

Fig 6.7

56
8.User Dashboard

Fig 6.8

9.User settings to change the topic

Fig 6.9

57
6.2 Newsletters Examples In Webpage

Fig 6.10

58
6.3 Newsletters Via Mail

Fig 6.11

59
6.4 Performance Insights of Open AI & Deep Seek
The AI Newsletter platform evaluates multiple AI models for content summarization
and generation. Below is a cost-performance comparison of various models, including
DeepSeek, to determine the most effective choice.

Cost per 1K Approx. INR


Model Performance Quality Rating
tokens Cost

GPT-4 Topic-relevant but


$0.22 ₹20
Turbo average summaries

Good performance,
GPT-4o $0.11 ₹10
balanced cost

Very high quality but


GPT-4 $0.53 ₹45
expensive

GPT-4o Outdated and poor


$0.01 ₹8
Mini performance

Cost-effective and high-


DeepSeek $0.02 ₹2
quality

Table 6.1

Key Observations:

• DeepSeek offers exceptional performance at the lowest cost ($0.01 per 1K


tokens), making it an ideal choice for summarization.

• GPT-4o provides a balanced cost-to-quality ratio and is reliable for general


content generation.

• GPT-4 is premium quality but expensive, best suited for critical summaries.

• GPT-4 Turbo is decent but costly compared to DeepSeek.

• GPT-4o Mini is outdated and underperforms, making it not viable.

60
Optimization Strategy:

• Primary Model: DeepSeek due to its high efficiency at minimal cost.

• Secondary Model: GPT-4o for additional quality improvements in complex


summaries.

• Selective GPT-4 Usage: Only for high-end features or premium user access.

• Token Management: Reduce unnecessary API calls to optimize expenses.

Fig 6.12

61
CHPATER 7

FUTURE WORK
As the newsletter system continues to evolve, several enhancements are planned to
improve performance, scalability, and user experience. This section outlines key
upgrades, including multi-topic newsletters, advanced prompting mechanisms, multi-
threading using Redis and Celery, and cloud deployment for enhanced scalability.

7.1 Planned Enhancements


7.1.1 Multi-Topic Newsletter

Currently, users can subscribe to a single topic per newsletter. The planned
enhancement will allow them to select multiple topics, enabling the system to generate
a more diverse and personalized newsletter. AI-driven curation will ensure that content
is relevant, avoiding redundant or generic information.

Expected Benefits:

Feature Benefit

Multi-topic selection Users receive a broader range of news in a single newsletter

AI-driven curation Eliminates duplicate or irrelevant content

Improved engagement Users stay informed on multiple areas of interest

Table 7.1

7.1.2 Prompting-Based Topic Selection (Extended Input)

Currently, users select topics using short prompts. To refine personalization, we plan to
allow extended input where users can provide a detailed description of their
preferences. This input will be processed using AI to extract nuanced interests and
provide a more relevant newsletter experience.

Implementation Plan:

• Natural Language Processing (NLP): Analyze detailed user inputs to extract


topics.

62
• AI Categorization: Match extracted topics with relevant news sources.

• Personalized Newsletter Generation: Deliver curated content based on


refined preferences.

7.1.3 Multi-Threading Using Redis and Celery

To improve the efficiency of newsletter generation and delivery, multi-threading will


be introduced using Redis and Celery. This will ensure parallel task execution, reducing
processing time and improving system performance.

Advantages:

Component Function Benefit

Redis Task queue Ensures efficient job scheduling

Celery Asynchronous task execution Reduces response time

Parallel Processing Multi-threaded execution Faster newsletter generation

Table 7.2

7.1.4 Cloud Deployment for Scalability

To enhance accessibility and performance, the newsletter system will be


deployed on a cloud platform. This will enable:

• Auto-scaling to handle increasing user demand.


• High availability with redundant server infrastructure.
• Global accessibility ensuring seamless delivery of newsletters
worldwide.

63
CHAPTER 8

CONCLUSION
The AI-driven Newsletter with Website successfully integrates artificial intelligence
and modern web technologies to provide a seamless, personalized news experience.
This project automates the entire process of news aggregation, summarization,
categorization, and distribution, ensuring that users receive curated content based on
their interests. By leveraging CrewAI, Django (DRF), React, and Supabase (Postgres),
the system effectively manages user preferences, authenticates subscribers, and delivers
dynamic newsletters via email.

The website serves as an interactive platform where users can register, subscribe,
manage their topic preferences, and access previous newsletters. The admin portal
enhances system control, allowing administrators to oversee user management, monitor
article summaries, and configure newsletter settings efficiently. The integration of AI
models, including OpenAI’s GPT and DeepSeek, enables the system to generate
concise, high-quality summaries, reducing manual effort while maintaining content
relevance and readability.

This project highlights the transformative impact of AI in digital journalism and


automated content delivery. By eliminating the need for manual curation, the system
ensures efficiency, scalability, and a tailored user experience. With future enhancements
such as multi-topic newsletters, prompting-based topic selection, and further AI-driven
personalization, this platform aspires to become a fully deployed, scalable solution for
delivering high-quality, automated news updates to a diverse user base.

64
CHAPTER 9

REFERENCES
[1] Smith et al. (2019) – Explores traditional newsletter models and their limitations,
including inflexible subscriptions.
[2] Kumar & Patel (2022) – Discusses AI-powered recommendation systems and their
role in improving content engagement.
[3] Johnson et al. (2021) – Examines the importance of dynamic newsletter
customization and historical access to past content.
[4] Google News & Flipboard AI Algorithms – Case studies on how AI-driven
content recommendation works in large-scale news aggregation.
[5] Medium & Substack Subscription Models – Research on static subscription-
based models and their limitations in user personalization.
[6] AI-Based Summarization Models – Studies on OpenAI's GPT-4 and DeepSeek
for content summarization and retrieval.
[7] Performance Insights of OpenAI & DeepSeek Models – Cost-performance
comparison of AI models used for newsletter content generation.
[8] Tom Christie (2017) – Django REST Framework Documentation – Official guide
and principles for building APIs in Django.
[9] React: A JavaScript Library for Building User Interfaces – React
documentation by Meta (formerly Facebook) for component-based UI
development.
[10] Anthony Herbert (2021) – Django for APIs: Build Web APIs with Python &
Django – Covers API development using Django REST Framework.
[11] React & Material-UI Integration – Guides and papers on using Material-UI
for frontend UI components with React.
[12] Supabase Documentation – PostgreSQL-based real-time backend services
for scalable applications.

65

You might also like