In this guide you will get an overview of the contribution workflow of the editor.
If you don't have git on your machine, install it.
Go to GitHub and fork the repository. The forked repository will appear in your GitHub account as
https://github.com/<YOUR-USERNAME>/sunbird-collection-editor
Now clone the forked repository to your machine. Go to your GitHub account, open the forked repository, click on the code button and then click the copy to clipboard icon.
Open a terminal and run the following git command:
git clone "url you just copied"
For example: git clone https://github.com/Sunbird-Ed/sunbird-collection-editor.git
cd sunbird-collection-editor
npm install
npm run build-lib
It will create a /dist/collection-editor-library
folder at the root directory and also copy all the required assets.
A sample angular application is included as part of this repo
Open your terminal, then start the server
npm run start
The demo app will launch at http://localhost:4200
Go to the root directory - Open server.js
file
Update the host variable to which env your pointing. example if you are pointing sunbird dev instance update variable like below
const BASE_URL = 'dev.sunbirded.org'
const API_AUTH_TOKEN = 'XXXX'
const USER_TOKEN= 'YYYY'
Note: You will need actual API_AUTH_TOKEN
and USER_TOKEN
If you are pointing to sunbird dev (dev.sunbirded.org), create a collection in sunbird dev and set the do_id of created collection in data.ts
file
export const collectionEditorConfig = {
context: {
...
identifier: 'do_id', // identifier of collection created in sunbird dev
...
},
config: {
...
...
}
}
Run Node server to proxy the APIs (Open one more terminal in root folder and run the server.js ) as:
nodemon server.js