Skip to content

Commit 5ba86f9

Browse files
RihanArfanautofix-ci[bot]atinux
authored
feat: add hubAI() (#173)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Sébastien Chopin <[email protected]>
1 parent d09df1e commit 5ba86f9

File tree

97 files changed

+1801
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1801
-694
lines changed

Diff for: README.md

+33-33
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,67 @@
1-
# NuxtHub
1+
# NuxtHub: Full-Stack Nuxt on Cloudflare, with Zero Config
22

33
[![npm version][npm-version-src]][npm-version-href]
44
[![npm downloads][npm-downloads-src]][npm-downloads-href]
55
[![License][license-src]][license-href]
66
[![Nuxt][nuxt-src]][nuxt-href]
77

8-
Build full-stack applications with Nuxt on Cloudflare, with zero configuration.
8+
Build and deploy powerful full-stack Nuxt applications on your Cloudflare account, with zero configuration.
99

10-
## Features
10+
NuxtHub supercharges your Nuxt development workflow so you can focus on shipping features.
1111

12-
- **Deploy your Nuxt app** to your Cloudflare account with [`npx nuxthub deploy`](https://github.com/nuxt-hub/cli) or with the [NuxtHub Admin](https://admin.hub.nuxt.com)
13-
- **SQL database** to store your application's data with [`hubDatabase()`](https://hub.nuxt.com/docs/storage/database)
14-
- **Key-Value** to store JSON data accessible globally with low-latency with [`hubKV()`](https://hub.nuxt.com/docs/storage/kv)
15-
- **Blob storage** to store static assets, such as images, videos and more with [`hubBlob()`](https://hub.nuxt.com/docs/storage/blob)
16-
- **Cache storage** to cache your server route responses or functions using Nitro's [`cachedEventHandler`](https://nitro.unjs.io/guide/cache#cached-event-handlers) and [`cachedFunction`](https://nitro.unjs.io/guide/cache#cached-functions)
12+
## ✨ Key Features
13+
14+
NuxtHub provides optional features to help you build full-stack applications:
15+
- [**Deploy your Nuxt app**](https://hub.nuxt.com/docs/getting-started/deploy) to your Cloudflare account with [`npx nuxthub deploy`](https://github.com/nuxt-hub/cli) or with the [NuxtHub Admin](https://admin.hub.nuxt.com)
16+
- [**AI Models**](https://hub.nuxt.com/docs/features/ai) to run machine learning models, such as LLMs in Nuxt.
17+
- [**Files storage**](https://hub.nuxt.com/docs/features/blob) to store static assets, such as images, videos and more
18+
- [**Caching system**](https://hub.nuxt.com/docs/features/cache) for your Nuxt pages, API routes or server functions
19+
- [**SQL database**](https://hub.nuxt.com/docs/features/database) to store your application's data
20+
- [**Key-Value**](https://hub.nuxt.com/docs/features/kv) to store JSON data accessible globally with low-latency
21+
- [**Open API**](https://hub.nuxt.com/docs/features/open-api) to generate your API documentation with [Scalar](https://scalar.com)
22+
- [**Remote Storage**](https://hub.nuxt.com/docs/getting-started/remote-storage) to connect to your project's resources from your local environment, allowing you to work with your remote storage as if it was local with `npx nuxi dev --remote`.
1723

1824
Read more on https://hub.nuxt.com
1925

20-
## Quick Setup
26+
## 🚀 Quickstart
27+
28+
Head over to our [Getting Started](https://hub.nuxt.com/docs/getting-started/installation) guide to learn more.
2129

22-
Duplicate our [nuxt-hub/starter](https://github.com/nuxt-hub/starter) or create a new NuxtHub project with:
30+
Duplicate our `nuxt-hub/hello-edge` template or create a new NuxtHub project with:
2331

2432
```bash
2533
npx nuxthub init my-app
34+
cd my-app
35+
npm run dev
2636
```
2737

28-
## Add to a Nuxt project
38+
Open http://localhost:3000 with your browser.
2939

30-
1. Install `@nuxthub/core` dependency to your project:
40+
Deploy your app to production with:
3141

3242
```bash
33-
npx nypm@latest add @nuxthub/core
43+
npx nuxthub deploy
3444
```
3545

36-
2. Install `wrangler` development dependency to your project:
46+
https://github.com/user-attachments/assets/c591efaa-96e7-4357-8d60-cdc1e20e93ed
3747

38-
```bash
39-
npx nypm@latest add -D wrangler
40-
```
48+
Learn more on [how to deploy a Nuxt app with NuxtHub](https://hub.nuxt.com/docs/getting-started/deploy).
4149

42-
3. Add `@nuxthub/core` to the `modules` section of `nuxt.config.ts`
50+
## 📚 Resources
4351

44-
```js
45-
export default defineNuxtConfig({
46-
modules: [
47-
'@nuxthub/core'
48-
]
49-
})
50-
```
51-
52-
That's it! You can now use NuxtHub features in your Nuxt app ✨
52+
- [NuxtHub Website](https://hub.nuxt.com)
53+
- [NuxtHub Admin](https://admin.hub.nuxt.com)
54+
- [NuxtHub CLI](https://github.com/nuxt-hub/cli)
55+
- [NuxtHub Templates](https://hub.nuxt.com/templates)
5356

54-
## Feedback
57+
## 🤝 Community
5558

5659
- 💡 [Feature request](https://github.com/nuxt-hub/core/issues/new?assignees=&labels=enhancement&projects=&template=%F0%9F%92%A1-feature-request.md&title=): Suggest an idea or improvement.
5760
- 🐞 [Bug report](https://github.com/nuxt-hub/core/issues/new?assignees=&labels=bug&projects=&template=%F0%9F%90%9E-bug-report.md&title=): Create a report to help us improve the platform.
5861
- 🏞️ [New Template](https://github.com/nuxt-hub/core/issues/new?assignees=&labels=template&projects=&template=%F0%9F%8F%9E%EF%B8%8F-new-template.md&title=): Share a template you made based on NuxtHub.
5962

6063

61-
## Contributing
64+
## 💚 Contributing
6265

6366
```bash
6467
# Install dependencies
@@ -79,12 +82,9 @@ pnpm lint
7982
# Run Vitest
8083
pnpm test
8184
pnpm test:watch
82-
83-
# Release new version
84-
pnpm release
8585
```
8686

87-
## License
87+
## 📄 License
8888

8989
[Apache 2.0](./LICENSE)
9090

Diff for: docs/components/AppFooter.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const links = [
2222
</template>
2323

2424
<template #right>
25-
<UColorModeButton />
25+
<ColorScheme><UColorModeSelect /></ColorScheme>
2626
<UButton
2727
icon="i-simple-icons-x"
2828
color="gray"

Diff for: docs/components/AppHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const navLinks = links.map((link) => {
2828
children: mapContentNavigation(navigation.value)
2929
.find(link => link.label === 'Docs')
3030
.children
31-
.map(({ icon, ...link }) => link)
31+
.map(({ icon, ...link }) => link) // eslint-disable-line @typescript-eslint/no-unused-vars
3232
}
3333
}
3434
return {

Diff for: docs/content/0.index.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ hero:
1111
light: '/images/landing/hero-light.svg'
1212
dark: '/images/landing/hero-dark.svg'
1313
headline:
14-
label: Code, Draw, Deploy
15-
to: /blog/drawing-app-with-nuxt-and-cloudflare-r2
14+
label: NuxtHub AI is out
15+
to: /changelog/hub-ai
1616
icon: i-ph-arrow-right
1717
links:
1818
- label: Get started
@@ -73,30 +73,29 @@ deploy:
7373
trailing-icon: i-ph-arrow-right
7474
color: black
7575
size: lg
76-
to: https://admin.hub.nuxt.com/?utm_source=nuxthub-docs&utm_medium=home
77-
target: _blank
76+
to: /docs/getting-started/deploy
7877
- label: Start locally
7978
color: gray
8079
variant: ghost
8180
to: '/docs/getting-started'
8281
size: lg
8382
database:
8483
img:
85-
src: '/images/landing/nuxthub-database.png'
84+
src: '/images/landing/nuxthub-admin-database.png'
8685
width: 576
87-
height: 314
86+
height: 325
8887
headline: NuxtHub Database
8988
title: A <span class="text-primary">scalable database</span> for your Nuxt application.
9089
description: 'NuxtHub Database unlocks the power of <a class="font-semibold text-gray-800 dark:text-white hover:underline underline-offset-4" href="https://developers.cloudflare.com/d1/" target="_blank">Cloudflare D1</a> to give you access to a serverless SQL database, with zero configuration.
9190
Scale and manage effortlessly, and pay only for what you use.'
9291
features:
9392
- name: 'hubDatabase() server composable'
9493
- name: 'Database browser powered by Drizzle Studio'
95-
- name: 'Nuxt Devtools integration'
94+
- name: 'Nuxt DevTools integration'
9695
buttons:
9796
- label: Database docs
9897
size: lg
99-
to: /docs/storage/database
98+
to: /docs/features/database
10099
trailing-icon: i-ph-arrow-right
101100
- label: nuxt-todos-edge
102101
icon: i-simple-icons-github
@@ -119,21 +118,21 @@ database:
119118
description: 5 GB (total)
120119
blob:
121120
img:
122-
src: '/images/landing/nuxthub-blob.png'
121+
src: '/images/landing/nuxthub-admin-blob.png'
123122
width: 576
124-
height: 314
123+
height: 325
125124
headline: NuxtHub Blob
126125
title: Add <span class="text-primary">file uploads</span> to your Nuxt application.
127126
description: 'NuxtHub Blob lets you to store and access media files on a global network, thanks to <a class="font-semibold text-gray-800 dark:text-white hover:underline underline-offset-4" href="https://developers.cloudflare.com/r2/" target="_blank">Cloudflare R2</a>
128127
Let users upload data like images, videos and audio files with our server composable with our blob validator.'
129128
features:
130129
- name: 'hubBlob() server composable'
131130
- name: 'Dashboard to upload and manage files'
132-
- name: 'Manage blobs in the Nuxt Devtools'
131+
- name: 'Manage blobs in the Nuxt DevTools'
133132
buttons:
134133
- label: Blob documentation
135134
size: lg
136-
to: /docs/storage/blob
135+
to: /docs/features/blob
137136
trailing-icon: i-ph-arrow-right
138137
- label: nuxt-image-gallery
139138
icon: i-simple-icons-github
@@ -156,21 +155,21 @@ Let users upload data like images, videos and audio files with our server compos
156155
description: 10 GB / month
157156
kv:
158157
img:
159-
src: '/images/landing/nuxthub-kv.png'
158+
src: '/images/landing/nuxthub-admin-kv.png'
160159
width: 576
161-
height: 314
160+
height: 325
162161
headline: NuxtHub KV
163162
title: A Global <span class="text-primary">Key-Value Database</span> for Nuxt.
164163
description: 'NuxtHub KV leverages <a href="https://developers.cloudflare.com/kv/" target="_blank" class="font-semibold text-gray-800 dark:text-white hover:underline underline-offset-4">Cloudflare Workers KV</a> to access a global, low-latency, key-value data storage across 300+ global locations.
165164
Access it in your Nuxt codebase, with zero-configuration.'
166165
features:
167166
- name: 'hubKV() server composable'
168167
- name: 'Key-Value storage visual browser'
169-
- name: 'Manage KV storage in the Nuxt Devtools'
168+
- name: 'Manage KV storage in the Nuxt DevTools'
170169
buttons:
171170
- label: KV documentation
172171
size: lg
173-
to: /docs/storage/kv
172+
to: /docs/features/kv
174173
trailing-icon: i-ph-arrow-right
175174
- label: atinotes
176175
icon: i-simple-icons-github
@@ -259,7 +258,7 @@ tool:
259258
description: 'Select a repository from your GitHub account and deploy it globally.'
260259
img: '/images/landing/tool-github.svg'
261260
- title: 'Nuxt DevTools'
262-
description: 'Manage your NuxtHub database, kv & blob in the Nuxt Devtools.'
261+
description: 'Manage your NuxtHub database, kv & blob in the Nuxt DevTools.'
263262
img: '/images/landing/tool-devtools.svg'
264263
testimonials:
265264
headline: 'Wall of love'

Diff for: docs/content/1.docs/1.getting-started/1.index.md

+74-36
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,102 @@
11
---
2-
title: Introduction
3-
description: NuxtHub helps you build full-stack applications on the Edge.
2+
navigation.title: Introduction
3+
title: What is NuxtHub?
4+
description: NuxtHub helps you build and deploy full-stack Nuxt applications globally.
45
---
56

6-
NuxtHub aims to provide a complete backend experience for [Nuxt](https://nuxt.com) apps, allowing developers to build full-stack applications on the Edge, read more about [Nuxt on the edge](https://nuxt.com/blog/nuxt-on-the-edge).
7+
On top of deploying your Nuxt application, NuxtHub aims to provide a complete backend experience on top of the framework, allowing developers to build full-stack applications on the Edge, read more about [Nuxt on the Edge](https://nuxt.com/blog/nuxt-on-the-edge).
78

8-
::callout
9-
It is **currently made to be deployed on [Cloudflare Pages](https://pages.cloudflare.com)** as it leverages many Cloudflare features such as KV, D1, and R2. We are looking to support other platforms in the future.
9+
It leverages Cloudflare features such as Pages, Workers Analytics, AI, KV, D1, R2 and more.
10+
11+
::tip
12+
**NuxtHub is what Vercel / Netlify is for AWS, but for Cloudflare.** :br
13+
It also deploys to your Cloudflare account so you stay in control of your data and billing as we don't mark-up Cloudflare prices.
1014
::
1115

1216
## Features
1317

14-
NuxtHub provides multiple features to help you build full-stack applications:
15-
- **SQL database** to store your application's data with [`hubDatabase()`](/docs/storage/database)
16-
- **Key-Value** to store JSON data accessible globally with low-latency with [`hubKV()`](/docs/storage/kv)
17-
- **Blob storage** to store static assets, such as images, videos and more with [`hubBlob()`](/docs/storage/blob)
18-
- **Cache storage** to cache your server route responses or functions using Nitro's [`cachedEventHandler`](https://nitro.unjs.io/guide/cache#cached-event-handlers) and [`cachedFunction`](https://nitro.unjs.io/guide/cache#cached-functions)
19-
20-
Each storage utils is auto-imported and configured to be used in your [Nuxt's server directory](https://nuxt.com/docs/guide/directory-structure/server).
18+
NuxtHub provides optional features to help you build full-stack applications:
19+
- [AI Models](/docs/features/ai) to run machine learning models, such as LLMs in Nuxt.
20+
- [Blob storage](/docs/features/blob) to store static assets, such as images, videos and more
21+
- [Caching system](/docs/features/cache) for your Nuxt pages, API routes or server functions
22+
- [SQL database](/docs/features/database) to store your application's data
23+
- [Key-Value](/docs/features/kv) to store JSON data accessible globally with low-latency
24+
- [Open API](/docs/features/open-api) to generate your API documentation with [Scalar](https://scalar.com)
2125

22-
::callout{icon="i-ph-plugs-connected-duotone" to="/docs/getting-started/deploy#remote-storage"}
26+
::tip{icon="i-ph-plugs-connected-duotone" to="/docs/getting-started/remote-storage"}
2327
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 with `npx nuxi dev --remote`.
2428
::
2529

26-
## Packages
27-
28-
We plan to provide a complete backend experience for Nuxt apps through various `@nuxthub` packages.
29-
30-
- [`@nuxthub/core`](https://github.com/nuxt-hub/core): Main package to provide storage features
31-
- `@nuxthub/auth`: Add authentication for user management (soon)
32-
- `@nuxthub/email`: Send transactional emails to your users (soon)
33-
- `@nuxthub/analytics`: Understand your traffic and track events within your application and API (soon)
34-
- `@nuxthub/...`: You name it!
35-
36-
::important
37-
We are currently in the early stages of development (beta) and are looking for feedback from the community. If you are interested in contributing, please join us on [nuxt-hub/core](https://github.com/nuxt-hub/core).
38-
::
39-
40-
## Admin
30+
## NuxtHub Admin
4131

4232
::tabs
4333
::div{label="Projects"}
44-
[![nuxt-hub-admin](/images/landing/nuxthub-admin.png){class="border rounded dark:border-gray-700 border-gray-200"}](https://admin.hub.nuxt.com)
34+
![nuxthub-admin](/images/landing/nuxthub-admin.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin.png"}
4535
::
4636
::div{label="Deployments"}
47-
[![nuxt-hub-admin-project](/images/landing/nuxthub-admin-project.png){class="border rounded dark:border-gray-700 border-gray-200"}](https://admin.hub.nuxt.com)
37+
![nuxthub-admin-project](/images/landing/nuxthub-admin-project.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-project.png"}
4838
::
4939
::div{label="Database"}
50-
[![nuxt-hub-admin-database](/images/landing/nuxthub-admin-database.png){class="border rounded dark:border-gray-700 border-gray-200"}](https://admin.hub.nuxt.com)
40+
![nuxthub-admin-database](/images/landing/nuxthub-admin-database.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-database.png"}
41+
::
42+
::div{label="KV"}
43+
![nuxthub-admin-kv](/images/landing/nuxthub-admin-kv.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-kv.png"}
44+
::
45+
::div{label="Blob"}
46+
![nuxthub-admin-blob](/images/landing/nuxthub-admin-blob.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-blob.png"}
47+
::
48+
::div{label="Logs"}
49+
![nuxthub-admin-logs](/images/landing/nuxthub-admin-server-logs.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-server-logs.png"}
50+
::
51+
::div{label="Open API"}
52+
![nuxthub-admin-open-api](/images/landing/nuxthub-admin-open-api.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-open-api.png"}
53+
::
54+
::div{label="Cache"}
55+
![nuxthub-admin-cache](/images/landing/nuxthub-admin-cache.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxthub-admin-cache.png"}
5156
::
5257
::
5358

54-
The [NuxtHub admin](https://admin.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.
55-
56-
### Features
59+
The [NuxtHub admin](https://admin.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.
5760

61+
It abstracts the complexity of managing full-stack Nuxt applications on Cloudflare:
5862
- Link your Cloudflare account and stay in control, we never mark-up Cloudflare prices
59-
- Deploy your application with `nuxthub deploy` command
60-
- Relax while it provisions all the necessary resources (database, kv, blob)
63+
- [Deploy your application](/docs/getting-started/deploy) with `nuxthub deploy` command or with Cloudflare Pages CI
64+
- Relax while it provisions all the necessary resources (ai, blob, cache, database, kv)
6165
- Manage your app's resources with an admin panel
6266
- Visualize application, database, and cache metrics
6367
- Give access to team members to manage the application without sharing your Cloudflare account
6468
- Monitor your application with logs and analytics
69+
70+
::tip{icon="i-ph-rocket-launch-duotone" to="https://admin.hub.nuxt.com"}
71+
Get started with NuxtHub Admin.
72+
::
73+
74+
## Nuxt DevTools
75+
76+
NuxtHub also integrates with the [Nuxt DevTools](https://devtools.nuxt.com/) to provide a complete development experience.
77+
78+
::tabs
79+
::div{label="Database"}
80+
![nuxt-devtools-database](/images/landing/nuxt-devtools-database.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxt-devtools-database.png"}
81+
::
82+
::div{label="KV"}
83+
![nuxt-devtools-kv](/images/landing/nuxt-devtools-kv.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxt-devtools-kv.png"}
84+
::
85+
::div{label="Blob"}
86+
![nuxt-devtools-blob](/images/landing/nuxt-devtools-blob.png){class="border rounded dark:border-gray-700 border-gray-200" data-zoom-src="/images/landing/nuxt-devtools-blob.png"}
87+
::
88+
::
89+
90+
## Upcoming Packages
91+
92+
We plan to provide a complete backend experience for Nuxt apps through various `@nuxthub` packages.
93+
94+
- [`@nuxthub/core`](https://github.com/nuxt-hub/core): Main package to provide storage features
95+
- `@nuxthub/auth`: Add authentication for user management (soon)
96+
- `@nuxthub/email`: Send transactional emails to your users (soon)
97+
- `@nuxthub/analytics`: Understand your traffic and track events within your application and API (soon)
98+
- `@nuxthub/...`: You name it!
99+
100+
::important
101+
We are currently in the early stages of development (beta) and are looking for feedback from the community. If you are interested in contributing, please join us on [nuxt-hub/core](https://github.com/nuxt-hub/core).
102+
::

0 commit comments

Comments
 (0)