|
| 1 | +--- |
| 2 | +title: "Forum Revamp: Phase 1 Project Report (GSoC 2024)" |
| 3 | +date: 2024-07-07T12:04:13+05:30 |
| 4 | +draft: false |
| 5 | +author: Waishnav Deore |
| 6 | +type: post |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +Hello Readers, |
| 12 | + |
| 13 | +This blog is dedicated to summarizing the progress of the first phase of Google Summer of Code 2024 for the **Forum Revamp Project**. |
| 14 | + |
| 15 | +### About the Project |
| 16 | + |
| 17 | +Currently, our forum is built using [simple_discussion](https://github.com/circuitverse/simple_discussion) Rails engine, which lacks many features and is not actively maintained. The main goal of this project is to revamp the forum with new features such as a Markdown Editor for drafting forum posts, moderation tools, spam reporting features, a leaderboard for active forum users, and more. |
| 18 | + |
| 19 | +So far, we have covered and implemented the following features in the first phase of the project: |
| 20 | + |
| 21 | +* **Removed old unsupported Rails versions from Appraisal Tests** |
| 22 | +* **Fixed CI fails and improved the development environment** |
| 23 | +* **Language Filter to gatekeep inappropriate language** |
| 24 | +* **Report as Spam feature** |
| 25 | +* **New forum thread notification in Slack channel** |
| 26 | +* **Added SimpleMDE Markdown editor for drafting messages** |
| 27 | + |
| 28 | +For detailed implementation of these features do checkout the biweekly blog posts [here](https://waishnav.github.io/blog/tags/gsoc/). |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +### Appraisal Tests and CI Fixes |
| 33 | + |
| 34 | +These tests are crucial from the gem maintainer's perspective as they help ensure that the gem is compatible with different versions of Rails. The Appraisal gem was already being used in the Rails engine but had not been updated for a long time. In weeks 1 and 2, I fixed the appraisal tests and updated them with currently supported Rails versions. During these weeks, I learned a lot about testing and debugging dependency version mismatch issues. |
| 35 | + |
| 36 | +I also explored improving the development experience by integrating various tools like Solargraph and RubyLSP. With guidance from my mentors, I chose RubyLSP as it is more stable and actively maintained. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +### Language Filter and Profanity Check |
| 43 | + |
| 44 | +Since the forum is public, it is crucial to gatekeep inappropriate language. This problem is common in public forums where users sometimes use inappropriate language. To solve this problem, we used the `language_filter` gem, which allows us to filter inappropriate words from forum posts. |
| 45 | + |
| 46 | +The idea is to throw an error message to the user if the post contains any inappropriate language. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +### UI-UX Improvements |
| 53 | + |
| 54 | +The following are some small UI-UX improvements we have made to the forum post card: |
| 55 | + |
| 56 | +#### 1. Dropdown in Forum Post Card for Actions |
| 57 | + |
| 58 | + |
| 59 | +#### 2. Jump to Solution Button and Highlighted Solution |
| 60 | + |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +### Report as Spam Feature |
| 65 | + |
| 66 | +We have covered the language filter to gatekeep inappropriate language. However, there are still chances that users can post spam content since the `language_filter` gem is not that powerful. To mitigate this, we implemented the **Report as Spam** feature. This feature allows users to report a post as spam. Once reported, the post will be reviewed by moderators. |
| 67 | + |
| 68 | +To learn more about the implementation details, you can check out my biweekly blog post on my GSoC experience [here](https://medium.com/@waishnav/moderation-tools-and-spam-reports-week-3-4-report-gsoc24-circuitverse-f0d214648bf3). In the blog, I've discussed each aspect of the implementation in detail. |
| 69 | + |
| 70 | +#### 1. Report as Spam Modal |
| 71 | + |
| 72 | + |
| 73 | +#### 2. Moderator Review Page |
| 74 | + |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### Slack Notification for New Forum Thread |
| 79 | + |
| 80 | +Currently, Slack is our main communication channel for both contributors and users. To keep the community updated about new forum threads, we implemented the Slack notification feature. This feature notifies the Slack channel about new forum threads. |
| 81 | + |
| 82 | +It was fairly simple to implement, thanks to the `noticed` gem and Slack webhook integration documentation. Every time a new forum thread is created, the Slack community will be notified. |
| 83 | + |
| 84 | +{{< video src="/images/waishnav_deore/slack-notification.mp4" type="video/mp4" preload="auto" >}} |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +### Markdown Editor Using SimpleMDE |
| 89 | + |
| 90 | +This feature is significant as it allows users to draft forum posts in Markdown format. It can be useful for adding more features like embedding CircuitVerse circuits, tagging users, embedding YouTube videos, and more using Markdown syntax extensions. So far, we have added the Markdown editor without any extensions, which will be added in the next phase of the project. |
| 91 | + |
| 92 | +Here is how the Markdown editor looks: |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### Link to All Pull Requests |
| 99 | + |
| 100 | +- `Week 1:` [Adding supported Rails versions in Appraisal](https://github.com/CircuitVerse/simple_discussion/pull/22) |
| 101 | +- `Week 2:` [Fixing CI fails](https://github.com/CircuitVerse/simple_discussion/pull/23) |
| 102 | +- `Week 3:` [Adding language filters and UI changes](https://github.com/CircuitVerse/simple_discussion/pull/24) |
| 103 | +- `Week 4:` [Report as spam and moderation review page](https://github.com/CircuitVerse/simple_discussion/pull/25) |
| 104 | +- `Week 5:` [Slack notification in specific channel for new thread](https://github.com/CircuitVerse/CircuitVerse/pull/5005) |
| 105 | +- `Week 6:` [Markdown editor using SimpleMDE](https://github.com/CircuitVerse/simple_discussion/pull/26) |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +### Future Work |
| 110 | + |
| 111 | +The work of phase 1 focused on adding high-priority features to the forum like language filters, spam reporting, markdown editor, and Slack notifications. |
| 112 | + |
| 113 | +In the second phase, we will focus on adding features like embedding CircuitVerse circuits, tagging users, etc., in the Markdown editor, and adding a leaderboard for active forum users. |
| 114 | + |
| 115 | +More importantly, if time permits, we will consider republishing the Rails engine as a new gem with all these new features. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +### Learning |
| 120 | + |
| 121 | +Following are the key takeaways from the first phase of the project: |
| 122 | + |
| 123 | +- The importance of `git rebase` over `git merge` for maintaining a clean git history. |
| 124 | +- Learning the internals of the Rails engine and how to integrate it with the main application. |
| 125 | +- Understanding the importance of testing and its significance as a gem maintainer and library author. |
| 126 | +- Improved debugging skills through extensive bug fixing. |
| 127 | +- The importance of feature flags in the Rails engine to toggle features through configuration. |
| 128 | +- Gaining confidence in navigating and understanding large codebases with the help of git commit history. |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +### Conclusion |
| 133 | + |
| 134 | +Over the past few weeks, I've had an incredible journey contributing to CircuitVerse. The community has been supportive and motivating, and I had the freedom to meticulously plan and execute my tasks, all under the helpful guidance of my mentors. |
| 135 | +I've learned a lot about the inner workings of Rails Engine, and I've gained a lot of confidence in my abilities as a developer. |
| 136 | + |
| 137 | +I would like to thank my mentors, [Aboobacker MK](https://github.com/tachyons) and [Tanmoy Sarkar](https://github.com/tanmoysrt), for always being there to help me out and guiding me throughout this period. |
0 commit comments