Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A demonstration using [Nuxt](https://nuxt.com) with server-side rendering on the edge, authentication and database querying using [Cloudflare D1](https://developers.cloudflare.com/d1/) with [Drizzle ORM](https://orm.drizzle.team/).

[![Deploy to NuxtHub](https://hub.nuxt.com/button.svg)](https://admin.hub.nuxt.com/new?template=todos)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fatinux%2Fatidone%2Ftree%2Fnuxthub-v1&env=NUXT_OAUTH_GITHUB_CLIENT_ID,NUXT_OAUTH_GITHUB_CLIENT_SECRET,NUXT_SESSION_PASSWORD&envDescription=GitHub%20OAuth%20App%20client%20ID%20and%20secret.%20Generate%20a%20random%20session%20password%20min%2032%20chars%20using%20%60openssl%20rand%20-hex%2032%60.&project-name=todos&repository-name=todos&demo-title=Atidone&demo-description=A%20Nuxt%20demo%20hosted%20with%20edge-side%20rendering%2C%20authentication%20and%20querying%20a%20PostgreSQL%20database&demo-url=https%3A%2F%2Ftodos.nuxt.dev%2F&demo-image=https%3A%2F%2Ftodos.nuxt.dev%2Fsocial-image.png&skippable-integrations=1&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22group%22%3A%22postgres%22%7D%5D)

## Features

Expand Down Expand Up @@ -72,7 +72,7 @@ It's also possible to leverage Cloudflare Pages CI for deploying, learn more abo
## Remote Storage

Once you deployed your project, you can connect to your remote database locally running:

```bash
pnpm dev --remote
```
Expand Down
8 changes: 4 additions & 4 deletions app/pages/optimistic-todos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { mutate: addTodo } = useMutation({
method: 'POST',
body: {
title,
completed: 0
completed: false
}
}) as Promise<Todo>
},
Expand All @@ -31,7 +31,7 @@ const { mutate: addTodo } = useMutation({
const oldTodos = queryCache.getQueryData(todosQuery.key) || []
const newTodoItem = {
title,
completed: 0,
completed: false,
// a negative id to differentiate them from the server ones
id: -Date.now(),
createdAt: new Date(),
Expand Down Expand Up @@ -97,7 +97,7 @@ const { mutate: toggleTodo } = useMutation({
$fetch(`/api/todos/${todo.id}`, {
method: 'PATCH',
body: {
completed: Number(!todo.completed)
completed: !todo.completed
}
}),

Expand All @@ -108,7 +108,7 @@ const { mutate: toggleTodo } = useMutation({
if (todoIndex >= 0) {
newTodos = oldTodos.toSpliced(todoIndex, 1, {
...todo,
completed: Number(!todo.completed)
completed: !todo.completed
})
queryCache.setQueryData(todosQuery.key, newTodos)
}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/todos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const { mutate: toggleTodo } = useMutation({
$fetch(`/api/todos/${todo.id}`, {
method: 'PATCH',
body: {
completed: Number(!todo.completed)
completed: !todo.completed
}
}),

Expand Down
2 changes: 1 addition & 1 deletion drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'drizzle-kit'

export default defineConfig({
dialect: 'sqlite',
dialect: 'postgresql',
schema: './server/database/schema.ts',
out: './server/database/migrations'
})
6 changes: 3 additions & 3 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default defineNuxtConfig({
modules: [
'@nuxt/ui',
'@nuxt/eslint',
'@nuxthub/core',
'@nuxthub/core-nightly',
'nuxt-auth-utils',
'@pinia/nuxt',
'@pinia/colada-nuxt'
Expand All @@ -12,9 +12,9 @@ export default defineNuxtConfig({
},
css: ['~/assets/main.css'],
future: { compatibilityVersion: 4 },
compatibilityDate: '2025-04-02',
compatibilityDate: '2025-08-07',
hub: {
database: true
database: 'postgresql'
},
// Development config
eslint: {
Expand Down
42 changes: 23 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@iconify-json/lucide": "^1.2.49",
"@iconify-json/simple-icons": "^1.2.38",
"@nuxt/ui": "^3.1.3",
"@nuxthub/core": "^0.9.0",
"@pinia/colada": "^0.17.1",
"@pinia/colada-nuxt": "^0.2.1",
"@pinia/nuxt": "^0.11.1",
"drizzle-kit": "^0.31.1",
"drizzle-orm": "0.44.2",
"h3-zod": "^0.5.3",
"nuxt": "^3.17.5",
"nuxt-auth-utils": "^0.5.20",
"@electric-sql/pglite": "^0.3.8",
"@iconify-json/lucide": "^1.2.68",
"@iconify-json/simple-icons": "^1.2.52",
"@nuxt/ui": "^3.3.4",
"@nuxthub/core-nightly": "1.0.0-20250919-003421-88c4eed",
"@pinia/colada": "^0.17.5",
"@pinia/colada-nuxt": "^0.2.2",
"@pinia/nuxt": "^0.11.2",
"@types/pg": "^8.15.5",
"drizzle-kit": "^0.31.4",
"drizzle-orm": "0.44.5",
"nuxt": "^4.1.2",
"nuxt-auth-utils": "^0.5.25",
"pg": "^8.16.3",
"pinia": "^3.0.3",
"zod": "^3.25.67"
"zod": "^4.1.9"
},
"devDependencies": {
"@nuxt/devtools": "^2.5.0",
"@nuxt/eslint": "^1.4.1",
"eslint": "^9.29.0",
"typescript": "^5.8.3",
"wrangler": "^4.20.1"
"@nuxt/devtools": "^2.6.3",
"@nuxt/eslint": "^1.9.0",
"eslint": "^9.35.0",
"typescript": "^5.9.2"
},
"packageManager": "pnpm@10.12.1",
"packageManager": "pnpm@10.17.0",
"pnpm": {
"onlyBuiltDependencies": [
"@parcel/watcher",
"@tailwindcss/oxide",
"better-sqlite3",
"esbuild",
"libpq",
"sharp",
"unrs-resolver",
"vue-demi",
Expand Down
Loading
Loading