Discussion Forum: Deployment
it
Nodebb Setup
- 1 Nodebb Setup
- 2 Install nodebb plugins
- 3 Activate Plugins
- 4 Step-1: Create a group(Category Owner) in Nodebb
- 5 Step-2: Create category in Nodebb
- 6 Step-3: Enable Previlages For users.
- 7 Step-4: Verify the plugins
- 8 Step-5: Creating Nodebb Token
- 9 Step-6: Store Sunbird identifier mapped with NodeBB category
- 10 Edit User Post:
- 10.1 Issues:
- 11 Admin panel settings
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
Stop the nodebb application by running
./nodebb stop
in the nodebb root folder.Run the below commands to install the nodebb-plugins.
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.
NodeBB-Plugin names
Default plugin of nodebb-plugin which will enable API access for nodebb server.
Below are the custom plugins we wrote for nodebb for sunbird specific use-cases
nodebb-plugin-azure-storage - Not using
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)
Login to Nodebb as a admin
Go to admin pannel
Click on Manage and select Groups
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.
Add members who is having creator/mentor role into that group
go to admin panel and click on Manage tab select Groups
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
Login as admin and go to admin pannel
click on “Manage“ tab and select “Categories“
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”
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).
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
Login as a admin
Go to admin panel
Click on “Manage“ tab and select “Privileges“, It will redirected to Privileges selection
You can a dropdown button, click on that and select “Covid 19 Guidelines - Batch1“ category
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
Normal register users, Verified users and unverified users can not create a topic so deselect that check box under create topic selection.
Category owners can create a topics so select the check box under create topic selection and select checkbox under Moderators also.
After adding privileges to “Covid 19 Guidelines- Batch1“ select “Announcements“ Repeat step no 6 and 7.
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
nodebb-plugin-write-api
nodebb-plugin-create-forum
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.
Login as a Admin
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 |
---|---|---|---|
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 | |
---|---|---|---|
1 | Number of seconds between posts | 0 | |
2 | Seconds between posts for new users | 5 | |
3 | Seconds before a new user can make their first post | 0 | |
4 | Number of seconds a post remains editable (set to 0 to disable) | 0 | |
5 | Enable Traffic Management | disable | |
6 | Topics per Page | 50 | |
7 | Maximum topics per page | 50 | |
8 | Default Topic Sorting | Newest to Oldest | |
9 | Default Post Sorting | Oldest to Newest | |
10 | Downvotes per day (set to 0 for unlimited downvotes) | 0 | |
11 | Downvotes per user per day (set to 0 for unlimited downvotes) | 0 | |
12 | Minimum reputation to downvote posts | -5 | |
13 | Posts per Page | 50 | |
14 | Maximum posts per page | 50 | |
15 | Pagination Settings | Enable |
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.