Skip to content

Commit 516a319

Browse files
Merge pull request #122 from DefangLabs/jordan/docs-homepage
Simplify docs homepage
2 parents c2a1891 + 1828c42 commit 516a319

40 files changed

+426
-350
lines changed

blog/2024-03-28-slackbot-sample.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Hey folks! Today, I'm going to share one of our code samples that will show you
1111

1212
Before we dive into the details, let's make sure you have everything you need to get started:
1313

14-
1. **Install Defang CLI:** Simplify your deployment process by installing the Defang CLI tool. Follow the instructions [here](https://docs.defang.io/docs/getting-started/installing) to get it up and running quickly.
14+
1. **Install Defang CLI:** Simplify your deployment process by installing the Defang CLI tool. Follow the instructions [here](https://docs.defang.io/docs/getting-started#install-the-defang-cli) to get it up and running quickly.
1515

1616
2. **Slack API Token:** Create a Slack App at https://api.slack.com/apps, granting it the necessary permissions, including the bot `chat:write` scope.
1717
![screenshot of the slack admin UI showing the bot scopes](/img/slackbot-sample/scopes.png)

docs/ask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Ask Defang"
3-
description: This is a chatbot that is trained on defang documentation and designed to answer questions
3+
description: This is a chatbot that is trained on Defang documentation and designed to answer questions
44
sidebar_position: 900
55
className: "no-title-page"
66
---

docs/cli/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"position": 500,
44
"link": {
55
"type": "generated-index",
6-
"description": "Documentation of all the CLI commands"
6+
"description": "Documentation of the Defang CLI (command line interface) commands."
77
}
88
}
99

docs/concepts/accounts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Eventually, billing and payment information will be associated with your account
1616

1717
## Creating an Account
1818

19-
To create an account, simply login to Defang and accept the [terms of service](https://defang.io/terms-service.html) using the [CLI](../getting-started/authenticating.md).
19+
To create an account, simply login to Defang and accept the [terms of service](https://defang.io/terms-service.html) using the [CLI](/docs/concepts/authentication.md).
2020

2121
At the moment, the only way to authenticate with Defang is through GitHub. We plan to offer other authentication providers in the future.
2222

@@ -34,4 +34,4 @@ Keep in mind that your Defang account is separate from your [cloud provider acco
3434

3535
:::info
3636
We plan to introduce a more robust system for managing accounts, permissions, service groups, etc. in the future.
37-
:::
37+
:::
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
sidebar_position: 200
3-
title: Authenticating
4-
description: Authenticate with Defang.
3+
title: Authentication
4+
description: Authenticating with Defang.
55
---
66

7-
# Authenticating
7+
# Authenticating with Defang
88

99
To do pretty much anything with Defang, you'll need to authenticate with the platform. You can do this by running the following command:
1010

@@ -15,5 +15,5 @@ defang login
1515
This will prompt you to open a browser and log into your Defang account. For now, the only way to login is with GitHub, though we will offer other providers to authenticate in the future. Once you've logged in, you can close the browser and return to the terminal. You should see a message that you've successfully logged in.
1616

1717
:::warning
18-
Keep in mind that your Defang account is separate from your [cloud provider account](../concepts/defang-byoc.md). You will need to authenticate with your cloud provider account separately to deploy services to your own cloud account.
19-
:::
18+
Keep in mind that your Defang account is separate from your [cloud provider account](/docs/concepts/defang-byoc). You will need to authenticate with your cloud provider account separately to deploy services to your own cloud account.
19+
:::

docs/concepts/defang-byoc.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Please read the [DigitalOcean Provider](../providers/digitalocean/digitalocean.m
4343
## GCP
4444

4545
:::info
46-
We will be working on GCP support in the future. If you are interested in GCP support, please vote on [this issue](https://github.com/DefangLabs/defang/issues/58).
46+
Google Cloud Platform (GCP) support is coming soon to Defang. Stay tuned for updates!
4747
:::
48+
Please check out the [GCP Provider](../providers/gcp/) page for more details.
4849

4950
## Azure
5051

docs/concepts/generate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 100
66

77
# Generate
88

9-
Defang includes an AI-driven agent that translates natural language prompts to an outline for your project that you can then refine. The AI agent is available through the [Defang CLI](../getting-started/installing.md).
9+
Defang includes an AI-driven agent that translates natural language prompts to an outline for your project that you can then refine. The AI agent is available through the [Defang CLI](../getting-started#install-the-defang-cli.md).
1010

1111
:::info
1212
The AI agent is currently in preview and only supports a limited set of prompts, varying in complexity. We plan to expand the capabilities of the AI agent in the future.

docs/concepts/portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Portal
3-
description: You can log into the Defang portal to view the state of your defang services.
3+
description: You can log into the Defang portal to view the state of your Defang services.
44
sidebar_position: 700
55
---
66

docs/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ description: Frequently asked questions about Defang.
4141

4242
### Will deploying a new version of my app cause downtime?
4343

44-
- If you have deployed your application with the `--mode=production` flag, Defang will use the _production_ deployment mode. This mode will provision your app with multiple replicas and will perform a rolling update to ensure zero downtime. If you use another deployment mode, you may experience downtime during the deployment, as defang will not provision multiple replicas to save cost.
44+
- If you have deployed your application with the `--mode=production` flag, Defang will use the _production_ deployment mode. This mode will provision your app with multiple replicas and will perform a rolling update to ensure zero downtime. If you use another deployment mode, you may experience downtime during the deployment, as Defang will not provision multiple replicas to save cost.
4545

4646
### Can I deploy multiple services at once?
4747

@@ -161,7 +161,7 @@ services:
161161
- - "1234:1234"
162162
+ - "1234"
163163
```
164-
2. Does my healthcheck include the string `localhost`? It is very common to define a healthcheck by using `curl` or `wget` to make a request to `localhost`. So common, in fact, that defang will look for the string `localhost` in your healthcheck definition. For example, this healthcheck is valid:
164+
2. Does my healthcheck include the string `localhost`? It is very common to define a healthcheck by using `curl` or `wget` to make a request to `localhost`. So common, in fact, that Defang will look for the string `localhost` in your healthcheck definition. For example, this healthcheck is valid:
165165

166166
```yaml
167167
healthcheck:

docs/getting-started.mdx

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
---
2+
sidebar_position: 200
3+
title: Getting Started
4+
description: Get started with Defang.
5+
---
6+
import DocCardList from "@docusaurus/theme-classic/lib/theme/DocCardList";
7+
8+
import Tabs from '@theme/Tabs';
9+
import TabItem from '@theme/TabItem';
10+
11+
# Getting Started
12+
13+
## Install the Defang CLI
14+
15+
Defang doesn't require installing anything in your cloud, but you will need to install the [open source](https://github.com/DefangLabs/defang) Defang command line interface (CLI) to interact with your Defang resources and account.
16+
17+
We offer a few different ways to install the Defang CLI. You can use a shell script, Homebrew, Winget, or you can download the binary directly.
18+
19+
20+
<Tabs>
21+
<TabItem value="bash" label="Shell">
22+
**Using a shell script**
23+
24+
You can install the Defang CLI using a shell script. Run the following command in your terminal:
25+
26+
```bash
27+
eval "$(curl -fsSL s.defang.io/install)"
28+
```
29+
30+
The script will try to download the appropriate binary for your operating system and architecture, add it to `~/.local/bin`, and add `~/.local/bin` to your `PATH` if it's not already there, with your permission. If you do not provide permission it will print an appropriate instruction for you to follow to add it manually. You can also customize the installation directory by setting the `INSTALL_DIR` environment variable before running the script.
31+
</TabItem>
32+
<TabItem value="homebrew" label="Homebrew" default>
33+
**Using Homebrew**
34+
35+
You can easily install the Defang CLI using [Homebrew](https://brew.sh/). Run the following command in your terminal:
36+
37+
```bash
38+
brew install DefangLabs/defang/defang
39+
```
40+
</TabItem>
41+
<TabItem value="winget" label="Winget">
42+
**Using Winget**
43+
44+
On Windows, you can install the Defang CLI using `winget`. Run the following command in your terminal:
45+
46+
```powershell
47+
winget install defang
48+
```
49+
</TabItem>
50+
<TabItem value="nix" label="Nix">
51+
**Using Nix**
52+
53+
```bash
54+
nix profile install github:DefangLabs/defang#defang-bin --refresh
55+
```
56+
</TabItem>
57+
<TabItem value="direct" label="Direct Download">
58+
**Direct Download**
59+
60+
You can find the latest version of the Defang CLI on the [latest release page](https://github.com/DefangLabs/defang/releases/latest). Just download the appropriate binary for your operating system and architecture, and put it somewhere in your `PATH`.
61+
</TabItem>
62+
</Tabs>
63+
64+
## Generate a project
65+
66+
```
67+
$ defang generate nodejs-http
68+
```
69+
70+
You should see the following prompt:
71+
```
72+
? What folder would you like to create the project in?
73+
```
74+
Type in the name of the folder you'd like to use for your new project and press ENTER.
75+
76+
I'll type `"welcome-to-defang"`. Now, you'll see the following output:
77+
78+
```
79+
? What folder would you like to create the project in? welcome-to-defang
80+
* Fetching sample from the Defang repository...
81+
* Writing files to disk...
82+
- .github/
83+
- .github/workflows/
84+
- .github/workflows/deploy.yaml
85+
- README.md
86+
- app/
87+
- app/Dockerfile
88+
- app/main.js
89+
- compose.yaml
90+
* Code generated successfully in folder welcome-to-defang
91+
92+
Check the files in your favorite editor.
93+
To deploy the service, do `cd welcome-to-defang` and
94+
95+
defang compose up
96+
```
97+
98+
Now, navigate to the folder you just created:
99+
100+
```
101+
$ cd welcome-to-defang
102+
```
103+
104+
You can open the folder in your favorite editor and see the files that were generated for you:
105+
* The `app` folder contains the code for your service.
106+
* The `Dockerfile` is used to build the container image for your service.
107+
* The `compose.yaml` file is used to define the services you want to deploy.
108+
109+
## Deploy to the playground
110+
111+
Go back to your shell and type the following:
112+
113+
```
114+
$ defang up
115+
```
116+
117+
If you have not used Defang before, you'll be prompted to log in.
118+
119+
```
120+
! Please log in to continue.
121+
Please visit http://127.0.0.1:49154 and log in. (Right click the URL or press ENTER to open browser)
122+
```
123+
124+
:::info
125+
To learn more about how authentication works in Defang, check out the [Authenticating With Defang](/docs/concepts/authentication) page.
126+
:::
127+
128+
When you do this, you should see something similar to the output below:
129+
130+
```
131+
* Uploading build context for app
132+
* Deploying service app
133+
* Monitor your services' status in the defang portal
134+
- https://portal.defang.dev/service/app
135+
* Tailing logs for deployment ID o59k89vk3qc8 ; press Ctrl+C to detach:
136+
* Press V to toggle verbose mode
137+
2024-09-19T10:50:53.572443-07:00 cd Update started for stack jordanstephens-prod1
138+
2024-09-19T10:51:05.536299-07:00 cd Update succeeded in 11.99769745s ; provisioning...
139+
2024-09-19T10:51:39.419693-07:00 app Server running at http://0.0.0.0:3000/
140+
* Service app is in state DEPLOYMENT_COMPLETED and will be available at:
141+
- https://jordanstephens-app--3000.prod1.defang.dev
142+
* Done.
143+
```
144+
145+
Now we can go to [https://portal.defang.dev/service/app](https://portal.defang.dev/service/app) to see our service listed in the Defang portal.
146+
147+
![screenshot of the defang portal](/img/getting-started-portal.png)
148+
149+
## Next Steps
150+
151+
Congratulations! You've successfully deployed your first service with Defang. Now, where do you go from here?
152+
153+
Defang supports various ways of creating and deploying services to the cloud. The following tutorials dive into each one in more detail:
154+
155+
<DocCardList
156+
items={[
157+
{
158+
type: "link",
159+
href: "/docs/tutorials/deploy-to-your-cloud",
160+
label: "Deploy to your own cloud",
161+
description: "When you're ready for production",
162+
},
163+
{
164+
type: "link",
165+
href: "/docs/tutorials/generate-new-code-using-ai",
166+
label: "Generate a Project with AI",
167+
description: "Use Defang to generate and deploy a new project",
168+
},
169+
{
170+
type: "link",
171+
href: "/docs/category/cli",
172+
label: "Explore the Defang CLI",
173+
description: "Learn more about the Defang CLI",
174+
},
175+
{
176+
type: "link",
177+
href: "/docs/intro/what-is-defang",
178+
label: "Learn more about Defang",
179+
description: "What is Defang and how does it work?",
180+
},
181+
{
182+
type: "link",
183+
href: "/docs/tutorials/deploy-using-pulumi",
184+
label: "Deploy using Pulumi",
185+
description: "Deploy using Pulumi",
186+
},
187+
{
188+
type: "link",
189+
href: "/docs/tutorials/monitoring-your-services",
190+
label: "Monitor your services",
191+
description: "Learn how to monitor your services with Defang",
192+
}
193+
]}
194+
/>
195+
196+
Choose the direction that seems the most interesting. If you have any questions, join the [Defang Discord](https://discord.gg/defang) and we'll be happy to help you out.

0 commit comments

Comments
 (0)