{"id":23114582,"url":"https://github.com/yandex-cloud-examples/yc-serverless-alice-shareable-todolist","last_synced_at":"2025-08-16T21:31:35.729Z","repository":{"id":267287360,"uuid":"880323524","full_name":"yandex-cloud-examples/yc-serverless-alice-shareable-todolist","owner":"yandex-cloud-examples","description":"Разработка навыка Алисы и развертвание веб-приложения, которое позволяет создавать, читать и редактировать списки дел с помощью Алисы, а также делиться списками с другими пользователями на сайте.","archived":false,"fork":false,"pushed_at":"2024-12-09T13:08:34.000Z","size":302,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T18:21:31.498Z","etag":null,"topics":["alice-skills","api-gateway","cloud-functions","serverless","yandex-cloud","yandexcloud"],"latest_commit_sha":null,"homepage":"https://yandex.cloud/ru/docs/functions/tutorials/alice-shareable-todolist","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yandex-cloud-examples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-29T14:18:27.000Z","updated_at":"2025-02-15T20:20:31.000Z","dependencies_parsed_at":"2024-12-09T14:27:08.930Z","dependency_job_id":"3a6c509f-a7b6-4c04-83a0-6a3d1b947106","html_url":"https://github.com/yandex-cloud-examples/yc-serverless-alice-shareable-todolist","commit_stats":null,"previous_names":["yandex-cloud-examples/yc-serverless-alice-shareable-todolist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yandex-cloud-examples/yc-serverless-alice-shareable-todolist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yandex-cloud-examples","download_url":"https://codeload.github.com/yandex-cloud-examples/yc-serverless-alice-shareable-todolist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270775799,"owners_count":24642961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alice-skills","api-gateway","cloud-functions","serverless","yandex-cloud","yandexcloud"],"created_at":"2024-12-17T03:32:35.071Z","updated_at":"2025-08-16T21:31:35.719Z","avatar_url":"https://github.com/yandex-cloud-examples.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Developing a skill for Alice and a website with authorization\n\nIn this scenario, you will develop a skill for Alice and deploy a web app for creating, reading and editing to-do lists with Alice's help, as well as for sharing the lists with other users on the website.\n\n## Yandex Cloud Services\n\n* [Yandex Cloud Functions](https://yandex.cloud/ru/docs/functions/)\n* [Yandex API Gateway](https://yandex.cloud/ru/docs/api-gateway/)\n* [Yandex Managed Service for YDB](https://yandex.cloud/ru/docs/ydb/)\n* [Yandex Object Storage](https://yandex.cloud/ru/docs/storage/)\n* [Yandex Key Management Service](https://yandex.cloud/ru/docs/kms/)\n\n## Tools\n\n* [Yandex Cloud command line tool](https://cloud.yandex.ru/docs/cli/)\n* [go-swagger](https://goswagger.io/install.html)\n* [api-spec-converter](https://www.npmjs.com/package/api-spec-converter)\n* [jq](https://stedolan.github.io/jq/)\n* [Terraform](http://terraform.io)\n* [AWS command line tool](https://aws.amazon.com/ru/cli/)\n* Node.js (22.14.0)\n* go (1.21)\n\n## Prerequisites\n\nWe assume that you already have [Yandex Cloud](https://console.cloud.yandex.ru) account with created cloud and folder.\n\n## Initialization\n\n### Create Object Storage bucket\n\nFollow [documentation](https://cloud.yandex.ru/docs/storage/quickstart) to create bucket with any name. Bucket name will be used in project configuration.\n\nConfigure aws cli following [instructions](https://cloud.yandex.ru/docs/storage/tools/aws-cli).\n\n### Create API Gateway\n\nCreate [API Gateway](https://cloud.yandex.ru/docs/api-gateway/) with any name and default specification. Id of created gateway will be used in project configuration.\n\n### Create Yandex Database\n\n[Find out](https://cloud.yandex.ru/docs/ydb/) how to create Yandex Database in serverless mode. DB schema will be applied later. Database name and endpoint will be used in project configuration.\n\n### Create Yandex OAuth application\n\nGo to [Yandex OAuth](http://oauth.yandex.ru) service and create new application.\nYou can use any name you like.\nYou should check \"WEB service platfrom\" and provide at least two callback URIs:\n\n* `\u003capigateway technical domain\u003e/receive-token`\n* `https://social.yandex.net/broker/redirect`\n\nUse technical domain registered for API Gateway you created earlier.\n\nYou should check `login:avatar` permission so that your serverless site can use Yandex user's avatar image.\n  \n## Configuring project\n\n### Common variables\n\nCreate `variables.json` file in project root with values filled with values for your project. You can use `variables-template.json` as template for this step\n\n* `folder-id` - your Yandex Cloud folder id\n* `domain` - your site's domain (e.g. API Gateway's technical domain without https://) In the Management Console, select the directory that contains the API gateway. From the list of services, choose API Gateway and click on the created API gateway. Save the Service Domain field value.\n* `oauth-client-id` - ClientID of your registered Yandex OAuth application\n* `database` - path to your Yandex Database that should start with /ru-central1/\n* `database-endpoint` - Yandex Database endpoint (the substring between grpcs:// and /?database=)\n* `yc-profile` - Yandex Cloud command line tool profile name\n* `secure-config-path` - path to JSON config with secrets\n* `storage-bucket` - Yandex Object Storage bucket name\n* `gateway-id` - id of your API Gateway\n\nYou can get `database` and `database-endpoint` values from the terminal command above:\n\n```bash\nyc ydb database get alice --format json | jq -r '.endpoint' | {\n  read -r FULL_CONNECTION\n  echo \"Endpoint: $(awk -F'[?]' '{print $1}' \u003c\u003c\u003c \"$FULL_CONNECTION\" | sed 's/grpcs:\\/\\///')\"\n  echo \"Database Path: $(sed -n 's/.*database=\\([^\u0026]*\\).*/\\1/p' \u003c\u003c\u003c \"$FULL_CONNECTION\")\"\n}\n```\n\n### Secret variables\n\nCreate `secure-config.json` file anywhere on your machine (don't forget to refer to it's destination from `variables.json`). Use `secure-config-template.json` as template for your file\n\n* `session_keys` - generated secret keys used in session management\nKeys can be generated:\n  * **hash** - base64-encoded 64-bytes random value\n  * **block** - base64-encoded 32-bytes random value\n* `oauth_secret` - secret (password) of Yandex OAuth application you created\n\nTo generate keys, use the following commands:\n\n1. **Hash (64 bytes):**\n\n   ```bash\n    echo \"Hash: $(openssl rand -base64 64)\"\n    ```\n\n2. **Block (32 bytes):**\n\n   ```bash\n   echo \"Block: $(openssl rand -base64 32)\"\n   ```\n\n## Deploying\n\n### Apply DB schema\n\nRun `./upload_ydb_schema.sh`.\n\n### Deploy functions\n\nFunctions can be deployed using [terraform](http://terraform.io). After terraform initialized, you can deploy your application with\n\n`terraform apply -var-file ./variables.json -var yc-token=\u003cOAuth token\u003e`\n\nWhere `OAuth token` - [OAuth token](https://cloud.yandex.ru/docs/iam/concepts/authorization/oauth-token) for your cloud.\n\n### Upload static\n\nGo to `frontend` directory and build static files with\n\n`npm run build`\n\nIf you have a problem like :\n\n```bash\nnpm ERR! Could not resolve dependency:\nnpm ERR! peer react@\"^16.8.0\" from old-library@1.0.0\nnpm ERR! Found react@18.2.0\n```\n\nyou have a package version conflict, you may try ```npm install --legacy-peer-deps \u0026\u0026 npm install --force``` it will ignore uncompareble dependances and installs packages bypassing the checks.\n\nRun `./upload_static.sh` at project root to upload static files to Object Storage.\n\n### Update API Gateway\n\nRun `./update_gateway.sh` to update gateway specification.\n\nNote that at this point your functions should already be deployed with terraform since gateway update script uses terraform's output values to link gateway specification with your function\n\n## Creating Alice skill\n\nAlice skill can be registered in [Yandex Dialogs console](https://dialogs.yandex.ru)\nYou can choose arbitrary values for your skill's settings, but theses are required:\n\n### Backend\n\nYou should choose \"Function in Yandex Cloud\" backend and use `todolist-alice` function that were deployed earlier with terraform.\n\n### Storage\n\nYou should check \"Storage\" checkbox so that your skill will be able to store dialog state.\n\n### Account linking\n\nThis settings section describes how Yandex Alice should authenticate on your site. In our example you should use Yandex OAuth settings.\n\n* `Application identity` - id of your Yandex OAuth application\n* `Application secret` - secret (password) of your Yandex OAuth application\n* `Authorization url` - `https://oauth.yandex.ru/authorize`\n* `URL for token receive` - `https://oauth.yandex.ru/token`\n* `URL for token refresh` - `https://oauth.yandex.ru/token`\n\n### Intents\n\nUse intent definitions provided in `intents` folder of this project to configure Alice skill intents.\n\nIntent file name must be used as intent ID (e.g. for `./intents/cancel.txt` configure intent `cancel` in dialogs settings).\nIntent file content provides intent grammar - paste it as is into corresponding settings field.\n\n## Development\n\nSource of truth for OpenAPI 3.0 specification is placed in `./gateway/openapi-template.yaml`, all other OpenAPI and Swagger files are generated from this one. If you want to change an API - you should change only `openapi-template.yaml` file and then generate the rest with\n\n`./generate_code.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-alice-shareable-todolist/lists"}