Giter Site home page Giter Site logo

baffinlee / hacker-news-summary Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 242 KB

HN Digest - AI-Powered Hacker News Summarizer

Home Page: https://hacker-news-summary.pages.dev/

JavaScript 1.70% HTML 1.55% CSS 5.15% TypeScript 91.61%
ai-summarizer hacker-news

hacker-news-summary's Introduction

HN Digest

HN Digest: AI-Powered Hacker News Summarizer.

Check it out 👉 https://hacker-news-summary.pages.dev/

Description

HN Digest is an AI-powered application designed to summarize articles from Hacker News. The system leverages advanced natural language processing (NLP) to generate concise summaries and insights. The goal is to make it easier for users to stay informed about the latest discussions in technology, startups, and programming without having to sift through lengthy articles.

Architecture

The architecture of HN Digest consists of several key components:

Data Ingestion:

  • Web Scraper: Collects the latest articles from Hacker News.

Data Processing:

  • NLP Summarizer: Uses a CloudFlare's Worker AI model to generate summaries of the articles.

Storage:

  • SQLite: Stores article summaries and metadata.

Backend Services:

  • API Gateway: Manages API requests and responses.
  • Cron Jobs: Crawl news content regularly to summarize.

Web Interface:

  • CloudFlare pages: Allows users to browse summaries, set preferences, and access additional details.

Testing and Monitoring:

  • Automated Testing: Use GitHub action to run test automatically, ensures the functionality and performance of the application.
  • Monitoring Tools: Use CloudFlare's monitor to track system performance and user engagement.

architecture

Justifications for Design Decisions

Choice of SQL Database:

  • Structured Data: SQL databases are ideal for storing structured data with complex relationships, which is suitable for handling detailed metadata about articles and user preferences.
  • ACID Compliance: Ensures data integrity and reliability, crucial for maintaining accurate summaries and user information.
  • Advanced Querying: SQL provides powerful querying capabilities, making it easier to retrieve and manipulate data for generating summaries and user analytics.
  • Scalability: Modern SQL databases support horizontal scaling, enabling the system to handle increasing data volumes efficiently.

Deployment on Cloudflare:

  • Speed: Cloudflare’s CDN ensures fast content delivery to users worldwide, reducing latency and improving user experience.
  • Security: Cloudflare provides robust security features, including DDoS protection and SSL, ensuring that the application is secure and reliable.
  • Scalability: Cloudflare’s infrastructure can easily handle traffic spikes, ensuring the application remains available and performant under high loads.

System Requirements and Testability

Functional Requirements:

  • Summarization Accuracy: The system should generate concise and accurate summaries of Hacker News articles.
  • Automated Ingestion: A cron job should run the data ingestion process automatically at regular intervals (e.g., every hour) to keep the summaries up-to-date.

Non-Functional Requirements:

  • Scalability: The system should handle increasing amounts of data and users efficiently.
  • Performance: The system should deliver summaries quickly and handle high traffic smoothly.
  • Reliability: The system should be robust and available with minimal downtime.
  • Usability: The user interface should be intuitive and easy to navigate.

Testability:

  • Unit Testing: Each component (e.g., web scraper, summarizer) can be tested independently to ensure it meets its functional requirements.
  • Integration Testing: Ensures that the components work together seamlessly and data flows correctly through the system.

Source Code and Hosting

Develop locally

  1. Make sure you installed Node.js >= 18

  2. Install dependencies for both frontend and backend project

npm run install
  1. Start frontend page
npm run start:frontend
  1. Migrate database to local file
npm run migration:backend
  1. Start backend services
npm run start:backend

Test locally

  • Frontend integration test
npm run test:frontend
  • Backend unit test
npm run test:backend

Deploy

  • Deploy backend service to CloudFlare Worker
npm run deploy:backend
  • Deploy frontend service to CloudFlare Pages

Connect your github project to CloudFlare, create a Pages project by the following setting:

Build path: frontend

Build command: npm run build

Output path: dist

hacker-news-summary's People

Contributors

baffinlee avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.