Skip to content

Commit 158a1d4

Browse files
authored
deep dive: rework intro sections (#1795)
* rework intro sections * update from feedback * updates from feedback and more edits
1 parent eb92552 commit 158a1d4

13 files changed

+117
-150
lines changed

happy-path/aim.html.markerb

Lines changed: 0 additions & 55 deletions
This file was deleted.

happy-path/application.html.markerb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ nav: demo
55
order: 4
66
---
77

8-
Your demo app is running by default on two [Machines](https://fly.io/docs/machines/).
8+
Your demo app is running by default on two [Fly Machines](/docs/machines/), our fast-launching VMs.
99

10-
Both Machines stop when not in use, and [autostart](https://fly.io/docs/launch/autostop-autostart/) when a new request comes in.
11-
This is entirely configurable. You can chose to [suspend](https://community.fly.io/t/new-feature-in-preview-suspend-resume-for-machines/20672) instead of stop, configure a [minimum number](https://fly.io/docs/reference/configuration/#the-http_service-section) of Machines to leave running, or even decide never to stop Machines at all.
10+
Both Machines stop when not in use, and automatically when a new request comes in. [Autostop/autostart](/docs/launch/autostop-autostart/) is entirely configurable. You can chose to suspend instead of stop, configure a minimum number of Machines to keep running, or even decide never to stop Machines at all.
1211

13-
Familiarize yourself with the [fly.toml](https://fly.io/docs/reference/configuration/) config file. Make a change there -- or in fact to any part of your application -- and run `fly deploy`.
12+
The purpose of two Machines is twofold: redundancy and scalability. If one Machine goes down, the other can continue on. If both are available, when your app has higher traffic, both can be started to handle requests. You can [vertically scale](/launch/scale-machine/) the CPU and RAM on Machines.
1413

15-
The purpose of two Machines is twofold: redundancy and scalability. If the Machine hosting one goes down, the other can continue on. If both are available, in times of high use both can be started to handle requests.
16-
You can [vertically scale](https://fly.io/docs/launch/scale-machine/) the CPU and RAM on each Machine.
14+
You can also [horizontally scale](/docs/launch/scale-count/) the number of Machines. You can scale out to different regions with the `fly scale count` command too. If you have a co-worker on another continent, create a Machine there.
1715

18-
You can also [horizontally scale](https://fly.io/docs/launch/scale-count/) to more Machines. Be sure to scroll down on that page far enough to see how to scale to multiple [regions](https://fly.io/docs/reference/regions/). If you have a co-worker on another continent, create a Machine there.
16+
Familiarize yourself with the [fly.toml](/docs/reference/configuration/) config file. Make a change there--or to any part of your app--and run `fly deploy` to update your app.
1917

20-
All this is made possible by [Anycast](https://fly.io/docs/networking/services/), a [load balancing proxy](https://fly.io/docs/reference/fly-proxy/), and [DNS certificates](https://fly.io/docs/networking/custom-domain/). Be sure to read that last link if you're interested in custom domains.
18+
Your Fly App takes advantage of [Anycast routing](/doc/networking/services/), a [load-balancing proxy](/docs/reference/fly-proxy/), and [private networking](/docs/networking/private-networking/). You can also create [DNS certificates for custom domains](/docs/networking/custom-domain/).

happy-path/index.html.markerb

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,67 @@
22
title: Deep dive demo
33
layout: docs
44
nav: demo
5-
toc: false
5+
toc: true
66
---
77

8-
You probably landed on this page because somebody recommended Fly.io to you. You're curious, and you want to know more before you commit.
8+
Welcome to our deep dive demo, where you can explore Fly.io more thoroughly, but in a time-boxed way. In one hour or less: get a fully-functioning app running in the first few minutes, and then have enough time left over to understand what you just did, explore how the pieces fit together, and even integrate in AI functionality that makes use of GPUs.
99

10-
If you came from our [Speedrun](https://fly.io/speedrun) or [Getting started](https://fly.io/docs/getting-started/) pages, maybe you want to not only be up and running fast, you want to feel confident that you're making a good decision; choosing a platform that can both support you now, and scale with you later on as you grow.
10+
## Goals of the deep dive
1111

12-
Maybe you're concerned about lock in. You want to know that you can
13-
use services from other places and even eject entirely and move your entire
14-
application elsewhere if things don't work out.
12+
It's really just one goal:
1513

16-
If you want to explore more deeply but in a time-boxed way, then you're in the right place. You should be up and running within minutes, and have enough of the hour left over to spend some time understanding what you just did and run a few commands and see what they do.
14+
**Help you find out if Fly.io is the right place for you.**
1715

18-
If you don't get a good feeling within an hour, you're out of here. If you do get a good feeling, then consider
19-
sticking around to experiment and learn more about features that interest you. And when you're done, you can delete everything and launch the application that you brought here to launch.
16+
If you came from our [Speedrun](https://fly.io/speedrun) or [Getting started](https://fly.io/docs/getting-started/) pages, maybe you want to go beyond `hello world` and explore the platform so you can feel confident that you're choosing a platform that can support you now, and scale with you later on as you grow.
2017

21-
**Next:** [Beyond `hello fly`](/docs/happy-path/ready/)
18+
Maybe you're concerned about lock in. You want to use services from other places and even eject entirely and go elsewhere if things don't work out.
19+
20+
If you don't get a good feeling within an hour, you're out of here. If you do get a good feeling, then stick around and try launching the app that you brought here to launch.
21+
22+
## Beyond `hello fly`
23+
24+
Our deep dive assumes that you're not satisfied by a `hello fly`, or even a `hello fly` with a database application. You know that a real-world application has at a minimum the following components:
25+
26+
* An HTML form and a database; typically a relational database.
27+
* The ability to handle media files or documents, generally using S3.
28+
* A multi-user and realtime component, where changes made by one person in one location are reflected instantly in the browser of another person.
29+
30+
To get a fully-functional app running smoothly, you need a whole bunch of things; things like Anycast routing, load balancers, DNS certificates, WebSockets, an internal private network, a relational database, an object store, and an in-memory database. And the knowledge to to connect them all together.
31+
32+
We take a lot of this work off your plate with our [Fly Proxy routing](/docs/reference/fly-proxy/) and out-of-the-box [private networking](/docs/networking/private-networking/).
33+
34+
Usually, set up for a complete app typically takes a _minimum_ of an afternoon's worth of work, even if you're familiar with a cloud platform. There is almost always a surprise, and often several. We can't promise no surprises, but we can show you how we'll partner with you to handle some of the dev ops complexities of working in a public cloud.
35+
36+
## So what is this deep dive demo app?
37+
38+
The deep dive demo uses industry standard components that you can run on your laptop, a VPS, AWS EC2, Google Compute Engine, or Azure.
39+
40+
### Web Dictaphone -- Fly.io edition
41+
42+
The deep dive demo is based on [MDN's Web Dictaphone](https://github.com/mdn/dom-examples/tree/main/media/web-dictaphone+external).
43+
You can play with a [live demo hosted on GitHub](https://mdn.github.io/dom-examples/media/web-dictaphone/+external). The Web Dictaphone app is about as basic of an HTML form as you can get, and it has the added bonus of providing the ability to generate as many media files as you want using only your voice.
44+
45+
The basic Web Dictaphone is client side only, requiring a web server that can deploy static assets (HTML, CSS, JS, images), like NGINX, Apache HTTPd, or Caddy. Storing the data in databases for our deep dive demo requires a server that can handle HTTP GET, POST, PUT, and DELETE requests. The choice of server varies depending on the language or framework.
46+
47+
### Other demo components
48+
49+
The demo includes the following components:
50+
51+
* A [PostgreSQL](https://www.postgresql.org/+external) relational database to store the names of the audio clips
52+
* A [Tigris bucket](https://www.tigrisdata.com/+external) to store the the audio files
53+
* [Upstash for Redis](https://fly.io/docs/reference/redis/) and [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API+external) to handle the connections for the realtime requirement
54+
55+
## Available runtimes
56+
57+
Our deep dive demo comes in two flavors (so far):
58+
59+
- **Node.js**
60+
- [node-dictaphone](https://github.com/fly-apps/node-dictaphone+external) GitHub repo
61+
- For details about implementation-specific files and app logic, see [Node.js deep dive demo](/docs/happy-path/nodejs/).
62+
- **Rails**
63+
- [rails-dictaphone](https://github.com/fly-apps/rails-dictaphone+external) GitHub repo
64+
- For details about implementation-specific files and app logic, see [Rails deep dive demo](/docs/happy-path/rails/).
65+
66+
---
67+
68+
**Next:** [Launch the demo](/docs/happy-path/launch-deep-dive/)

happy-path/fire.html.markerb renamed to happy-path/launch-deep-dive.html.markerb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ order: 3
77

88
This is the point where you might expect to see that the marketing hype promised by [Speedrun](https://fly.io/speedrun) doesn't quite cut it. But the fact is that Fly.io is built for an excellent developer experience (DX) for full stack applications with both realtime time and object storage requirements.
99

10-
There are only two steps.
10+
**Step 0:** To get set up to run the deep dive demo on Fly.io, all you need to do is install Ruby or Node and create an empty project directory.
11+
12+
After that there are only two steps.
1113

1214
**Step 1:** [Install flyctl](https://fly.io/docs/flyctl/install/).
1315

@@ -20,31 +22,30 @@ fly launch --from https://github.com/fly-apps/node-dictaphone
2022
fly launch --from https://github.com/fly-apps/rails-dictaphone
2123
```
2224

23-
If you are new to Fly.io, the second step will take you to a page where you can register before continuing.
25+
If you're new to Fly.io, the second step will take you to a page where you can register before continuing.
2426

25-
The `fly launch` output describes what you'll be getting for the app, and gives you an opportunity to tweak the settings (suggestion: Don't. The defaults are fine for this demo and we'll walk you through how to adjust them later). And then it will build and assemble and wire up your app.
27+
The `fly launch` output describes what you'll be getting for the app, and gives you an opportunity to tweak the settings. (Suggestion: Don't. The defaults are fine for this demo and we'll walk you through how to adjust them later.) And then it will build and assemble and wire up your app.
2628

2729
Take your time and play with it. Open the application in multiple browser windows. Send a link to a friend on another continent and watch your browser update in realtime.
2830

29-
And then relax. We promised you it would be less than an hour. You're already up and running. If you are so inclined, try bringing up this exact same application on another cloud provider. We don't mind. In fact, we encourage it. Just please don't count the time you spent there against the hour budget we asked you to allot to this activity.
31+
And then relax. We promised you it would be less than an hour. You're already up and running. If you are so inclined, try bringing up this exact same application on another cloud provider. We don't mind. In fact, we encourage it. Just please don't count the time you spent there against the hour you set aside for this demo!
3032

31-
### What You Get
33+
## Explore the result of `fly launch`
3234

33-
Once you're back and/or rested up, explore app and add-on components. Feel free to review the following in any order, or chose to skip ahead:
35+
Once you're back and/or rested up, explore the app and add-on components. Feel free to review the following in any order, or chose to skip ahead:
3436

35-
* [The Fly App](../application/)
36-
* [PostgreSQL](../postgresql/)
37+
* [Your Fly App](../application/)
38+
* [PostgreSQL database](../postgresql/)
3739
* [Tigris Object Storage](../tigris/)
3840
* [Upstash Redis](../redis/)
3941

40-
### Runtimes
42+
## Runtimes
4143

42-
Optional, but deeper dives are provided for each runtime:
44+
Optional, but details are provided for each runtime:
4345

4446
* [Node.js](../nodejs/)
4547
* [Rails](../rails/)
4648

47-
### Next
49+
---
4850

49-
- As an extra treat, you can add some AI functionality: in this case speech recognition using [Whisper](../whisper/).
50-
- When you're all done, visit the [recap](../recap).
51+
**Next:** Add [OpenAI Whisper](../whisper/) speech recognition as a bonus.

happy-path/nodejs.html.markerb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
title: Node.js demo
2+
title: Node.js demo reference
33
layout: docs
44
nav: demo
55
---
66

7-
Source is on [GitHub](https://github.com/fly-apps/node-dictaphone).
7+
8+
9+
The Node.js demo source is on [GitHub](https://github.com/fly-apps/node-dictaphone).
810
`fly launch` will provide a [`Dockerfile`](https://docs.docker.com/reference/dockerfile/)
9-
and a [`fly.toml`](https://fly.io/docs/reference/configuration/). As your application
10-
changes, you can run `npx @flydotio/dockerfile` to produce updated Dockerfiles.
11+
and a [`fly.toml`](https://fly.io/docs/reference/configuration/) config file. When you make changes to your application, you can run `npx @flydotio/dockerfile` to produce updated Dockerfiles.
1112

1213
How the pieces are put together:
1314

@@ -32,7 +33,7 @@ How the pieces are put together:
3233
* The [express-ws](https://github.com/HenningM/express-ws?tab=readme-ov-file#express-ws-)
3334
module is used for [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) support.
3435
* The [redis](https://github.com/redis/node-redis?tab=readme-ov-file#node-redis) module
35-
is used to access Redis. The `REDIS_URL` secret isused to access the database.
36+
is used to access Redis. The `REDIS_URL` secret issued to access the database.
3637

3738
Key points of logic:
3839

@@ -48,4 +49,4 @@ Key points of logic:
4849
replaced with new contents.
4950
* When the `WHISPER_URL` secret is set, `PUT` requests will cause the audio clips
5051
to be passed to the Whisper server, and responses will be used to update the
51-
PostgreSQL database. The code for this is [here](https://github.com/fly-apps/node-dictaphone/blob/1e84a4dece6888dfc68880d146b46511d47391b3/app.js#L102-L129).
52+
PostgreSQL database. The code for this is in [app.js](https://github.com/fly-apps/node-dictaphone/blob/1e84a4dece6888dfc68880d146b46511d47391b3/app.js#L102-L129).

0 commit comments

Comments
 (0)