Lightweight service that generates project heartbeat updates from GitHub activity and publishes them to Discourse communities.
Every project should show visible progress without manual reporting.
| Feature | Description |
|---|---|
| GitHub Activity Collector | Fetches new/closed issues, merged PRs, new contributors, and good-first-issue labels |
| Digest Builder | Generates a structured Markdown summary |
| Discourse Publisher | Posts the digest to a Discourse category |
| Scheduler | Automatically publishes on a configurable interval (default: weekly) |
| Admin UI | Manage projects, add roadmap notes, preview & publish manually |
| CLI Mode | Generate digests from the command line for CI/testing |
GitHub API ──▶ Heartbeat Engine ──▶ Discourse API
│
PostgreSQL
│
Admin UI
GitHub is the source of truth. The engine observes, summarizes, and publishes—nothing more.
trood-heartbeat/
├── src/
│ ├── server.js # Express admin server
│ ├── scheduler.js # Heartbeat scheduler
│ ├── github.js # GitHub API integration
│ ├── discourse.js # Discourse API integration
│ ├── digest.js # Markdown digest builder
│ ├── db/
│ │ └── postgres.js # Database access layer
│ └── ui/
│ ├── index.html # Project list
│ └── project.html # Project detail / publish
├── heartbeat.js # CLI entrypoint
├── Dockerfile
├── docker-compose.yml
├── package.json
└── README.md
npm install is not needed when you run with Docker.
git clone https://github.com/troodinc/trood-heartbeat.git
cd trood-heartbeat
cp .env.example .env
docker-compose up --buildThen open http://localhost:3000.
Use this path only if you want to run outside Docker:
npm install
node src/server.jsCopy .env.example to .env and fill in the values:
cp .env.example .env| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token |
DISCOURSE_URL |
Discourse instance URL (e.g., https://forum.example.com) |
DISCOURSE_API_KEY |
Discourse API key |
DISCOURSE_API_USERNAME |
Discourse API username (e.g., system) |
DATABASE_URL |
PostgreSQL connection string. In Docker Compose, the internal value is already set |
PORT |
Server port (default: 3000) |
Trood Heartbeat uses PostgreSQL. Tables are created automatically on first run.
Tables:
projects– id, name, github_repo, discourse_category, discourse_topic, schedule_days, last_post_at, enabledroadmap_notes– id, project_id, content, created_at
docker-compose up --buildThis starts:
- the
heartbeatservice - a
postgresdatabase
The admin UI is available at http://localhost:3000.
npm install
node src/server.jsUse local mode only if PostgreSQL is already running and DATABASE_URL is set correctly.
Generate a heartbeat digest without publishing:
export GITHUB_TOKEN=ghp_xxx
node heartbeat.js --project owner/repoOptions:
| Flag | Description |
|---|---|
--project |
GitHub repository (owner/repo) – required |
--days |
Days to look back (default: 7) |
Example:
node heartbeat.js --project octocat/Hello-World --days 14Useful for CI pipelines and local testing.
Access at http://localhost:3000/ui/.
Capabilities:
- Add / edit / delete projects
- Bind GitHub repository and Discourse category or topic
- Set update interval (days)
- Add roadmap notes
- Preview the next heartbeat digest
- Publish manually (resets the schedule timer)
# Project Heartbeat
## New Issues
- [Issue title](url)
## Closed Issues
- [Issue title](url)
## Merged PRs
- [PR title](url) by @author
## New Contributors
- @username
## Good First Issues
- [Issue title](url)
## Roadmap
Optional notes from maintainers.Trood Heartbeat can run:
- Standalone –
node src/server.js - Docker –
docker-compose up - On-premise – deploy behind a reverse proxy
- Trood / OpenClaw pipelines – integrate via CLI or API
-
Category mode
- set
discourse_category - each heartbeat becomes a new topic in that category
- set
-
Topic mode
- set
discourse_topic - each heartbeat becomes a reply in that existing project topic
- set
If discourse_topic is set, it takes precedence over discourse_category.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/projects |
List all projects |
| GET | /api/projects/:id |
Get project with roadmap notes |
| POST | /api/projects |
Create project |
| PUT | /api/projects/:id |
Update project |
| DELETE | /api/projects/:id |
Delete project |
| POST | /api/projects/:id/notes |
Add roadmap note |
| DELETE | /api/notes/:id |
Delete roadmap note |
| GET | /api/projects/:id/preview |
Preview digest |
| POST | /api/projects/:id/publish |
Publish digest now |
Contributions are welcome!
- Fork the repository
- Create a feature branch
- Submit a pull request
Please open an issue before submitting major changes.
Areas for contribution:
- Digest formatting improvements
- Additional data sources (e.g., releases, discussions)
- Scheduler enhancements
- Alternative publishing targets
Apache 2.0