rupcgroup25-2/NewsSite-Final-Project

JavaScript

1

224 commits

updated May 10, 2026

See the code

README

NewsSite Final Project

A full-stack, real-time news platform featuring AI capabilities, user management, article chat, push notifications, and text-to-speech.

JavaScript .NET 6 Bootstrap Firebase SQL Server HuggingFace



Table of Contents


Overview

The Problem

Modern news consumption is often isolated and passive. Readers skim articles but lack embedded community discussion, localized discovery features, or built-in accessibility tools like text-to-speech options for prolonged reading.

The Solution

NewsSite Final Project is a full-stack platform that transforms a standard news website into an interactive community. Users can read articles, listen to them via Text-to-Speech (TTS), engage in real-time article-specific chat, and locate top stories using an interactive world map. In addition, it integrates extensive AI, Scraping, and Social capabilities to augment content automatically seamlessly.

How It Works

  1. Browse an extensive archive of global articles fetched via NewsAPI or locate regional trending Twitter hashtags using the interactive JQVMap.
  2. Listen & Summarize articles on-the-go with built-in Text-to-Speech or generate an AI summary via HuggingFace models.
  3. Discuss real-time events in article-specific Firebase chat rooms.
  4. Manage a personalized profile (including generating custom AI avatars via HuggingFace texts-to-image integration before uploading directly to Cloudinary), save articles, and receive live Push Notifications (FCM).

Key Features

FeatureDescriptionStack
User AuthenticationSecure registration, login, and JWT-based session management.NET 6, SQL Server, BCrypt
Profile AI GenerationAI-generated avatar images using HuggingFace before Cloudinary uploadHuggingFace, Cloudinary
News & ScrapingFetch top headlines via NewsAPI & scrape article content directlyNewsAPI, HtmlAgilityPack
AI SummarizationOn-demand text summarization of article contents via AI modelsHuggingFace
Twitter Trends MapLocate and map regional Twitter trending hashtags by countryJQVMap, Twitter API
Real-time ChatArticle-specific, persistent real-time chat roomsFirebase Firestore
Text-to-Speech (TTS)Multi-voice English support with pause/resume functionalityWeb Speech API
Push NotificationsReal-time system notifications and alerts for active usersFirebase Cloud Messaging
Admin DashboardUser management, user blocking, content reporting, and analyticsJS, Bootstrap, .NET
Theme ToggleAutomatic and manual dark/light mode switchingCSS, LocalStorage

System Architecture

The application operates fundamentally split across three tiers: Edge (Frontend), API (Backend), and Data/External Services.

flowchart TD
    Client["Client (HTML/JS/CSS + Bootstrap)"]

    subgraph Frontend_App["Frontend Layer"]
        Pages["Static Pages (index, article, admin)"]
        SW["Service Worker (FCM)"]
    end

    subgraph Backend_App["API Layer (.NET 6)"]
        API["ASP.NET Core Web API"]
        BL["Business Logic Layer (BL)"]
        DAL["Data Access Layer (DAL)"]
    end

    subgraph External["External Services"]
        FirebaseFirestore["Firebase Firestore (Chat)"]
        FCM["Firebase Cloud Messaging"]
        Cloudinary["Cloudinary (Images)"]
        HuggingFace["HuggingFace (AI image & summary)"]
        NewsAPI["NewsAPI.org (Global News)"]
        TwitterAPI["Twitter API (Trends)"]
    end

    subgraph Data_Stores["Data Stores"]
        SQL["SQL Server"]
    end

    Client --> Pages
    Pages <--> API
    Pages <--> FirebaseFirestore
    SW <--> FCM
    API <--> BL
    BL <--> DAL
    DAL <--> SQL
    API <--> Cloudinary
    API <--> FCM
    API <--> HuggingFace
    API <--> NewsAPI
    API <--> TwitterAPI


Frontend Architecture

Technology Stack

ConcernTechnologyVersion
UI FrameworkBootstrap5.3.2
JavaScriptVanilla ES6+--
DOM ManipulationjQuery3.7.1
Mapping UIJQVMap1.5.1
Real-Time SDKFirebase SDK12.0.0
AccessibilityWeb Speech APINative

Project Structure

Following a vanilla separation of concerns pattern:

  • \client/news-moty/css/\ - Modular cascading stylesheets.
  • \client/news-moty/js/\ - Page-specific logic scripts and shared utilities.
  • \client/news-moty/pages/\ - Application views mapping to features.
  • \client/firebase-messaging-sw.js\ - Service worker for background push operations.

