mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-10 15:04:25 +08:00
Update kino chat app (#2991)
This commit is contained in:
parent
0208856133
commit
1628ddbc51
2 changed files with 23 additions and 17 deletions
|
@ -56,7 +56,7 @@ defmodule Livebook.Notebook.Learn do
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
path: Path.join(__DIR__, "learn/deploy_apps.livemd"),
|
path: Path.join(__DIR__, "learn/chat_app.livemd"),
|
||||||
details: %{
|
details: %{
|
||||||
description: "Write and deploy a chat app with Kino control and frames.",
|
description: "Write and deploy a chat app with Kino control and frames.",
|
||||||
cover_filename: "learn-deploy.svg"
|
cover_filename: "learn-deploy.svg"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Deploy a chat app with Kino
|
# Build a chat app with Kino
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
Mix.install([
|
Mix.install([
|
||||||
|
@ -224,25 +224,27 @@ You can also open up this notebook on different tabs
|
||||||
and emulate how different users can chat with each other.
|
and emulate how different users can chat with each other.
|
||||||
Give it a try!
|
Give it a try!
|
||||||
|
|
||||||
## Deploying
|
## Running as a Livebook app
|
||||||
|
|
||||||
Our chat application is ready, therefore it means we are
|
Our chat application is ready, therefore it means we are
|
||||||
ready to deploy! Click on the <i class="ri-livebook-deploy"></i>
|
ready to run it!
|
||||||
icon on the sidebar and then on "Configure".
|
|
||||||
|
|
||||||
Now, define a slug for your deployment, such as "chat-app",
|
Click on the <i class="ri-livebook-deploy"></i>
|
||||||
set a password (or disable password protection), and click
|
icon on the sidebar and then on "Configure". Now, define a slug for your deployment,
|
||||||
"Deploy". Now you can click the URL and interact with the
|
such as "chat-app", set a password (or disable password protection), and click
|
||||||
chat app, as you did inside the notebook.
|
"Save".
|
||||||
|
|
||||||
When you deploy a notebook, Livebook will execute all of
|
Click on the "Launch preview" button to run your notebook as an app.
|
||||||
|
Now you can click the URL and interact with the chat app, as you did inside the notebook.
|
||||||
|
|
||||||
|
When you run a notebook as an app, Livebook will execute all of
|
||||||
the code in the notebook from beginning to end. This sets
|
the code in the notebook from beginning to end. This sets
|
||||||
up our whole application, including frames and forms, for
|
up our whole application, including frames and forms, for
|
||||||
users to interact with. In case something goes wrong, you
|
users to interact with. In case something goes wrong, you
|
||||||
can always click the Livebook icon on the deployed app and
|
can always click the Livebook icon on the running app and
|
||||||
choose to debug the deployed notebook session.
|
choose to debug the running notebook session.
|
||||||
|
|
||||||
From here onwards, feel free to adjust the deployed application,
|
From here onwards, feel free to adjust the application,
|
||||||
by removing unused outputs from earlier sections or by adding
|
by removing unused outputs from earlier sections or by adding
|
||||||
new features.
|
new features.
|
||||||
|
|
||||||
|
@ -250,18 +252,22 @@ Congratulations on shipping!
|
||||||
|
|
||||||
## Docker deployment
|
## Docker deployment
|
||||||
|
|
||||||
Now that you have deployed your first notebook as an application
|
Now that you have run your notebook as an application
|
||||||
locally, you may be wondering: can I actually ship this production?
|
locally, you may be wondering: can I actually ship this production?
|
||||||
|
|
||||||
The answer is yes!
|
The answer is yes!
|
||||||
|
|
||||||
Click on the <i class="ri-livebook-deploy"></i> icon on the sidebar
|
Click on the <i class="ri-livebook-deploy"></i> icon on the sidebar
|
||||||
and you will find a "Deploy with Docker" link. Clicking on the link
|
and you will find a "Manual Docker deployment" button. Clicking on it
|
||||||
will open up a modal with instructions on deploying a single notebook
|
will open up a modal with instructions on deploying a single notebook
|
||||||
or a folder with several entries through Docker.
|
or a folder with several entries through Docker.
|
||||||
|
|
||||||
If you want to develop and deploy notebooks as a team, check out
|
We also offer a service called [Livebook Teams](https://livebook.dev/teams),
|
||||||
[Livebook Teams](https://livebook.dev/teams).
|
which comes with the following features for Livebook apps:
|
||||||
|
|
||||||
|
- one-click deployment
|
||||||
|
- authentication
|
||||||
|
- authorization
|
||||||
|
|
||||||
## Where to go next
|
## Where to go next
|
||||||
|
|
Loading…
Add table
Reference in a new issue