Skip to content

Commit

Permalink
chore: move console to it's own subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Feb 25, 2024
1 parent ebe27fa commit b165577
Show file tree
Hide file tree
Showing 22 changed files with 433 additions and 156 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
- Access key-value storage with `useKV()`
- Store files with `useBlob()`

Read more on https://docs.hub.nuxt.com
Read more on https://hub.nuxt.com

## Quick Setup

Expand Down
2 changes: 1 addition & 1 deletion docs/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default defineAppConfig({
}, {
icon: 'i-simple-icons-nuxtdotjs',
label: 'NuxtHub Console',
to: 'https://hub.nuxt.com',
to: 'https://console.hub.nuxt.com',
target: '_blank',
}]
}
Expand Down
12 changes: 9 additions & 3 deletions docs/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const { header } = useAppConfig()
</template>
<template #right>
<UButton to="https://hub.nuxt.com/?utm_source=nuxthub-docs&utm_medium=header" external icon="i-simple-icons-nuxtdotjs" variant="outline" class="hidden sm:inline-flex">
NuxtHub Console
</UButton>
<UDocsSearchButton v-if="header?.search" :label="null" class="lg:hidden" />
<UColorModeButton v-if="header?.colorMode" />
Expand All @@ -36,10 +33,19 @@ const { header } = useAppConfig()
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
<UButton to="https://console.hub.nuxt.com/?utm_source=nuxthub-docs&utm_medium=header" external icon="i-simple-icons-nuxtdotjs" color="black" class="hidden sm:inline-flex">
NuxtHub Console
</UButton>
</template>
<template #panel>
<UNavigationTree :links="mapContentNavigation(navigation)" />
<div class="flex py-2">
<UButton to="https://console.hub.nuxt.com/?utm_source=nuxthub-docs&utm_medium=header" external icon="i-simple-icons-nuxtdotjs" color="black" block>
NuxtHub Console
</UButton>
</div>
</template>
</UHeader>
</template>
8 changes: 4 additions & 4 deletions docs/content/1.getting-started/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NuxtHub provides a set of features to help you build full-stack applications:
Each feature comes with its auto-imported server composable to use in your [Nuxt's server directory](https://nuxt.com/docs/guide/directory-structure/server).

::callout{icon="i-ph-plugs-connected-duotone"}
NuxtHub comes with a powerful proxy system to connect to your project's resources from your local environment, allowing you to work with your remote data as if it was local.
NuxtHub comes with a powerful proxy system to connect to your project's resources from your local environment, allowing you to work with your remote storage as if it was local.
::

## Modules
Expand All @@ -37,9 +37,9 @@ We are currently in the early stages of development and are looking for feedback

## Console (alpha)

[![nuxt-hub-console](/nuxthub-console.png){class="border rounded dark:border-gray-700 border-gray-200"}](https://hub.nuxt.com)
[![nuxt-hub-console](/nuxthub-console.png){class="border rounded dark:border-gray-700 border-gray-200"}](https://console.hub.nuxt.com)

The [NuxtHub console](https://hub.nuxt.com) is a web based dashboard to manage your NuxtHub apps. It helps you deploy your NuxtHub apps with a single command on your Cloudflare account while provisioning all the necessary resources for you. It abstracts the complexity of managing full-stack Nuxt applications on Cloudflare.
The [NuxtHub console](https://console.hub.nuxt.com) is a web based dashboard to manage your NuxtHub apps. It helps you deploy your NuxtHub apps with a single command on your Cloudflare account while provisioning all the necessary resources for you. It abstracts the complexity of managing full-stack Nuxt applications on Cloudflare.

### Features

Expand All @@ -52,5 +52,5 @@ The [NuxtHub console](https://hub.nuxt.com) is a web based dashboard to manage y
- Monitor your application with logs and analytics

::callout
The NuxtHub console is currently in private alpha and is not yet open to the public. We are looking for early adopters to help us shape the platform. If you are interested, please register on [hub.nuxt.com](https://hub.nuxt.com) and tell us what you plan to build with NuxtHub.
The NuxtHub Console is currently in private alpha and is not yet open to the public. We are looking for early adopters to help us shape the platform. If you are interested, please register on [console.hub.nuxt.com](https://console.hub.nuxt.com) and tell us what you plan to build with NuxtHub.
::
16 changes: 11 additions & 5 deletions docs/content/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ The module will create a `.hub` directory in your project root, which contains t

## Options

| Key | Default | Description |
|-----------------------|-----------------|-------------------------------------------------------------------------------------------------------------|
| `remote` | `false` | Allows working with remote data (database, kv, blob) from your deployed project. |

Configure options in your `nuxt.config.ts` as such:

```ts [nuxt.config.ts]
Expand All @@ -81,4 +77,14 @@ export default defineNuxtConfig({
})
```

You're all set! Now, let's dive into connecting to your Cloudflare account and deploying it on the Edge.
::field-group
::field{name="remote" type="boolean"}
Default to `false` - Allows working with remote storage (database, kv, blob) from your deployed project. :br
You can set `NUXT_HUB_REMOTE=true` in your `.env` file to enable the remote option.:br
Or use the `--remote` flag when running your Nuxt project locally (e.g. `nuxt dev --remote`).
::
::

::callout
You're all set! Now, let's dive into connecting to your Cloudflare account and [deploying it on the Edge](/getting-started/deploy).
::
36 changes: 28 additions & 8 deletions docs/content/1.getting-started/3.deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To deploy your Nuxt application on the Edge, we use Cloudflare Pages. Therefore,

## NuxtHub Console (alpha)

The [NuxtHub Console](https://hub.nuxt.com) is made to simplify your experience with the NuxtHub module, enabling you to effortlessly manage teams and projects, as well as deploy in seconds combined with the NuxtHub CLI.
The [NuxtHub Console](https://console.hub.nuxt.com) is made to simplify your experience with the NuxtHub module, enabling you to effortlessly manage teams and projects, as well as deploy in seconds combined with the NuxtHub CLI.

After linking your Cloudflare account in the console, deploy your project with a single command:

Expand All @@ -16,7 +16,7 @@ npx nuxthub deploy
```

The command will:
1. Ensure your are logged in on hub.nuxt.com
1. Ensure your are logged in on console.hub.nuxt.com
2. Link your local project with a NuxtHub project (or create a new one)
3. Build your Nuxt project with the correct preset
4. Deploy it to your Cloudflare account with all the necessary resources
Expand All @@ -26,19 +26,30 @@ The command will:
Install the [NuxtHub CLI](https://github.com/nuxt-hub/cli) globally with: `npm i -g nuxthub`.
::

### Remote data
### Remote Storage

In order to use remote data in your local project, update your `nuxt.config.ts`:
Once your project is deployed, you can use the remote storage in your local project.

Start your Nuxt project with:

```bash [Terminal]
npx nuxt dev --remote
```

Your development project will now use the remote storage from your deployed project.

To always use the remote storage in your local project, update your `nuxt.config.ts`:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
hub: {
// Always use remote storage in development
remote: true
}
})
```

When restarting your local server, the module will automatically use the remote data from your deployed project as long as you are logged in with the [NuxtHub CLI](https://github.com/nuxt-hub/cli) and the local project is linked to a NuxtHub project.
The module will use the remote storage from your deployed project **as long as you are logged in with the [NuxtHub CLI](https://github.com/nuxt-hub/cli) and the local project is linked to a NuxtHub project**.

## Self-hosted

Expand All @@ -62,15 +73,24 @@ Go back to the `Deployment` tab and retry the last deployment by clicing on `...

Once the deployment is done, NuxtHub should be ready to use in your deployed project.

### Remote data
### Remote Storage

To enable remote data in your self-hosted project, the module requires a secret to access the remote data.
To enable remote storage in your self-hosted project, the module requires a secret to access it.

1. Set the `NUXT_HUB_PROJECT_SECRET` environment variable in your Cloudflare Pages project settings and retry the last deployment to apply the changes.
2. Set the same `NUXT_HUB_PROJECT_SECRET` and `NUXT_HUB_PROJECT_URL` environment variables in your local project:
2. Set the same `NUXT_HUB_PROJECT_SECRET` and `NUXT_HUB_PROJECT_URL` environment variables in your local project

```bash [.env]
NUXT_HUB_PROJECT_SECRET=my-project-secret-used-in-cloudflare-env
NUXT_HUB_PROJECT_URL=https://my-nuxthub-project.pages.dev
```

When restarting your local server, the module will automatically use the remote data from your deployed project as long as the `NUXT_HUB_PROJECT_SECRET` matches the one in your Cloudflare Pages project settings.

Then, start your Nuxt project with:

```bash [Terminal]
npx nuxt dev --remote
```

Your development project will now use the remote storage from your deployed project.
Loading

0 comments on commit b165577

Please sign in to comment.