Features and Patterns

  • AJAX Modules: Specialized \jaxCalls.js\ for generic API fetching and error tracking.
  • Progressive Enhancement: Using modern web APIs (Web Speech, Push API) safely falling back when unsupported.

Backend Architecture

ASP.NET Core Web API

The server operates on .NET 6 via an N-Tier architecture (Controllers > BL > DAL):

  • Controllers: Thin controllers strictly focused on HTTP routing, request parsing, and delegating execution formatting to the Business Logic layer.
  • Data Access Layer (DAL): Operates heavily via custom robust SQL Stored Procedures, providing transactional safety and fast query resolution over an MS SQL database.
  • External Integrations: Centralized logic across \HuggingFaceService, \TwitterService, \NewsApiService\ and \ArticleExtractorService.

Configuration Reference

Setting Up

FileConcernAction
\ irebaseConfig.js\Client SDKAdd public API Key, Auth Domain & VAPID Key.
\ppsettings.json\Backend ServicesProvide \DefaultConnection\ string for SQL.
\ irebase-service-account.json| Server SDKRequired for Admin SDK capabilities (Notifications).
\huggingface-key.txt\Web APIHuggingFace API key for AI generation & summarization.
\
ewsapi-key.txt\Web APINewsAPI key to fetch live articles.
\ witter-trends-key.txt\Web APITwitter API credentials for geolocation hashtag feeds.

API Reference

A sample of core backend endpoints handling state operations.

MethodEndpointDescription
\POST\/api/Users/Register\Register a new user with secure password hashing
\POST\/api/Users/GenerateProfileImage| Generate avatar via HuggingFace & upload to Cloudinary
\GET\/api/Articles/Summarize/{id}| Run HuggingFace text-summarization over article content
\POST\/api/Notifications/SaveFCMToken| Register device for push alerts
\GET\/api/Admin/GetAllUsers\Load system accounts (Admin only)

Security Posture

LayerImplementation
AuthenticationJSON Web Tokens (JWT) securing critical endpoints.
AuthorizationRole-based verification enforcing User-vs-Admin capacities.
Data QueryingStrict raw Stored Procedure mappings averting traditional ORM SQL-injections.
PasswordsBCrypt hashing applied before any persistence operations.

License

This project is an educational final project. All rights reserved.

rupcgroup25-2/NewsSite-Final-Project

JavaScript

1

224 commits

updated May 10, 2026

See the code

README

NewsSite Final Project

A full-stack, real-time news platform featuring AI capabilities, user management, article chat, push notifications, and text-to-speech.

JavaScript .NET 6 Bootstrap Firebase SQL Server HuggingFace



Table of Contents


Overview

The Problem

Modern news consumption is often isolated and passive. Readers skim articles but lack embedded community discussion, localized discovery features, or built-in accessibility tools like text-to-speech options for prolonged reading.

The Solution

NewsSite Final Project is a full-stack platform that transforms a standard news website into an interactive community. Users can read articles, listen to them via Text-to-Speech (TTS), engage in real-time article-specific chat, and locate top stories using an interactive world map. In addition, it integrates extensive AI, Scraping, and Social capabilities to augment content automatically seamlessly.

How It Works

  1. Browse an extensive archive of global articles fetched via NewsAPI or locate regional trending Twitter hashtags using the interactive JQVMap.
  2. Listen & Summarize articles on-the-go with built-in Text-to-Speech or generate an AI summary via HuggingFace models.
  3. Discuss real-time events in article-specific Firebase chat rooms.
  4. Manage a personalized profile (including generating custom AI avatars via HuggingFace texts-to-image integration before uploading directly to Cloudinary), save articles, and receive live Push Notifications (FCM).

Key Features

FeatureDescriptionStack
User AuthenticationSecure registration, login, and JWT-based session management.NET 6, SQL Server, BCrypt
Profile AI GenerationAI-generated avatar images using HuggingFace before Cloudinary uploadHuggingFace, Cloudinary
News & ScrapingFetch top headlines via NewsAPI & scrape article content directlyNewsAPI, HtmlAgilityPack
AI SummarizationOn-demand text summarization of article contents via AI modelsHuggingFace
Twitter Trends MapLocate and map regional Twitter trending hashtags by countryJQVMap, Twitter API
Real-time ChatArticle-specific, persistent real-time chat roomsFirebase Firestore
Text-to-Speech (TTS)Multi-voice English support with pause/resume functionalityWeb Speech API
Push NotificationsReal-time system notifications and alerts for active usersFirebase Cloud Messaging
Admin DashboardUser management, user blocking, content reporting, and analyticsJS, Bootstrap, .NET
Theme ToggleAutomatic and manual dark/light mode switchingCSS, LocalStorage

System Architecture

The application operates fundamentally split across three tiers: Edge (Frontend), API (Backend), and Data/External Services.

flowchart TD
    Client["Client (HTML/JS/CSS + Bootstrap)"]

    subgraph Frontend_App["Frontend Layer"]
        Pages["Static Pages (index, article, admin)"]
        SW["Service Worker (FCM)"]
    end

    subgraph Backend_App["API Layer (.NET 6)"]
        API["ASP.NET Core Web API"]
        BL["Business Logic Layer (BL)"]
        DAL["Data Access Layer (DAL)"]
    end

    subgraph External["External Services"]
        FirebaseFirestore["Firebase Firestore (Chat)"]
        FCM["Firebase Cloud Messaging"]
        Cloudinary["Cloudinary (Images)"]
        HuggingFace["HuggingFace (AI image & summary)"]
        NewsAPI["NewsAPI.org (Global News)"]
        TwitterAPI["Twitter API (Trends)"]
    end

    subgraph Data_Stores["Data Stores"]
        SQL["SQL Server"]
    end

    Client --> Pages
    Pages <--> API
    Pages <--> FirebaseFirestore
    SW <--> FCM
    API <--> BL
    BL <--> DAL
    DAL <--> SQL
    API <--> Cloudinary
    API <--> FCM
    API <--> HuggingFace
    API <--> NewsAPI
    API <--> TwitterAPI


Frontend Architecture

Technology Stack

ConcernTechnologyVersion
UI FrameworkBootstrap5.3.2
JavaScriptVanilla ES6+--
DOM ManipulationjQuery3.7.1
Mapping UIJQVMap1.5.1
Real-Time SDKFirebase SDK12.0.0
AccessibilityWeb Speech APINative

Project Structure

Following a vanilla separation of concerns pattern:

  • \client/news-moty/css/\ - Modular cascading stylesheets.
  • \client/news-moty/js/\ - Page-specific logic scripts and shared utilities.
  • \client/news-moty/pages/\ - Application views mapping to features.
  • \client/firebase-messaging-sw.js\ - Service worker for background push operations.

Features and Patterns

  • AJAX Modules: Specialized \jaxCalls.js\ for generic API fetching and error tracking.
  • Progressive Enhancement: Using modern web APIs (Web Speech, Push API) safely falling back when unsupported.

Backend Architecture

ASP.NET Core Web API

The server operates on .NET 6 via an N-Tier architecture (Controllers > BL > DAL):

  • Controllers: Thin controllers strictly focused on HTTP routing, request parsing, and delegating execution formatting to the Business Logic layer.
  • Data Access Layer (DAL): Operates heavily via custom robust SQL Stored Procedures, providing transactional safety and fast query resolution over an MS SQL database.
  • External Integrations: Centralized logic across \HuggingFaceService, \TwitterService, \NewsApiService\ and \ArticleExtractorService.

Configuration Reference

Setting Up

FileConcernAction
\ irebaseConfig.js\Client SDKAdd public API Key, Auth Domain & VAPID Key.
\ppsettings.json\Backend ServicesProvide \DefaultConnection\ string for SQL.
\ irebase-service-account.json| Server SDKRequired for Admin SDK capabilities (Notifications).
\huggingface-key.txt\Web APIHuggingFace API key for AI generation & summarization.
\
ewsapi-key.txt\Web APINewsAPI key to fetch live articles.
\ witter-trends-key.txt\Web APITwitter API credentials for geolocation hashtag feeds.

API Reference

A sample of core backend endpoints handling state operations.

MethodEndpointDescription
\POST\/api/Users/Register\Register a new user with secure password hashing
\POST\/api/Users/GenerateProfileImage| Generate avatar via HuggingFace & upload to Cloudinary
\GET\/api/Articles/Summarize/{id}| Run HuggingFace text-summarization over article content
\POST\/api/Notifications/SaveFCMToken| Register device for push alerts
\GET\/api/Admin/GetAllUsers\Load system accounts (Admin only)

Security Posture

LayerImplementation
AuthenticationJSON Web Tokens (JWT) securing critical endpoints.
AuthorizationRole-based verification enforcing User-vs-Admin capacities.
Data QueryingStrict raw Stored Procedure mappings averting traditional ORM SQL-injections.
PasswordsBCrypt hashing applied before any persistence operations.

License

This project is an educational final project. All rights reserved.

Languages

JavaScript

41.3%

C#

32.3%

CSS

19.3%

TSQL

3.7%

HTML

3.3%