encorelab / ck-board

The Common Knowledge (CK) Board is the latest rebuild of the ENCORE Lab's collaborative canvas for guiding collective inquiry and active learning activities.
https://ck-board.oise.utoronto.ca/
GNU General Public License v3.0
7 stars 3 forks source link
angular mongo nodejs websockets

Description

This Common Knowledge (CK) Board is the latest rebuild of the ENCORE Lab's collaborative canvas for guiding collective inquiry and active learning activities.

Setup

1. Install Node.js, Angular, and Redis

2. Clone the repository

$ git clone https://github.com/encorelab/ck-board.git

3. Install required dependencies

Install Frontend dependencies:

$ cd frontend
$ npm install

Install Backend dependencies:

$ cd backend
$ npm install

4. Add environment variables

Create a .env file inside the /backend directory (touch .env in your terminal or manually create file using your IDE)

Add the following content into the .env file and replace with your own credentials:

DB_USER=[MongoDB Username]
DB_PASSWORD=[MongoDB Password]
DB_URL=[MongoDB URL]
DB_NAME=[MongoDB Name]
JWT_SECRET=[JWT Secret Token]
PORT=8001
STATIC_FILES_PATH=[for dev, use "./../../frontend/dist/ck-board"; for production, use "/site/wwwroot/frontend/dist/ck-board"]
CKBOARD_SERVER_ADDRESS=[For dev, use "http://localhost:4201"; for production, use server URL, e.g., "https://ck-board.oise.utoronto.ca"]
GOOGLE_APPLICATION_CREDENTIALS="./secrets/keyfile.json"
GOOGLE_CLOUD_PROJECT=[Google Cloud Project ID]

1. GOOGLE_APPLICATION_CREDENTIALS

2. GOOGLE_CLOUD_PROJECT

SCORE SSO (Optional)

If also running SCORE for Single Sign-On (SSO), add the following additional content into the .env file and replace with your own credentials:

SCORE_SSO_ENDPOINT=/sso/ckboard
SCORE_SSO_SECRET= [any value that matches ck_board_sso_secret on SCORE]
SCORE_LOGOUT_ENDPOINT=/api/logout 

For the SCORE development environment, add the following values to application-dockerdev.properties

ck_board_url=http://localhost:4201
ck_board_sso_secret_key=[any value that matches SCORE_SSO_SECRET on CK Board]

5. Run Application

Start redis, server first, then start client app once the server has successfully started:

$ redis-server   # Start redis server on default port

# … Open a new terminal tab to run backend server

$ cd backend     # Go into backend folder if not already
$ npm run dev    # Start server

# … Open a new terminal tab to run client app

$ cd frontend    # Go into frontend folder
$ ng serve --port 4201      # Run Angular app; Will start application on http://localhost:4201/

Running database migrations

Switch to the /backend directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Contributing

1. Create or choose an issue from the Issues tab
2. Branch off develop and add your fix in a new branch titled issue-{issue-number}
3. Push your changes
4. Create a pull request with appropriate title and description
5. Add Closes #{issue-number} at the bottom of the PR description
6. Create the pull request and await for approval or feedback.