0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
A platform for community discussion. Free, open, simple. https://www.discourse.org
  • Ruby 58.5%
  • JavaScript 35.5%
  • HTML 3.1%
  • SCSS 2.8%
Find a file
Jake Goldsborough edf30ae27e
FEATURE: badge notifications link to the post that earned them
Per-post badges (Thank You, Nice Reply, etc.) record the triggering
post in user_badges.post_id, but the granted-badge notification never
carried it, so the notification only linked to the generic badge page.

Now when a badge was granted for a specific post, the notification
includes post_id / post_number / topic_id / topic_title in its data,
links straight to that post, and reads "Earned 'X' for your post in
<topic>". Non-post badges are unchanged (still link to the badge
page, same description).

- BadgeGranter.send_notification takes an optional post_id: and, when
  present and the post is visible to the recipient (Post.find_by skips
  trashed; a guardian check drops hidden-category posts), denormalizes
  the post/topic refs into the notification data.
- Single-grant path passes user_badge.post_id.
- Backfill path: the insert already wrote post_id; added it to the
  CTE RETURNING + outer SELECT so the per-row send_notification can
  pass row.post_id.
- granted-badge notification type: linkHref goes to the post when
  topic_id + post_number are present, else the badge page; description
  uses the new granted_badge_for_post string when a topic_title is
  present.

Specs: BadgeGranter includes post context on a post-grant, omits it
for non-post badges, and omits it when the post isn't visible. JS:
linkHref and description for the with-post case.

