Demo quickstart
Updated
Quickly launch a flexible classroom and experience the features.
Compelling content like animated presentations with embedded media helps actively engage students for longer in online classrooms. Agora Flexible Classroom helps you personalize distance learning using interactive video, shared whiteboards and other collaboration tools. With Flexible Classroom, you can quickly deploy effective online tutoring software that is customized with the features and branding your organization needs.
This page shows you how to quickly set up and launch a Flexible Classroom.
Understand the tech
This section explains the workflow you implement to join a Flexible Classroom.
When an app client requests to join a Flexible Classroom, the app client and your app server interact with the Agora server in the following steps:
- Your app client sends a request to your app server for a Signaling token.
- Your app server generates a Signaling token using the Agora App ID, App Certificate, and a user ID. For details, see Generate a Signaling token.
- Your app client calls an API with the following parameters to join a Flexible Classroom:
- The user ID: A unique string identifying a user, generated by your security system. This ID must be the same as the user ID you use for generating the Signaling token.
- The room ID: A string for identifying a classroom. When the first user joins a Flexible Classroom, Agora automatically creates a classroom with the room ID.
- The Signaling token: A credential for verifying the identity of the user when they join a Flexible Classroom.
Prerequisites
In order to follow this procedure you must have:
- An Agora account and project.
- A computer with Internet access. Ensure that no firewall is blocking your network communication.
- Enabled Flexible Classroom in Agora Console.
Web
- Installed Git
Project setup
To set up and run your Flexible Classroom project, you need the following tools:
Node.jsJavaScript runtime environment for building and running the web project.yarn: A package manager.nvm: (Optional) Version management command-line tool forNode.js.
Install the development tools
To prepare your development environment:
-
Download Git.
-
Download and install Node.js. It is recommended to use Node.js 16. Node.js 18 and above versions are not supported yet.
-
Install Yarn:
-
If you have
Node.js16.10or later, you can directly enableyarnwith the following command:corepack enable -
If you have a version of
Node.jsearlier than 16.10, you need to installcorepackfirst and then enableyarnwith the following command:npm i -g corepack enable
-
-
(Optional) To install
nvm, run the following command:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash -
(Optional) When Electron installation fails, you can install it by setting the Electron mirror address:
export ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ export ELECTRON_CUSTOM_DIR=v12.0.0 export ELECTRON_CUSTOMDIR=v12.0.0
Download the source code
To set up your Flexible Classroom project:
-
Clone the repository locally by running the following command:
git clone https://github.com/AgoraIO-Community/flexible-classroom-desktop.git -
After the download is complete, navigate to the folder:
cd flexible-classroom-desktop -
Best practice is to switch to the latest release.
To switch to the branch for version
2.9.0, run the command:git checkout release/2.9.0
Implement a Flexible Classroom
Follow these steps to launch a Flexible Classroom:
-
Open a terminal window and navigate to the
Flexible-Classroom-Desktopfolder. Run the following command to install the project dependencies:yarn install:packagesIf the installation dependency times out, switch to an available mirror source:
# Switch to a mirror yarn config set registry https://registry.npmmirror.com/ # Install dependencies yarn install:packages -
Copy the App ID and App Certificate from Agora Console and update the corresponding parameters in the
.envfile:REACT_APP_AGORA_APP_ID={your appid} REACT_APP_AGORA_APP_CERTIFICATE={your app certificate}To facilitate your testing, the
Flexible-Classroom-Desktopproject contains a Signaling Token generator, which can generate a temporary Signaling Token with the App ID and App Certificate you provide. When your project goes live, you must deploy a Signaling Token generator on your server to ensure security. -
Run the following command to launch the web client in different development modes:
# Start Flexible Classroom Demo debugging yarn dev # Start AgoraEduSDK debugging yarn dev:classroom # Start Proctor SDK debugging yarn dev:proctor # Start FcrUIScene debugging yarn dev:sceneIf you use Node.js 17, you may encounter the
ERR_OSSL_EVP_UNSUPPORTEDerror. This is because Node.js 17 has switched to OpenSSL 3.0 and conflicts with the encryption algorithm or key being used in some dependencies in the project. You can try the following two solutions:- Add
NODE_OPTIONparameters--openssl-legacy-provider
# Find the Node.js configuration file packages/agora-demo-app/package.json # To modify the startup command under the script field, add the NODE_OPTION parameter, for example: # Original command "dev": "cross-env NODE_ENV=development NODE_OPTIONS=--max_old_space_size=6144 FCR_ENTRY=demo webpack serve --config ./webpack.dev.js" # Change to "dev": "cross-env NODE_ENV=development NODE_OPTIONS=\"--max_old_space_size=6144 --openssl-legacy-provider\" FCR_ENTRY=demo webpack serve --config ./webpack.dev.js" # Then start the project yarn dev- Use nvm to downgrade the Node.js version to 16
# Use nvm to manage Node.js versions # Install nvm yarn global add nvm # Install Node.js version 16 using nvm nvm install 16 # Use Node.js version 16 nvm use 16 # Start Flexible Classroom yarn dev - Add
Test your implementation
-
Open the browser and navigate to
http://localhost:3000. You see the login page of Flexible Classroom. -
To join a classroom, type in a room name and user name. Select a class type, set the user role to
Teacherand then press Enter.You are logged in to Flexible Classroom.
-
Install Flexible Classroom on a second device. Login with the same credentials but this time set the user role to
Student. -
The
TeacherandStudentcan now interact and communicate using Flexible Classroom features.
References
To ensure communication security in a test or production environment, use a token server to generate tokens. See Secure authentication with tokens.
