Skip to content

Commit

Permalink
Merge pull request #122 from DefangLabs/jordan/docs-homepage
Browse files Browse the repository at this point in the history
Simplify docs homepage
  • Loading branch information
jordanstephens authored Dec 3, 2024
2 parents c2a1891 + 1828c42 commit 516a319
Show file tree
Hide file tree
Showing 40 changed files with 426 additions and 350 deletions.
2 changes: 1 addition & 1 deletion blog/2024-03-28-slackbot-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Hey folks! Today, I'm going to share one of our code samples that will show you

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

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.
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.

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.
![screenshot of the slack admin UI showing the bot scopes](/img/slackbot-sample/scopes.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/ask.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Ask Defang"
description: This is a chatbot that is trained on defang documentation and designed to answer questions
description: This is a chatbot that is trained on Defang documentation and designed to answer questions
sidebar_position: 900
className: "no-title-page"
---
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"position": 500,
"link": {
"type": "generated-index",
"description": "Documentation of all the CLI commands"
"description": "Documentation of the Defang CLI (command line interface) commands."
}
}

4 changes: 2 additions & 2 deletions docs/concepts/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Eventually, billing and payment information will be associated with your account

## Creating an Account

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).
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).

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

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

:::info
We plan to introduce a more robust system for managing accounts, permissions, service groups, etc. in the future.
:::
:::
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
sidebar_position: 200
title: Authenticating
description: Authenticate with Defang.
title: Authentication
description: Authenticating with Defang.
---

# Authenticating
# Authenticating with Defang

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

Expand All @@ -15,5 +15,5 @@ defang login
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.

:::warning
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.
:::
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.
:::
3 changes: 2 additions & 1 deletion docs/concepts/defang-byoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ Please read the [DigitalOcean Provider](../providers/digitalocean/digitalocean.m
## GCP

:::info
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).
Google Cloud Platform (GCP) support is coming soon to Defang. Stay tuned for updates!
:::
Please check out the [GCP Provider](../providers/gcp/) page for more details.

## Azure

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 100

# Generate

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).
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).

:::info
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.
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/portal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Portal
description: You can log into the Defang portal to view the state of your defang services.
description: You can log into the Defang portal to view the state of your Defang services.
sidebar_position: 700
---

Expand Down
4 changes: 2 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ description: Frequently asked questions about Defang.

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

- 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.
- 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.

### Can I deploy multiple services at once?

Expand Down Expand Up @@ -161,7 +161,7 @@ services:
- - "1234:1234"
+ - "1234"
```
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:
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:

```yaml
healthcheck:
Expand Down
196 changes: 196 additions & 0 deletions docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
sidebar_position: 200
title: Getting Started
description: Get started with Defang.
---
import DocCardList from "@docusaurus/theme-classic/lib/theme/DocCardList";

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Getting Started

## Install the Defang CLI

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.

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.


<Tabs>
<TabItem value="bash" label="Shell">
**Using a shell script**

You can install the Defang CLI using a shell script. Run the following command in your terminal:

```bash
eval "$(curl -fsSL s.defang.io/install)"
```

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.
</TabItem>
<TabItem value="homebrew" label="Homebrew" default>
**Using Homebrew**

You can easily install the Defang CLI using [Homebrew](https://brew.sh/). Run the following command in your terminal:

```bash
brew install DefangLabs/defang/defang
```
</TabItem>
<TabItem value="winget" label="Winget">
**Using Winget**

On Windows, you can install the Defang CLI using `winget`. Run the following command in your terminal:

```powershell
winget install defang
```
</TabItem>
<TabItem value="nix" label="Nix">
**Using Nix**

```bash
nix profile install github:DefangLabs/defang#defang-bin --refresh
```
</TabItem>
<TabItem value="direct" label="Direct Download">
**Direct Download**

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`.
</TabItem>
</Tabs>

## Generate a project

```
$ defang generate nodejs-http
```

You should see the following prompt:
```
? What folder would you like to create the project in?
```
Type in the name of the folder you'd like to use for your new project and press ENTER.

I'll type `"welcome-to-defang"`. Now, you'll see the following output:

```
? What folder would you like to create the project in? welcome-to-defang
* Fetching sample from the Defang repository...
* Writing files to disk...
- .github/
- .github/workflows/
- .github/workflows/deploy.yaml
- README.md
- app/
- app/Dockerfile
- app/main.js
- compose.yaml
* Code generated successfully in folder welcome-to-defang
Check the files in your favorite editor.
To deploy the service, do `cd welcome-to-defang` and
defang compose up
```

Now, navigate to the folder you just created:

```
$ cd welcome-to-defang
```

You can open the folder in your favorite editor and see the files that were generated for you:
* The `app` folder contains the code for your service.
* The `Dockerfile` is used to build the container image for your service.
* The `compose.yaml` file is used to define the services you want to deploy.

## Deploy to the playground

Go back to your shell and type the following:

```
$ defang up
```

If you have not used Defang before, you'll be prompted to log in.

```
! Please log in to continue.
Please visit http://127.0.0.1:49154 and log in. (Right click the URL or press ENTER to open browser)
```

:::info
To learn more about how authentication works in Defang, check out the [Authenticating With Defang](/docs/concepts/authentication) page.
:::

When you do this, you should see something similar to the output below:

```
* Uploading build context for app
* Deploying service app
* Monitor your services' status in the defang portal
- https://portal.defang.dev/service/app
* Tailing logs for deployment ID o59k89vk3qc8 ; press Ctrl+C to detach:
* Press V to toggle verbose mode
2024-09-19T10:50:53.572443-07:00 cd Update started for stack jordanstephens-prod1
2024-09-19T10:51:05.536299-07:00 cd Update succeeded in 11.99769745s ; provisioning...
2024-09-19T10:51:39.419693-07:00 app Server running at http://0.0.0.0:3000/
* Service app is in state DEPLOYMENT_COMPLETED and will be available at:
- https://jordanstephens-app--3000.prod1.defang.dev
* Done.
```

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.

![screenshot of the defang portal](/img/getting-started-portal.png)

## Next Steps

Congratulations! You've successfully deployed your first service with Defang. Now, where do you go from here?

Defang supports various ways of creating and deploying services to the cloud. The following tutorials dive into each one in more detail:

<DocCardList
items={[
{
type: "link",
href: "/docs/tutorials/deploy-to-your-cloud",
label: "Deploy to your own cloud",
description: "When you're ready for production",
},
{
type: "link",
href: "/docs/tutorials/generate-new-code-using-ai",
label: "Generate a Project with AI",
description: "Use Defang to generate and deploy a new project",
},
{
type: "link",
href: "/docs/category/cli",
label: "Explore the Defang CLI",
description: "Learn more about the Defang CLI",
},
{
type: "link",
href: "/docs/intro/what-is-defang",
label: "Learn more about Defang",
description: "What is Defang and how does it work?",
},
{
type: "link",
href: "/docs/tutorials/deploy-using-pulumi",
label: "Deploy using Pulumi",
description: "Deploy using Pulumi",
},
{
type: "link",
href: "/docs/tutorials/monitoring-your-services",
label: "Monitor your services",
description: "Learn how to monitor your services with Defang",
}
]}
/>

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.
16 changes: 0 additions & 16 deletions docs/getting-started/build-and-deploy.md

This file was deleted.

Loading

0 comments on commit 516a319

Please sign in to comment.