Note: the backfill path now does a Post + User lookup per granted
post-badge for the guardian check. Acceptable for correctness; can be
batched later if backfill volume makes it a concern.
2026-05-27 09:04:38 -07:00
.agents DEV: symlink to skills (#38573) 2026-03-18 09:41:56 +11:00
.claude DEV: symlink to skills (#38573) 2026-03-18 09:41:56 +11:00
.cursor/rules
.devcontainer DEV: bump devcontainer image version 2026-05-25 13:17:19 +10:00
.github Revert "PERF: Run primary and parallel DB setup concurrently in CI (#… (#40301) 2026-05-26 14:27:43 +01:00
.skills FEATURE: Change upcoming change available notification cadence (#40157) 2026-05-25 09:38:33 +10:00
.vscode
.zed DEV: add Zed editor configuration (#36958) 2026-01-06 23:30:45 +01:00
app FEATURE: badge notifications link to the post that earned them 2026-05-27 09:04:38 -07:00
bin DEV: Improve bin/ember-cli shutdown process (#40120) 2026-05-18 16:56:30 +02:00
config FEATURE: badge notifications link to the post that earned them 2026-05-27 09:04:38 -07:00
db FEATURE: Switch from opt-in to opt-out for categories in AI translations (#40169) 2026-05-26 14:51:04 -04:00
docs DEV: Update docs for d-compat/* branches (#40332) 2026-05-27 10:28:31 +01:00
frontend FEATURE: badge notifications link to the post that earned them 2026-05-27 09:04:38 -07:00
images
lib DEV: Fix isolation bugs in service framework's each step (#40311) 2026-05-27 09:47:34 +02:00
log
migrations DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
patches DEV: Migrate to @ember/reactive/collections (#38221) 2026-03-23 17:44:41 -03:00
plugins FEATURE: allow click on calendar to create new event (#40251) 2026-05-27 11:20:42 -04:00
public DEV: add post reaction menu metadata to upcoming change (#40062) 2026-05-15 13:16:18 +04:00
script FIX: add skip db and redis to env before building core assets and plugins (#40145) 2026-05-20 17:19:25 -07:00
spec FEATURE: badge notifications link to the post that earned them 2026-05-27 09:04:38 -07:00
stylelint-rules DEV: Exploring a token system (#38700) 2026-04-23 13:47:45 -05:00
test DEV: Clean up smoke-test (#40066) 2026-05-15 12:28:41 +02:00
themes FIX: Dismiss buttons not showing in Horizon (#40326) 2026-05-27 16:26:59 +10:00
vendor UX: rename new icons to generic names (#40030) 2026-05-14 15:21:08 +02:00
.annotaterb.yml
.editorconfig
.git-blame-ignore-revs DEV: Add nested module style commit to .git-blame-ignore-revs 2026-03-20 10:08:56 +01:00
.gitattributes
.gitignore DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
.ignore
.jsdoc
.licensed.yml DEV: Remove Unicorn web server in favor of Pitchfork (#39032) 2026-04-01 15:04:59 +02:00
.licensee.json
.npmrc
.pnpmfile.cjs
.prettierignore DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
.prettierrc.cjs
.rspec
.rspec_parallel
.rubocop.yml DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
.ruby-gemset.sample
.streerc
AGENTS.md
AI-AGENTS.md DEV: Tweaks to AI-AGENTS.md (#40241) 2026-05-22 15:39:26 +08:00
Brewfile
CLAUDE.md
CODEOWNERS DEV: Add Block API for declarative, validated UI extension points (#36810) 2026-02-25 17:36:43 -03:00
config.ru
CONTRIBUTING.md
COPYRIGHT.md
d
discourse.sublime-project
eslint.config.mjs DEV: Remove ember-template-lint (#40077) 2026-05-15 20:54:13 +01:00
Gemfile FEATURE: extract text from document uploads for LLM prompts (#39634) 2026-05-05 08:16:23 +10:00
Gemfile.lock DEPS: Bump rb_sys from 0.9.127 to 0.9.128 (#39905) 2026-05-13 10:17:16 +02:00
GEMINI.md
lefthook.yml DEV: Remove ember-template-lint (#40077) 2026-05-15 20:54:13 +01:00
LICENSE.txt
package.json DEV: Remove ember-template-lint (#40077) 2026-05-15 20:54:13 +01:00
pnpm-lock.yaml FEATURE: allow click on calendar to create new event (#40251) 2026-05-27 11:20:42 -04:00
pnpm-workspace.yaml DEV: Remove (again) the old non-rollup plugin compiler (#39419) 2026-04-21 21:07:46 +02:00
Rakefile
README.md DEV: Bump minimum PostgreSQL version to 15 (#40293) 2026-05-26 14:59:33 +08:00
stylelint.config.mjs DEV: Exploring a token system (#38700) 2026-04-23 13:47:45 -05:00
translator.yml DEV: Add discourse-footnote client.yml translator config (#37178) 2026-01-16 15:23:50 +00:00
tsconfig-base.json DEV: Add Block API for declarative, validated UI extension points (#36810) 2026-02-25 17:36:43 -03:00
tsconfig.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
versions.json DEV: Begin development of v2026.5.0-latest (#39608) 2026-04-28 14:59:15 +01:00

The online home for your community.

github-readme

You can self-host Discourse on your own infrastructure. But if you'd rather skip the setup, maintenance, and server management, we offer official Discourse hosting.

👉 Learn more about Discourse hosting

Discourse is a 100% open-source community platform for those who want complete control over how and where their site is run.

Our platform has been battle-tested for over a decade and continues to evolve to meet users needs for a powerful community platform.

With Discourse, you can:

  • 💬 Create discussion topics to foster meaningful conversations.

  • Connect in real-time with built-in chat.

  • 🎨 Customize your experience with an ever-growing selection of official and community themes.

  • 🤖 Enhance your community with plugins, from chatbots powered by Discourse AI to advanced tools like SQL analysis with the Data Explorer plugin.

To learn more, visit discourse.org and join our support community at meta.discourse.org.

Here are just a few of the incredible communities using Discourse:

discourse-communities

👉 Discover more communities using Discourse

Development

To get your environment set up, follow one of the setup guides:

Before you get started, ensure you have the following minimum versions: Ruby 3.4+, PostgreSQL 15, Redis 7.

For more information, check out the Developer Documentation.

Setting up Discourse

If you want to set up a Discourse forum for production use, see our Discourse Install Guide.

If you're looking for official hosting, see discourse.org/pricing.

Requirements

Discourse supports the latest, stable releases of all major browsers and platforms:

Browsers Tablets Phones
Apple Safari iPadOS iOS
Google Chrome Android Android
Microsoft Edge
Mozilla Firefox

Additionally, we aim to support Safari on iOS 16.4+.

Built With

  • Ruby on Rails — Our back end API is a Rails app. It responds to requests RESTfully in JSON.
  • Ember.js — Our front end is an Ember.js app that communicates with the Rails API.
  • PostgreSQL — Our main data store is in Postgres.
  • Redis — We use Redis as a cache and for transient data.
  • BrowserStack — We use BrowserStack to test on real devices and browsers.

Plus lots of Ruby Gems, a complete list of which is at /main/Gemfile.

Contributing

Build Status

Discourse is 100% free and open source. We encourage and support an active, healthy community that accepts contributions from the public including you!

Before contributing to Discourse:

  1. Please read the complete mission statements on discourse.org. Yes we actually believe this stuff; you should too.
  2. Read and sign the Electronic Discourse Forums Contribution License Agreement.
  3. Dig into CONTRIBUTING.MD, which covers submitting bugs, requesting new features, preparing your code for a pull request, etc.
  4. Always strive to collaborate with mutual respect.
  5. Not sure what to work on? We've got some ideas.

We look forward to seeing your pull requests!

Security

We take security very seriously at Discourse; all our code is 100% open source and peer reviewed. Please read our security guide for an overview of security measures in Discourse, or if you wish to report a security issue.

Security fixes are listed in the release notes for each version.

The Discourse Team

The original Discourse code contributors can be found in AUTHORS.MD. For a complete list of the many individuals that contributed to the design and implementation of Discourse, please refer to the official Discourse blog and GitHub's list of contributors.

Copyright 2014 - 2025 Civilized Discourse Construction Kit, Inc.

Licensed under the GNU General Public License Version 2.0 (or later); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Discourse logo and “Discourse Forum” ®, Civilized Discourse Construction Kit, Inc.

Accessibility

To guide our ongoing effort to build accessible software we follow the W3Cs Web Content Accessibility Guidelines (WCAG). If you'd like to report an accessibility issue that makes it difficult for you to use Discourse, email accessibility@discourse.org. For more information visit discourse.org/accessibility.

Dedication

Discourse is built with love, Internet style.

For over a decade, our amazing community has helped shape Discourse into what it is today. Your support, feedback, and contributions have been invaluable in making Discourse a powerful and versatile platform.

Were deeply grateful for every feature request, bug report, and discussion that has driven Discourse forward. Thank you for being a part of this journey—we couldnt have done it without you!