Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

145 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

今日热榜 (Today's Hot Rankings)

通过爬虫采集数据,并进行可视化展示。
Collect hot-ranking data from multiple sources and present it through a web UI.

Project structure

This repository currently contains:

  • Backend: Python + FastAPI
    • app.py — application entry point and middleware registration
    • hotrank/infrastructure.py — PostgreSQL, Redis, rate limiting, and lifespan
    • hotrank/model_client.py — model-provider request handling
    • hotrank/routers/ — HTTP route modules
    • hotrank/services/ — rank loading, news summarization, and RSS generation
    • hotrank/schemas.py — request and response data models
  • Frontend (legacy): ui/ — Vue 2 + Element UI + IconPark
  • Frontend (current/live): vue-ui/ — Vue 3 + Vite + TypeScript + Tailwind CSS + Heroicons
    • vue-ui/src/App.vue — page-level state and orchestration
    • vue-ui/src/components/ — reusable page components and modal views

As of the current online deployment, https://www.hotday.uk/ is serving the vue-ui/ frontend.
The live page loads Vite-built assets such as /assets/index-*.js and /assets/index-*.css, and its DOM structure/styles match vue-ui/src/App.vue.

Backend

Backend stack:

  • FastAPI
  • Redis
  • PostgreSQL

Recent backend changes already reflected in the repo:

  • 2025-03-03
    • switched storage from MongoDB to PostgreSQL to reduce memory usage
    • added global rate limiting

Backend deployment

After building the Docker image, you can run the backend container like this:

docker run -itd --name hotrank \
  -v /var/www/hotday.uk/feed:/app/rss_feed.xml \
  -v /var/www/hotday.uk/feed_with_ai:/app/rss_feed_today_top_news.xml \
  -v /opt/hot-rank-web/app.py:/app/app.py \
  -v /opt/hot-rank-web/parse_detail.py:/app/parse_detail.py \
  -v /opt/hot-rank-web/common.py:/app/common.py \
  -v /opt/hot-rank-web/config.py:/app/config.py \
  -p 127.0.0.1:7545:7545 \
  hotrank:v0.1

If you are only updating code (without adding new dependencies/files into the image), restarting the container is usually enough.

Frontend

Current live frontend: vue-ui/

Recommended commands:

cd vue-ui
pnpm install
pnpm run dev
pnpm run build

After pnpm run build, deploy the generated static files from vue-ui/dist/ to Nginx (or your static file host).

Legacy frontend: ui/

The old frontend is still kept in the repository for compatibility/reference:

cd ui
pnpm install
pnpm run serve
pnpm run build

If you are making changes intended for the currently deployed site, prefer working in vue-ui/.

Screenshots

效果图1 效果图2 效果图3 效果图4 效果图5

About

hot today news rank。今日热榜,今日热门新闻。通过爬虫采集数据,并进行可视化展示的项目。项目包含前端(Vue2 + Element-UI + Iconpark 图标库)和后端(Python + FastAPI),数据存储在 PostgreSQL 数据库中。提供 Docker 部署建议以简化后端部署流程,前端通过 npm build 后可部署至 Nginx。

Resources

Stars

108 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages