Discussion Forum: Deployment

it

Nodebb Setup

To setup nodebb we have to fallow the below steps

go to nodebb folder and the execute the commands

./nodebb setup ./nodebb start

Install nodebb plugins

To install required nodebb plugins using npm

we are using below plugin

npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-oidc.git npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-telemetry.git npm install https://github.com/Sunbird-Ed/nodebb-plugin-azure-storage.git npm install https://github.com/NodeBB/nodebb-plugin-write-api.git

Activate Plugins

After installing the plugins, we can able to see those plugins in nodebb application but all are in inactive state. To activate the plugins we can use the below command.

command: nodebb activate nodebb-plugin-plugin-name Example: nodebb activate nodebb-plugin-write-api

 

Step-1: Create a group(Category Owner) in Nodebb

create a group "Category Owner" and add the members who is having content creator/ mentor role. (Vinu is exposing one api)

  1. Login to Nodebb as a admin

  2. Go to admin pannel

     

  3. Click on Manage and select Groups

     

  4. Create a gropup by click on “+“ (Icon) right side bottom, It will open a popup

    Enter group name and click on creat, It will create a group.

     

  5. Add members who is having creator/mentor role into that group

    1. go to admin panel and click on Manage tab select Groups

    2. You can see the “Category Owner“ group, click on that one. It will open this page and click on Icon which is highlight. It will open one popup and you have to search by user username and select that user and click on save.

Step-2: Create category in Nodebb

We need to create a categories in Nodebb and enable privileges based on roles.

Steps to create category

  1. Login as admin and go to admin pannel

  2. click on “Manage“ tab and select “Categories“

  3. You can see “+“ icon at right side bottom, click on that, It will open a popup. Enter Category name and click on Save. It will create a category “Covid 19 Guidelines”

     

  4. Again click on “+“ Icon and create one more category for a batch “Batch category“ and select parent category as “Covid 19 Guidelines“, It will create one more category under parent category (Covid 19 Guidelines).

     

  5. Same way create “Announcements“ and “General Discussion“ under “Covid19 GuideLine-Batch1“

 

Step-3: Enable Previlages For users.

We have to give the permission based on use roles.

Steps to add privileges for a users

  1. Login as a admin

  2. Go to admin panel

  3. Click on “Manage“ tab and select “Privileges“, It will redirected to Privileges selection

  4. You can a dropdown button, click on that and select “Covid 19 Guidelines - Batch1“ category

  5. Add a group(Category Owner created in step1) to that category, click on the button “Add Group“ it will open a popup and type group name and select

     

  6. Normal register users, Verified users and unverified users can not create a topic so deselect that check box under create topic selection.

  7. Category owners can create a topics so select the check box under create topic selection and select checkbox under Moderators also.

  8. After adding privileges to “Covid 19 Guidelines- Batch1“ select “Announcements“ Repeat step no 6 and 7.

  9. Select “General Discussion“ under “Covid 19 Guidelines- Batch1“, In this section any user can create a topic so enable the checkbox for all users under create topic section.

 

Step-4: Verify the plugins

We have 3 main plugins

  1. nodebb-plugin-write-api

  2. nodebb-plugin-create-forum

  3. nodebb-plugin-sunbird-api

check above 3 plugins in active state or not, If not active state, Activate.

Step-5: Creating Nodebb Token

We need master token for creating user and user token in the plugins. without master we can’t generate the user token and all nodebb apis need user token to perform nodebb operations.

  1. Login as a Admin

  2. Go to admin pannel

3. Click on PLUGINS and select write api in the drop down.

4. Click on Create Token in Master token section

 

Step-6: Store Sunbird identifier mapped with NodeBB category

Sunbird content(identifier) mapping to NodeBB Category. This is the new collection added to the Mongo DB to store the sunbird identifier mapping with the nodebb category.

SbType

SbIdentifier

cid

Data

SbType

SbIdentifier

cid

Data

Course

do_11317805943810457614592

5

{JSON}

Batch

01316730820300800028

6

{JSON}

Batch

01326730820300800256

7

{JSON}

Post: {host}/discussion/forum/v2/create

cUrl:

Request:

Response:

Get Category mapped to Sunbird Identifier

API to get the NodeBB category(or categories) mapped to the sunbird content or Group etc.

Post: {host}/discussion/forum/v2/read

Curl:

Request:

Response:


Edit User Post:

As a user we can edit our post and for

Issues:


1. SbCategory schema creation having issue in staging

2. Schema creation (sbCategory) for multiple hosts, ports(clustered db)

 

 

Admin panel settings

Login to nodebb using admin credentials to the below link

after login success, click on “Settings“ icon (Top left, last icon )

Column name

Value

Location

Column name

Value

Location

1

Number of seconds between posts

0

/settings/post

2

Seconds between posts for new users

5

/settings/post

3

Seconds before a new user can make their first post

0

/settings/post

4

Number of seconds a post remains editable (set to 0 to disable)

0

/settings/post

5

Enable Traffic Management

disable

/settings/advanced

6

Topics per Page

50

/settings/pagination

7

Maximum topics per page

50

/settings/pagination

8

Default Topic Sorting

Newest to Oldest

/settings/post

9

Default Post Sorting

Oldest to Newest

/settings/post

10

Downvotes per day (set to 0 for unlimited downvotes)

0

/settings/reputation

11

Downvotes per user per day (set to 0 for unlimited downvotes)

0

/settings/reputation

12

Minimum reputation to downvote posts

-5

/settings/reputation

13

Posts per Page

50

/settings/pagination

14

Maximum posts per page

50

/settings/pagination

15

Pagination Settings

Enable

/settings/pagination

Note: When you use nodebb version v1.18.6, you should update nodebb-plugin-mentions plugin with version 3.0.4 from nodebb admin pannel.