Skip to content

A desktop app to read and view global news in one place. Easy access to worldwide headlines and news stories.

License

Notifications You must be signed in to change notification settings

mjiee/world-news

Repository files navigation

world news log

World News

Release version go version go version go version License

中文说明

Welcome to World-News — your one-stop desktop application for viewing global news from various sources. Whether you're looking to catch up on the latest headlines, explore different regions, or stay updated on specific topics, World-News makes it easy to access and read the most relevant stories from around the world.

🚀 Key Features

  • Fetch the latest news in real-time from multiple global news sources.
  • AI-powered news analysis and commentary, providing insightful perspectives on key topics.
  • Flexible data source configuration, allowing users to customize their news sources.
  • Offline reading support once the news is downloaded — read anytime, anywhere.
  • Simple, intuitive user interface for seamless and convenient news browsing.
  • Available for both desktop installation and web deployment, catering to different platform needs.

🖥️ User Interface

world-news ui

⚙️ Tech Stack

  • Wails - Lightweight framework for building cross-platform desktop apps with Go and web technologies.
  • React - JavaScript library for building user interfaces, used for creating the frontend.
  • Mantine - A modern React component library for UI elements and hooks.
  • Zustand - A minimalistic state management library for React, used to manage application state.
  • Gin - Fast Go web framework for handling backend logic and API requests.
  • Gorm - ORM for Go, used to interact with databases.
  • Zap - Structured, leveled logging library for Go, used for application logging.
  • SQLite - Lightweight, serverless SQL database for local data storage.
  • Colly - Fast and efficient web scraping library for Go.

🛠️ Installation & Setup

Ensure you have the following dependencies installed:

  • Go (>=1.23)
  • Node.js (>=22)

1. Clone the Repository

git clone https://github.com/mjiee/world-news.git
cd world-news

2. Build the Desktop App

To build and run the desktop version of the app, follow these steps:

# Build the app
make build

After building, you can run the application locally:

# On Linux/macOS
./build/bin/world-news

# On Windows
build\bin\world-news.exe

3. Backend Deployment [Optional]

The backend is built with Gin and serves as a web application for presenting news. You can deploy it in the following ways:

Docker Compose Deployment

Run the following command:

# Run the backend with Docker Compose
docker compose up -d

Access the app at http://localhost:9010 in your browser.

Local Deployment

Ensure you have a running PostgreSQL database locally and that the relevant database and user have been created. Set up the database connection string:

WORLD_NEWS_DB_ADDR="host=localhost user=world_news password=world_news dbname=world_news port=5432 sslmode=disable"

Build and run the backend:

# Build the project
make build-web

# Run the backend service
./build/bin/world-news

Access the app at http://localhost:9010 in your browser.

Environment Variables

  • WORLD_NEWS_HOST
    Description: The host and port for the web service.
    Default: 0.0.0.0:9010.

  • WORLD_NEWS_DB_ADDR
    Description: The connection string for the database.

  • WORLD_NEWS_TOKEN
    Description: The token used for API authentication.
    Default: 0123456.

  • WORLD_NEWS_LOG_FILE
    Description: The file path for storing logs.

⚠️ Important Notes

  • Learning Project: World-News is a learning project designed to explore Go, React, Wails, and other web technologies. It is not intended for production or commercial use.
  • Usage Restrictions: Please avoid using this app for unethical activities or data scraping that violates news providers' terms of service. By using this application, you agree to refrain from misusing the data for illegal or unethical purposes.

🙋‍♂️ Contribution

Feel free to fork this repository and submit pull requests if you’d like to contribute! This is an open-source project, and contributions, improvements, and suggestions are always welcome.

📄 License

World-News is MIT licensed.