mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
2.0 KiB
2.0 KiB
In-app Changelog (GitHub Releases)
The application front page shows a Changelog section that is sourced from GitHub releases in the
nowcommunity/nowdatabase repository.
Overview
- Backend route:
GET /changelog - Frontend:
frontend/src/components/FrontPage.tsxfetches the route via RTK Query and renders the entries. - Purpose: show what has been deployed (release title + description + release creation time).
Backend
Route
backend/src/routes/changelog.tsexposesGET /changelogbackend/src/services/changelog.tsfetches GitHub releases from the GitHub REST API.
Caching and failure behavior
- The backend keeps an in-memory cache with a TTL (see
CACHE_TTL_MSinbackend/src/services/changelog.ts). - If GitHub fetching fails and there is a cached value, the cached value is returned.
Authentication / rate limits
- The service will use
process.env.GITHUB_TOKEN(orprocess.env.GH_TOKEN) if present. - If no token is provided, unauthenticated GitHub API requests are used and may hit stricter rate limits.
Frontend
- Query is defined in
frontend/src/redux/changelogReducer.tsand hits/changelog. - The front page renders
bodyHtmlusingdangerouslySetInnerHTML.- The HTML comes from GitHub’s
application/vnd.github.v3.html+jsonresponse format. - GitHub’s rendered HTML is expected to be sanitized by GitHub; we do not add extra client-side sanitization.
- The HTML comes from GitHub’s
Filtering “internal” notes
The changelog supports a simple mechanism to hide internal-only notes:
- A release is omitted entirely if its title starts with
Internal: - Within a release description, anything after a heading
### Internalis omitted.
How to publish a changelog entry
- Create a GitHub release in
nowcommunity/nowdatabase. - Write user-facing notes in the release title/body.
- Optionally include internal-only notes:
- Prefix the release title with
Internal:to hide the whole release, or - Add a
### Internalsection at the end of the release body to hide only that section.
- Prefix the release title with