# newsnow: Elegant Real-time News Reading with a Clean UI

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/ourongxing-newsnow
Generated for open source discovery and AI-assisted research.

newsnow offers an elegant and clean UI for reading real-time and trending news. It supports features like GitHub OAuth login, data synchronization, and adaptive scraping intervals to ensure an optimal and up-to-date news experience. This project, built with TypeScript, is designed for easy deployment on platforms like Cloudflare Pages or Vercel.

GitHub: https://github.com/ourongxing/newsnow
OSRepos URL: https://osrepos.com/repo/ourongxing-newsnow

## Summary

newsnow offers an elegant and clean UI for reading real-time and trending news. It supports features like GitHub OAuth login, data synchronization, and adaptive scraping intervals to ensure an optimal and up-to-date news experience. This project, built with TypeScript, is designed for easy deployment on platforms like Cloudflare Pages or Vercel.

## Topics

- elegant
- news
- TypeScript
- real-time news
- web application
- news reader
- GitHub OAuth
- Cloudflare D1

## Repository Information

Last analyzed by OSRepos: Thu Nov 06 2025 20:00:37 GMT+0000 (Western European Standard Time)
Detail views: 5
GitHub clicks: 3

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
newsnow is an open-source project designed for elegant reading of real-time and hottest news. It provides a clean and intuitive user interface, focusing on an optimal reading experience. Key features include real-time updates for trending news, GitHub OAuth login with data synchronization, and intelligent adaptive scraping intervals to optimize resource usage and prevent IP blocking.

Please note, the current version is a demo primarily supporting Chinese content. A full version with customization features and English content support is planned for future release.

## Installation
Deploying newsnow is straightforward, with options for basic setup, Cloudflare Pages, or Docker.

### Basic Deployment (without login and cache)
1.  Fork this repository.
2.  Import it into a platform like Cloudflare Pages or Vercel.

### Cloudflare Pages Configuration
*   **Build command**: `pnpm run build`
*   **Output directory**: `dist/output/public`

### GitHub OAuth Setup
1.  Create a [GitHub App](https://github.com/settings/applications/new){:target="_blank"}.
2.  No special permissions are required.
3.  Set the callback URL: `https://your-domain.com/api/oauth/github` (replace `your-domain` with your actual domain).
4.  Obtain your Client ID and Client Secret.

### Environment Variables
Refer to `example.env.server`. For local development, rename it to `.env.server` and configure:
env
# GitHub Client ID
G_CLIENT_ID=
# GitHub Client Secret
G_CLIENT_SECRET=
# JWT Secret (usually same as Client Secret)
JWT_SECRET=
# Initialize database (set to true for first run)
INIT_TABLE=true
# Enable caching
ENABLE_CACHE=true


### Database Support
newsnow supports database connectors via [https://db0.unjs.io/connectors](https://db0.unjs.io/connectors){:target="_blank"}, with Cloudflare D1 Database being recommended.
1.  Create a D1 database in your Cloudflare Worker dashboard.
2.  Configure `database_id` and `database_name` in `wrangler.toml`.
3.  If `wrangler.toml` doesn't exist, rename `example.wrangler.toml` and adjust settings.
4.  Changes will take effect on the next deployment.

### Docker Deployment
From the project root directory, run:

sh
docker compose up


Environment variables can also be configured in `docker-compose.yml`.

## Examples
To get newsnow running for development or to understand its extensibility, consider these examples:

### Local Development
Node.js >= 20 is required.

sh
corepack enable
pnpm i
pnpm dev


### Adding Data Sources
The project provides full type definitions and a clean architecture for adding new data sources. Refer to the `shared/sources` and `server/sources` directories to extend its capabilities.

### MCP Server Configuration
newsnow supports MCP servers, allowing for flexible integration. An example configuration for the `newsnow-mcp-server` is provided:

{
  "mcpServers": {
    "newsnow": {
      "command": "npx",
      "args": [
        "-y",
        "newsnow-mcp-server"
      ],
      "env": {
        "BASE_URL": "https://newsnow.busiyi.world"
      }
    }
  }
}


## Why Use It
newsnow stands out for its commitment to a superior reading experience, combining aesthetics with powerful backend features. Its elegant UI ensures a distraction-free environment for consuming news. With real-time updates and adaptive scraping, you're always informed with the latest trends. The project's roadmap promises multi-language support and enhanced personalization, making it a versatile choice for global news consumption. Furthermore, its easy deployment options and robust database support, especially with Cloudflare D1, make it a developer-friendly solution for building a personalized news aggregator.

## Links
*   **GitHub Repository**: [https://github.com/ourongxing/newsnow](https://github.com/ourongxing/newsnow){:target="_blank"}