Forum Revamp: Final Report (GSoC 2024)

GSoC'24@CircuitVerse

Hello Readers,

This blog is dedicated to summarizing the work that we have done and goals that we have met in Google Summer of Code 2024 for the Forum Revamp Project.

Table of Contents

About the Project

Currently, our forum is built using simple_discussion Rails engine, which lacks many features which we needed. 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.

So far, we have covered and implemented the following features in the first phase of the project:

  • Language Filter to gatekeep inappropriate language
  • Report as Spam feature
  • New forum thread notification in Slack channel
  • Added SimpleMDE Markdown editor for drafting messages
  • Markdown syntax extension for embedding circuits, embedding video and user tagging
  • Search functionality on all the forum threads
  • Leaderboard ranking page and points distribution on contribution in forum
  • Improve the documentation according to newly added features

For detailed implementation of these features do checkout the biweekly blog posts here.


Accomplishments

1. Language Filter and Profanity Check

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.

The idea is to throw an error message to the user if the post contains any inappropriate language.

language-filter


2. UI-UX Improvements

The following are some small UI-UX improvements we have made to the forum post card:

a. Dropdown in Forum Post Card for Actions

dropdown

b. Jump to Solution Button and Highlighted Solution

solution-highlight


3. Report as Spam Feature

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.

To learn more about the implementation details, you can check out my biweekly blog post on my GSoC experience here. In the blog, I’ve discussed each aspect of the implementation in detail.

a. Report as Spam Modal

report-as-spam-modal

b. Moderator Review Page

moderator-review-page


4. Slack Notification for New Forum Thread

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.

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.


5. Markdown Editor

a. Markdown editor using SimpleMDE

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.

Here is how the Markdown editor looks:

markdown-editor-simplemde

b. Markdown Syntax extension

As our needs for this forum to be used in production, we need to able to embed the circuitverse ciruits, youtube video and user tagging.

For this implementation, I extended the markdown syntax both at client side using regex and server side using redcarpet gem.

1. Circuit Embedding

embed-circuit

2. Video Embedding

embed-video

3. User tagging

tag-user


Searching is important aspect, it can help user to search for issue/discussion which they are looking for. Also it can help reduce the duplicate or similar discussion.

Since we are working on gem (library), we can’t be sure where this gem can be used. I mean, it can be used in rails application with Postgres as db, MySQL as db or any other db. If we have had vendor locked the db as Postgres, search feature can be implemented through Postgres’s Full text search. But we can’t do that. So we have to give users of this engine option to override the default search functionality with their own implementation.

Here is the video of search functionality which will be going to be used by CircuitVerse using PgSearch gem.


7. Leaderboard Ranking

Ranking is important for judging the credibility of a message, and it’s also crucial for recognizing the contributions of forum members.

During the implementation, I got little confuse where the distribution of the points logic should exists, in the controller or in the model file. Then I read few blogs on fat model and slim controllers and vice versa. In the rails, these conventions are very helpful and important, depending on it’s usecase one can utilize this concepts.

Here is the screenshot of leaderboard page. Note: UI of leaderboard may change later

leaderboard-ranking


Pull Requests


Blogs

CV community encourage to document each and every aspect of project. So I posted the biweely blogs and shared the progress as well as the implementation details in depth of each features and documented the whole project. You guys can checkout these blogs here

What’s Next?

I’m excited to continue to contribute to this incredible open-source project which helps students to design and learn about digital circuit design.

Additionaly, I started to work on this project with the thought that this revamped forum gem will be distributed and published as different name, instead of simple_discussion


Learning

Following are the key takeaways from the first phase of the project:

  • The importance of git rebase over git merge for maintaining a clean git history.
  • Learning the internals of the Rails engine and how to integrate it with the main application.
  • Understanding the importance of testing and its significance as a gem maintainer and library author.
  • Improved debugging skills through extensive bug fixing.
  • The importance of feature flags in the Rails engine to toggle features through configuration.
  • Gaining confidence in navigating and understanding large codebases with the help of git commit history.

Acknowledgments and Conclusion

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. 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.

I would like to thank my mentors, Aboobacker MK and Tanmoy Sarkar, for always being there to help me out and guiding me throughout the project.

comments powered by Disqus