An easy to use full-stack component (ReactJS + backend behaviors) embedding Rocket.Chat into your webapp.
EmbeddedChat is a full-stack React component node module of the RocketChat application that is fully configurable, extensible, and flexible for use. It is tightly bound with the RocketChat server using Rocket.Chat nodejs SDK and its UI using RocketChat's Fuselage Design System.
Installtion and usage documentation could be found here EmbeddedChat installation and usage
To develop and test EmbeddedChat, a local instance of Rocket.Chat server is necessary. For setting up a Rocket.Chat development environment, follow the guide provided at Rocket.Chat GitHub Repository.
-
Node.js: Version 16.19.0 is required. Use Node Version Manager (NVM) for easy switching between Node.js versions.
To install and use the correct Node.js version, execute:
nvm install nvm use
-
Yarn Workspaces: Ensure Yarn workspaces are enabled. If not, run:
corepack enable
Install all necessary dependencies and build the packages (auth, api, and react) with:
yarnNavigate to the react package and start Storybook:
cd packages/react
yarn storybookStorybook should now be operational. Experiment with EmbeddedChat and its components, observing real-time changes in Storybook.
By default, Storybook connects to http://localhost:3000. To use a different Rocket Chat server:
-
Create a
.envfile in thepackages/reactdirectory. -
Set the
STORYBOOK_RC_HOSTvariable:STORYBOOK_RC_HOST=<your-custom-url>
Alternatively, run this command in the
packages/reactdirectory:STORYBOOK_RC_HOST=<your-custom-url> yarn storybook
To develop and test changes in the auth package:
-
Navigate to the
authpackage directory. -
Start the playground server:
cd packages/auth yarn dev
For development in the api package:
-
Navigate to the
apipackage directory. -
Start the playground server:
cd packages/api yarn dev
Note: The react package depends on the api package. After making changes to api, rebuild it with yarn build in package/api, and then restart the react projects.
Similarly, the api package depends on the auth package. After changes to auth, rebuild it with yarn build in package/auth, and then restart the api development environment.
This setup provides a comprehensive environment for developing and testing the EmbeddedChat component, along with its associated api and auth packages. Enjoy exploring and enhancing the capabilities of EmbeddedChat!
