{"id":35163915,"url":"https://github.com/ducks/discourse-invite-stats","last_synced_at":"2026-05-22T04:02:50.949Z","repository":{"id":322290731,"uuid":"1088899278","full_name":"ducks/discourse-invite-stats","owner":"ducks","description":"A Discourse plugin that visualizes invite relationships as an ASCII tree, showing how users invited each other to join the community.","archived":false,"fork":false,"pushed_at":"2025-11-05T01:15:03.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-05T03:11:33.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T15:58:08.000Z","updated_at":"2025-11-05T01:15:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1c50a86-2380-451d-8987-53f939f6ae88","html_url":"https://github.com/ducks/discourse-invite-stats","commit_stats":null,"previous_names":["ducks/discourse-invite-tree","ducks/discourse-invite-stats"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ducks/discourse-invite-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fdiscourse-invite-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fdiscourse-invite-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fdiscourse-invite-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fdiscourse-invite-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducks","download_url":"https://codeload.github.com/ducks/discourse-invite-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fdiscourse-invite-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28102732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-28T02:00:05.685Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-28T19:03:27.879Z","updated_at":"2025-12-28T19:05:41.499Z","avatar_url":"https://github.com/ducks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discourse Invite Stats\n\nA Discourse plugin for tracking invite statistics and accountability. Shows who invited whom, displays moderation metrics, and helps identify problematic inviters through quality scores and success rate tracking.\n\n![Accountability Report](invite-stats-table.png)\n\n![Invite Tree Visualization](invite-stats-tree.png)\n\n## Features\n\n**Accountability \u0026 Moderation:**\n- Invite quality scores (percentage of non-problematic invites)\n- Problematic inviter detection (3+ bad invites or \u003c70% success rate)\n- Community-wide summary statistics\n- Moderation indicators (suspended, silenced, flagged users)\n- Track invite success rates over time\n\n**Visualization:**\n- Clean ASCII tree showing invite hierarchy\n- Lobsters-style tree characters\n- Join dates and invite counts\n- Works with invite-only or open registration\n- Fully responsive design\n\n## Installation\n\nAdd this repository URL to your Discourse plugin list in `app.yml`:\n\n```yaml\nhooks:\n  after_code:\n    - exec:\n        cd: $home/plugins\n        cmd:\n          - git clone https://github.com/ducks/discourse-invite-stats.git\n```\n\nThen rebuild your container:\n\n```bash\n./launcher rebuild app\n```\n\n## Configuration\n\nAfter installation, go to **Admin \u003e Settings \u003e Plugins \u003e discourse-invite-stats**:\n\n### Basic Settings\n- `invite_stats_enabled`: Enable or disable invite stats (default: false)\n- `invite_stats_allowed_groups`: Groups allowed to view invite stats (default: empty, allows all logged-in users, staff always have access)\n- `invite_stats_show_stats`: Show user statistics (default: true)\n\n### Threshold Settings\nConfigure when users are flagged as problematic inviters:\n\n- `invite_stats_problematic_threshold`: Number of problematic invites before flagging (default: 3, range: 1-10)\n- `invite_stats_quality_threshold`: Minimum quality score percentage before flagging (default: 70, range: 0-100)\n- `invite_stats_min_invites_for_quality`: Minimum invites required before quality score applies (default: 5, range: 1-20)\n- `invite_stats_flags_threshold`: Number of agreed flags to mark a user as problematic (default: 3, range: 1-10)\n\nThese settings allow you to customize problematic inviter detection to match your community's moderation standards.\n\n### Access Control\n\nBy default, all logged-in users can view invite stats. You can restrict access by:\n\n1. Adding groups to the `invite_stats_allowed_groups` setting\n2. Only users in those groups (or staff) will have access\n3. Leave empty to allow all logged-in users\n\n### Invite-Only Mode\n\nTo enable invite-only registration, use Discourse's native setting at **Admin \u003e\nSettings \u003e Login**:\n\n- `invite_only`: Restrict registration to invited users only\n\n## Usage\n\nOnce enabled, invite stats are accessible at `/invite-stats` on your forum.\n\nThe page displays three main sections:\n\n### 1. Community Overview\nSummary statistics showing:\n- Total users and inviters\n- Total invites sent\n- Number of problematic invites\n- Overall success rate\n\n### 2. Accountability Report\nProminently displays users who invited problematic members:\n- Users who invited too many problematic users (configurable threshold)\n- Users with low quality scores when they have enough invites (configurable thresholds)\n- Shows total invites, problematic count, and quality score\n- Helps moderators identify patterns and review invite privileges\n- Thresholds can be customized in plugin settings\n\n### 3. Invite Tree Visualization\nASCII tree showing the complete invite hierarchy:\n- Usernames with links to profiles\n- Join dates and invite counts\n- Tree structure showing who invited whom\n- Moderation indicators: 🚫 suspended, 🔇 silenced, ⚠️ flagged\n- Quality scores for users with invites\n- Problematic invite counts\n\n**What counts as problematic?**\nA user is considered problematic if they are:\n- Suspended\n- Silenced\n- Have enough agreed flags from moderators (configurable threshold, default: 3)\n\n## How It Works\n\nThe plugin uses Discourse's native invite system:\n- Queries the `invited_users` and `invites` tables\n- Joins with `user_stats` for moderation data (flags, suspensions, silences)\n- Calculates invite quality scores based on problematic user ratios\n- Builds a recursive tree structure from invite relationships\n- Includes all users (even problematic ones) for accountability visibility\n- Caches results for 1 hour for performance\n- Limited to 5000 users for safety on large sites\n\n## Development\n\n### Local Setup\n\n1. Clone to your Discourse plugins directory:\n   ```bash\n   cd ~/discourse/plugins\n   git clone https://github.com/ducks/discourse-invite-stats.git\n   ```\n\n2. Start your development Discourse instance\n\n3. Enable the plugin in settings\n\n### Test Data\n\nGenerate test invite data with moderation scenarios:\n\n```bash\ncd ~/discourse\nbin/rails runner plugins/discourse-invite-stats/scripts/create-test-data.rb\n```\n\nThis creates 40+ test users with:\n- Multiple generations of invite relationships\n- Suspended, silenced, and flagged users\n- Variety of quality scores (from 0% to 100%)\n- Problematic inviters that trigger accountability alerts\n\n## Customization\n\nThe plugin is designed to be easily customizable:\n\n- **Styling**: Override `.invite-stats-*` CSS classes\n- **Tree characters**: Modify `treePrefix` getter in `invite-stats-node.gjs`\n- **Thresholds**: Configure in Admin \u003e Settings \u003e Plugins (no code changes needed)\n- **Display format**: Edit component templates to show different data\n- **Color scheme**: Uses Discourse CSS variables, adapts to themes automatically\n\n## License\n\nMIT\n\n## Author\n\nJake Goldsborough\n\n## Contributing\n\nIssues and pull requests welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducks%2Fdiscourse-invite-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducks%2Fdiscourse-invite-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducks%2Fdiscourse-invite-stats/lists"}