Skip to content

engineervix/zed-news

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

zed-news

Automated news digests from various Zambian πŸ‡ΏπŸ‡² sources.

CI/CD Coverage healthchecks.io

python Node v18 Code style: black code style: prettier

Commitizen friendly Conventional Changelog Conventional Commits

Introduction

This tool gathers news from various Zambian πŸ‡ΏπŸ‡² sources, processes them, and presents them as a text-based news digest.

The project has two main components:

  • core -- A Python application that handles:

    • Gathering news from RSS feeds using requests, feedparser, and beautifulsoup4.
    • Processing the news articles using Large Language Models (LLMs).
    • Generating structured data for the static website.
  • web -- An 11ty static site that presents the news digests.

Project Evolution: From Podcast to News Digest

After 500 episodes, I decided to transition the Zed News project from generating audio podcast episodes to producing text-based news digests. The core value of providing consolidated Zambian news is still preserved.

The original podcast episodes have been archived, and the project now focuses on delivering fast, scannable news content.

Development

  • Clone or fork the project.
  • cd into the project directory.

Core

Note

You need to have docker and docker-compose on your machine.

  • Install Poetry.

  • Create a Python virtual environment.

  • Install dependencies:

    poetry install
  • Set up environment variables:

    # Copy the example .env file
    cp -v .env.example .env
    
    # Update the values in your new .env file
  • Build and run the Docker containers:

    inv up --build
  • Access the app container's shell:

    inv exec app bash

Inside the container, you can run the following commands:

  • Run tests:
    inv test
  • Generate a new digest:
    inv digest

See available invoke tasks with invoke -l.

The project uses pgweb to visualize database changes. Access it at http://127.0.0.1:8081.

Web

This project uses Node.js v18. We recommend using fnm or volta to manage Node.js versions.

  • Install frontend dependencies:
    npm install
  • Start the local development server (accessible at http://127.0.0.1:8080/):
    npm start

See other available scripts in package.json.

Deployment

The project's final output is a static site, which can be hosted on any platform that supports static files, such as Cloudflare Pages, Netlify, Vercel, or GitHub Pages.

Warning

Ensure that environment variables are updated accordingly for both the core application and the web build process.

For an automated, hands-off setup, follow these steps:

  1. Set up a nix-based machine (e.g., a VPS or your laptop) with a Python virtual environment, docker, and docker-compose.
  2. Configure a cron job to run the cron.sh script located in the project root. This script automates the generation and deployment process.
  3. Ensure git is configured correctly on the machine, as the cron.sh script pushes the generated content to the repository, which in turn triggers the website's build and deployment pipeline.

Note

The cron.sh script uses Apprise to send notifications when a new digest is ready. You will need to configure the notification service (e.g., ntfy.sh) in your .env file.

Contributing

This project follows the all-contributors specification. Contributions, issues and feature requests are most welcome! A good place to start is by helping out with the unchecked items in the TODO section of this README!

Feel free to check the issues page and take a look at the contributing guide before you get started.

To maintain code quality and formatting consistency, we utilize pre-commit hooks. These hooks automatically check and format your code before each commit. This helps ensure that the codebase remains clean and consistent throughout the development process. Set up the Git pre-commit hooks by running the following

pre-commit install && pre-commit install --hook-type commit-msg

See pre-commit-config.yaml for more details. In addition, please note the following:

  • if you're making code contributions, please try and write some tests to accompany your code, and ensure that the tests pass. Also, were necessary, update the docs so that they reflect your changes.
  • your commit messages should follow the conventions described here. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug". Once you are done, please create a pull request.

TODO

Dev

  • Improve test coverage

Frontend (Web)

  • Create a dynamic og:image for each digest.
  • Keep things DRY. For example, the header and footer icons.
  • Improve the mobile UI.
  • Improve accessibility (a11y).
  • Implement search functionality for the news digests.

Features for future releases

  • Add weather reports/forecasts
  • Add exchange rates feature.
  • Consider more sustainable AI integrations
  • Add Diamond TV as a news source.

Credits

Music

Icons

News Sources

About

Automated news digests from various Zambian πŸ‡ΏπŸ‡² sources

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •