Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions ui-library-filesharing-chat-composite/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
page_type: sample
languages:
- javascript
- javascript
products:
- azure
- azure-communication-services
- azure
- azure-communication-services
---

# UI Library Sample - File Sharing using UI Chat Composite
Expand All @@ -15,10 +15,11 @@ into an [Azure Communication Services][docs-root] powered [React] application.
For a step-by-step guide to building this sample yourself, see the [associated tutorial](https://docs.microsoft.com/azure/communication-services/tutorials/file-sharing-tutorial).

This sample includes:
* A React based application showcasing file sharing feature using UI chat composite provided by the [Azure Communication Services UI library][docs-ui-library].
* Backend API for uploading file to Azure Blob Storage built using [Typescript Azure Functions][typescript-azure-functions].

>This Quickstart for FileSharing is not to be confused with the Teams Interopability feature where a ACS user can receive [SharePoint files](https://learn.microsoft.com/microsoft-365/solutions/microsoft-365-limit-sharing?view=o365-worldwide) with proper file permissions shared by a Teams user. This feature is currently available in Public Preview, for more information please refer to [Supplemental Terms of Use for Microsoft Azure Previews.](https://azure.microsoft.com/support/legal/preview-supplemental-terms/)
- A React based application showcasing file sharing feature using UI chat composite provided by the [Azure Communication Services UI library][docs-ui-library].
- Backend API for uploading file to Azure Blob Storage built using [Typescript Azure Functions][typescript-azure-functions].

> This Quickstart for FileSharing is not to be confused with the Teams Interopability feature where a ACS user can receive [SharePoint files](https://learn.microsoft.com/microsoft-365/solutions/microsoft-365-limit-sharing?view=o365-worldwide) with proper file permissions shared by a Teams user. This feature is currently available in Public Preview, for more information please refer to [Supplemental Terms of Use for Microsoft Azure Previews.](https://azure.microsoft.com/support/legal/preview-supplemental-terms/)

[docs-root]: https://docs.microsoft.com/en-us/azure/communication-services/
[docs-ui-library]: https://azure.github.io/communication-ui-library/
Expand All @@ -27,33 +28,32 @@ This sample includes:

## Code organization

* [app/](./app) - This directory contains source code for the React frontend.
* [app/src/App.tsx](./app/src/App.tsx) - Application entry-point. Built primarily using UI library's [ChatComposite](https://azure.github.io/communication-ui-library/?path=/docs/composites-chat-basicexample--basic-example).
* [api/](./api) - This directory contains the source code for the backend API.
* [api/UploadFileToAzureBlobStore](./api/UploadFileToAzureBlobStore/index.ts) - Azure Function to upload the file to Azure Blob Store.

- [app/](./app) - This directory contains source code for the React frontend.
- [app/src/App.tsx](./app/src/App.tsx) - Application entry-point. Built primarily using UI library's [ChatComposite](https://azure.github.io/communication-ui-library/?path=/docs/composites-chat-basicexample--basic-example).
- [api/](./api) - This directory contains the source code for the backend API.
- [api/UploadFileToAzureBlobStore](./api/UploadFileToAzureBlobStore/index.ts) - Azure Function to upload the file to Azure Blob Store.

### Prerequisites - Azure Resources

You need a few Azure resources before running this sample locally.

* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) .
* [Node.js](https://nodejs.org/en/) Active LTS and Maintenance LTS versions (20.x.x is recommended).
* An active Communication Services resource. [Create a Communication Services resource](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource).
* An identity with Chat scope. Generate an identity using the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/identity/quick-create-identity).
* [Azure Storage Account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview)
* [Azure Blob Storage](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-nodejs)
* For using azure storage in production environments, please follow the [azure storage application architecture guide](https://docs.microsoft.com/en-us/azure/architecture/guide/multitenant/service/storage)
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) .
- [Node.js](https://nodejs.org/en/) Active LTS and Maintenance LTS versions (20.x.x is recommended).
- An active Communication Services resource. [Create a Communication Services resource](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource).
- An identity with Chat scope. Generate an identity using the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/identity/quick-create-identity).
- [Azure Storage Account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview)
- [Azure Blob Storage](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-nodejs)
- For using azure storage in production environments, please follow the [azure storage application architecture guide](https://docs.microsoft.com/en-us/azure/architecture/guide/multitenant/service/storage)

### Prerequisites -- Configuration

Once you have these resources setup, you need to replace the placeholders in these two files:

* [api/local.settings.json](./api/local.settings.json)
* Enter the access key based [connection string for the Azure Storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string).
* Enter all the required details in [app/src/App.tsx](./app/src/App.tsx).
* A UserId and Token can be generated using [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/identity/quick-create-identity).
* ThreadId can be generated by following [Microsoft Docs](https://docs.microsoft.com/en-us/javascript/api/overview/azure/communication-chat-readme?view=azure-node-latest).
- [api/local.settings.json](./api/local.settings.json)
- Enter the access key based [connection string for the Azure Storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string).
- Enter all the required details in [app/src/App.tsx](./app/src/App.tsx).
- A UserId and Token can be generated using [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/identity/quick-create-identity).
- ThreadId can be generated by following [Microsoft Docs](https://docs.microsoft.com/en-us/javascript/api/overview/azure/communication-chat-readme?view=azure-node-latest).

### Prerequisites - Developement Environment

Expand All @@ -77,7 +77,6 @@ You'll need to run the client and server separately:
- Start the Static Web Apps proxy:
`npm run start:dev`


Navigate to your application at `localhost:4280`.

Currently, `azure-functions-core-tools` supports up to Node.js v20. If you're using a higher version (e.g., v22), you may encounter issues such as `localhost:4280` showing a "This site can’t be reached" error.
Currently, `azure-functions-core-tools` supports up to Node.js v20.9. If you're using a higher version (e.g., v22), you may encounter issues such as `localhost:4280` showing a "This site can’t be reached" error.
8 changes: 4 additions & 4 deletions ui-library-filesharing-chat-composite/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui-library-filesharing-chat-composite/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@azure/communication-calling": "1.36.1-beta.1",
"@azure/communication-calling-effects": "1.1.4",
"@azure/communication-chat": "1.6.0-beta.7",
"@azure/communication-react": "1.28.0-beta.1",
"@azure/communication-react": "1.28.0-beta.2",
"@vitejs/plugin-react": "^4.4.1",
"axios": "^1.7.7",
"form-data": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion ui-library-filesharing-chat-composite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui-library-filesharing-chat-composite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@playwright/test": "^1.47.1"
},
"engines": {
"node": "20.x"
"node": "20.9.x"
}
}
2 changes: 1 addition & 1 deletion ui-library-filesharing-chat-composite/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineConfig({
// stdout: "pipe",
},
{
command: "npx -p node@16 npm run start:dev",
command: "npx -p node@20.9 npm run start:dev",
port: 4280,
reuseExistingServer: false,
timeout: 120 * 1000,
Expand Down
15 changes: 8 additions & 7 deletions ui-library-filesharing-ui-components/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
page_type: sample
languages:
- javascript
- javascript
products:
- azure
- azure-communication-services
- azure
- azure-communication-services
---

# UI Library Sample - File Sharing using UI Components

>This Quickstart for FileSharing is not to be confused with the Teams Interoperability feature where a ACS user can receive [SharePoint files](https://learn.microsoft.com/microsoft-365/solutions/microsoft-365-limit-sharing?view=o365-worldwide) with proper file permissions shared by a Teams user. This feature is currently available in Public Preview, for more information please refer to [Supplemental Terms of Use for Microsoft Azure Previews.](https://azure.microsoft.com/support/legal/preview-supplemental-terms/)
> This Quickstart for FileSharing is not to be confused with the Teams Interoperability feature where a ACS user can receive [SharePoint files](https://learn.microsoft.com/microsoft-365/solutions/microsoft-365-limit-sharing?view=o365-worldwide) with proper file permissions shared by a Teams user. This feature is currently available in Public Preview, for more information please refer to [Supplemental Terms of Use for Microsoft Azure Previews.](https://azure.microsoft.com/support/legal/preview-supplemental-terms/)

## Prerequisites

- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) .
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) .
- [Node.js](https://nodejs.org/en/) Active LTS and Maintenance LTS versions (20.x.x is recommended).
- An active Communication Services resource. [Create a Communication Services resource](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource).
- An identity with Chat scope. Generate an identity using the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/identity/quick-create-identity).
Expand All @@ -26,12 +27,12 @@ products:

The project can then be accessed on `localhost:4280`

Currently, `azure-functions-core-tools` supports up to Node.js v20. If you're using a higher version (e.g., v22), you may encounter issues such as `localhost:4280` showing a "This site can’t be reached" error.
Currently, `azure-functions-core-tools` supports up to Node.js v20.9. If you're using a higher version (e.g., v22), you may encounter issues such as `localhost:4280` showing a "This site can’t be reached" error.

## Code organization

- [app/](./app) - This directory contains source code for the React frontend.
- [app/src/App.tsx](./app/src/App.tsx) - Application entry-point. Built primarily using UI library's [CallComposite](https://azure.github.io/communication-ui-library/?path=/docs/composites-call-basicexample--basic-example). You will need to populate variables like `userId`, `userAccessToken` etc., in this file.
- [app/src/App.tsx](./app/src/App.tsx) - Application entry-point. Built primarily using UI library's [CallComposite](https://azure.github.io/communication-ui-library/?path=/docs/composites-call-basicexample--basic-example). You will need to populate variables like `userId`, `userAccessToken` etc., in this file.
- [app/src/ChatComponents.tsx](./app/src/ChatComponents.tsx) - Chat UI built using UI Library components and logic for implementing file sharing.
- [api/](./api) - This directory contains the source code for the backend API (Azure function).
- [api/UploadFileToAzureBlobStore/index.ts](./api/UploadFileToAzureBlobStore/index.ts) - Azure Function to handle file uploads.
Expand Down
8 changes: 4 additions & 4 deletions ui-library-filesharing-ui-components/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui-library-filesharing-ui-components/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@azure/communication-calling": "1.36.1-beta.1",
"@azure/communication-chat": "1.6.0-beta.7",
"@azure/communication-react": "1.28.0-beta.1",
"@azure/communication-react": "1.28.0-beta.2",
"@vitejs/plugin-react": "^4.4.1",
"axios": "^0.26.0",
"form-data": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion ui-library-filesharing-ui-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui-library-filesharing-ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"printWidth": 120
},
"engines": {
"node": "20.x"
"node": "20.9.x"
}
}
2 changes: 1 addition & 1 deletion ui-library-filesharing-ui-components/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineConfig({
// stdout: "pipe",
},
{
command: "npx -p node@16 npm run start:dev",
command: "npx -p node@20.9 npm run start:dev",
port: 4280,
reuseExistingServer: false,
timeout: 120 * 1000,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@azure/communication-calling": "1.36.1-beta.1",
"@azure/communication-chat": "1.6.0-beta.7",
"@azure/communication-react": "1.28.0-beta.1",
"@azure/communication-react": "1.28.0-beta.2",
"@fluentui/react": "8.112.9",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
"@azure/communication-react": "1.28.0-beta.1",
"@azure/communication-react": "1.28.0-beta.2",
"@fluentui/react": "8.101.0",
"@types/node": "^22.15.18",
"@types/react": "^18.0.0",
Expand Down
8 changes: 4 additions & 4 deletions ui-library-starting-with-chat-stateful/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading