Show HN: 基于 FastAPI、PostgreSQL 发布/订阅和 UV 的实时应用启动器
3 分•作者: jvanveen•8 个月前
这是一个使用现代 Python/JS 工具和 PostgreSQL 的 LISTEN/NOTIFY(而非外部消息队列)构建的实时 Web 应用的入门模板。
技术栈:
* UV (Python 包管理器 - 速度极快)
* FastAPI,完全支持 async/await
* PostgreSQL 触发器 + LISTEN/NOTIFY 用于发布/订阅
* Bun 用于前端构建
* 完善的连接池和生命周期管理
GitHub: [https://github.com/garage44/plank](https://github.com/garage44/plank)
这个模板源于在多个项目中重建相同模式的经验。我发现的大多数示例都是玩具演示,无法处理重新连接、客户端掉线或正确关闭。
包含一个工作的前端示例,当数据库更改时会实时更新。提供用于测试的 Docker Compose 设置。
适用场景:管理仪表板、监控工具、协作应用,这些应用只需要立即推送当前状态。不适用于:保证消息传递或任务队列。
查看原文
Starter template for real-time web apps using modern Python/JS tooling and PostgreSQL's LISTEN/NOTIFY instead of external message queues.<p>Stack:
- UV (Python package manager - incredibly fast)
- FastAPI with full async/await
- PostgreSQL triggers + LISTEN/NOTIFY for pub/sub
- Bun for frontend builds
- Proper connection pooling and lifecycle management<p>GitHub: <a href="https://github.com/garage44/plank" rel="nofollow">https://github.com/garage44/plank</a><p>This came from rebuilding the same pattern across projects. Most examples I found were toy demos that didn't handle reconnection, dead clients, or proper shutdown.<p>Includes working frontend example that updates in real-time when database changes. Docker Compose setup for testing.<p>Good for: admin dashboards, monitoring tools, collaborative apps where you just need current state pushed immediately. Not for: guaranteed message delivery or job queues.