Skip to content

Instantly share code, notes, and snippets.

@shubhsherl
Last active December 8, 2020 11:29
Show Gist options
  • Save shubhsherl/21e32429bbdec6d62392df90f5ccde96 to your computer and use it in GitHub Desktop.
Save shubhsherl/21e32429bbdec6d62392df90f5ccde96 to your computer and use it in GitHub Desktop.
GSoC work submission.

RCGSoC

Project: Articles (a social feature) integration in Rocket.Chat using Ghost CMS.

Student: Shubham Singh

Contact:

Special thanks to my Mentors and community:

  • Peter Lepeska
  • Karan Bedi
  • Ramkumar KB
  • Hou Jian

Mid-point review:

Mid-term presentation: Slides

Mid term video demo: Video

Objective

The objective of this project is to integrate an article publishing feature for every user. In this, user can publish articles and share with other members in a channel/group and collaborate on articles.

The most challenging part of implementing the project is the syncing part where we were to work on the two different applications with same user and other details and keep them both in sync.

Useful Links

These are some useful links related to the project.

Compact report with all the corresponding links of PRs.

Note: Original proposal tells about the possibility of using Strapi for CMS, but Strapi was in alpha mode during this project which discourages to use it for integration.

Link to pull requests

Note: These are pull requests made in succession. The PRs below contain changes of the previous PRs too.

Rocket Chat

Repository: shubhsherl/Rocket.chat

1. Add user to Ghost

  • Add meteor methods to add users in Ghost.
  • Verifies all the settings before Adding User.
  • Redirects user to Ghost Dashboard.

2. Support Announcement message

  • Add incoming callback for articles.
  • Send a message for announcing post when an article is published.

3. Add type params in creatediscussion API

  • Add a params of type to allow to create public discussion room using API call.

4. Add outgoing callbacks

  • Add outgoing callback to keep both db in sync.
  • After this PR some of the changes are removed.
  • Outgoing callback is used to delete the user once, removed from RC.

5. Add Message Actions

  • Add message actions to switch between rooms using rid.

6. Refactor code after using MongoDB from Ghost

  • Refactor the code and removed some functions after ghost is using RC DB directly using mongoClient.

Final PR: pull/8 with all the commits.

Ghost

Repository: shubhsherl/Ghost

1. Setup from RC

  • Setup Ghost from Rocket Chat.
  • Add RC users in Ghost.
  • Add authentcation from RC using API calls.

2. Announce Published post

  • Add outgoing call to send message announcing the published post in channel.

3. Create Discussion Room

  • Add discussion room on articles.
  • Discussion rooms are created public/private with parent room as user self room.

4. Allow Collaboration on Articles

  • Allow collaborations on articles from announcing channel/group.
  • Collaboration gives full access to the member of channel on the post.

5. Incoming callbacks

  • Add incoming callback to keep both db in sync.
  • After this PR some of the changes are removed.
  • Incoming callback is used to delete the user once, removed from RC.

6. Clean Some Ghost Functions

  • Clean the models/functions which are not in use after integration with RC.

7. Redefine Roles

  • Redefine roles in Ghost.
  • Learn more about roles in Ghost here

8. Add new Mapache Theme

  • Add new theme which matches with RC.
  • Repository for new theme can be found here

9. Fix some failing tests

  • After integrating with RC, many function are changed in Ghost.
  • This PR fixes some failing tests and add new tests as required.

10. Ability to create private post

  • Create posts which are restriced to users of announcing group only.
  • Private post are not shown on the site and can be accessed using Url only.

11. Access RC MongoDB

  • To tackle the problem of database sync, now ghost is not storing any user related fields which are fetched from RC.
  • Ghost can access MongoDB in readonly mode and fetches the details everytime required on Ghost.

Final PR: pull/11 with all the commits.

Ghost-Admin

Repository: shubhsherl/Ghost-Admin

1. Add setting page

  • Add setting page for RC related settings.
  • Modal for admin to add user from RC.

2. Add Announcment setting

  • Add announcement setting for post.
  • Announcement setting allows to set room for announcment/collaborate/private post.
  • Toggle option to send message on publishing.

3. Add Comment

  • Creates discussion room on post.
  • Toggle discussion type to create private discussions.

4. Collaboration

  • Add collaboration option on post setting.
  • Try to collaborate with user from announing post, if collaboration is allowed.

5. Clean Some routes

  • Clean the routes not required for RC integration.
  • Remove pages which are not requied, such as setup form, login form.

6. Redefine roles

  • Front part to restrict access of settings.

7. New Theme Mapache

  • Add new Mapache theme.
  • Repository for new theme can be found here

8. Tests

  • Fix the failing tests.
  • Add test as required.

9. Setting for private post

  • Setting for post to be private state.

Final PR: pull/11 with all the commits

Ghost-CLI

Rc-ghost-CLI to install and setup our version of ghost.

Mapache

Theme used as default for RC-Ghost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment