Skip to content

Commit e77f9b9

Browse files
committed
chore(demo): new demo with ui pro
1 parent a5fdfe4 commit e77f9b9

24 files changed

+3534
-2581
lines changed

demo/.env.example

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/.gitignore

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
110
node_modules
11+
12+
# Logs
13+
logs
214
*.log
3-
.nuxt
4-
nuxt.d.ts
5-
.output
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
622
.env
7-
.history
23+
.env.*
24+
!.env.example
25+
26+
#VSC
27+
.history

demo/.npmrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Live demo: https://n3-supabase.netlify.app
66

77
- Frontend:
88
- [Nuxt 3](https://nuxt.com/) - The Vue Framework for Web Architects
9+
- [Nuxt UI Pro](https://ui.nuxt.com/) for components
910
- [TailwindCSS](https://tailwindcss.com/) for styling and layout.
1011
- [Supabase Module](https://github.com/nuxt-modules/supabase) for user management and supabase data client.
1112
- Backend:
@@ -54,6 +55,9 @@ pnpm dev
5455

5556
## Production
5657

58+
> [!WARNING]
59+
> This project uses [Nuxt UI Pro](https://ui.nuxt.com/pro), you need a license to deploy it in production. However, you can use it for free in development.
60+
5761
Build the application for production:
5862

5963
```bash

demo/app.config.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
export default defineAppConfig({
22
ui: {
3-
primary: 'green',
3+
colors: {
4+
primary: 'orange',
5+
neutral: 'zinc',
6+
},
7+
input: {
8+
variants: {
9+
variant: {
10+
subtle: 'ring-default bg-elevated/50',
11+
},
12+
},
13+
},
14+
},
15+
uiPro: {
16+
header: {
17+
slots: {
18+
root: 'border-none',
19+
},
20+
},
421
},
522
})

demo/app.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
<template>
2-
<AppContainer>
3-
<AppHeader />
4-
<PageContainer>
2+
<UApp>
3+
<NuxtLayout>
54
<NuxtPage />
6-
</PageContainer>
7-
</AppContainer>
5+
</NuxtLayout>
6+
</UApp>
87
</template>
8+
9+
<script setup lang="ts">
10+
const title = 'Nuxt 3 x Supabase'
11+
const description = 'Demo of a simple todo list app using Nuxt and Supabase.'
12+
13+
useSeoMeta({
14+
title,
15+
ogTitle: title,
16+
description,
17+
ogDescription: description,
18+
})
19+
</script>

demo/assets/css/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import "tailwindcss";
2+
@import "@nuxt/ui-pro";
3+
4+
:root {
5+
--ui-header-height: 40px;
6+
7+
--ui-container: 100%;
8+
}

demo/components/AppContainer.vue

Lines changed: 0 additions & 5 deletions
This file was deleted.

demo/components/AppHeader.vue

Lines changed: 35 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,46 @@
11
<script setup lang="ts">
22
const client = useSupabaseClient()
33
const user = useSupabaseUser()
4-
const colorMode = useColorMode()
5-
6-
const toggleDark = () => {
7-
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
8-
}
9-
10-
const colorModeIcon = computed(() => colorMode.preference === 'dark' ? 'i-heroicons-outline-moon' : 'i-heroicons-outline-sun')
114
125
const logout = async () => {
136
await client.auth.signOut()
14-
navigateTo('/')
7+
navigateTo('/login')
158
}
169
</script>
1710

1811
<template>
19-
<div>
20-
<Title>Nuxt 3 x Supabase</Title>
21-
<div class="flex items-center md:justify-between justify-center">
22-
<div class="hidden md:block">
23-
<UButton
24-
label="Source"
25-
variant="link"
26-
color="gray"
27-
target="_blank"
28-
to="https://github.com/nuxt-modules/supabase/tree/main/demo"
29-
icon="i-heroicons-outline-external-link"
30-
/>
31-
<UButton
32-
label="Hosted on Netlify"
33-
variant="link"
34-
color="gray"
35-
target="_blank"
36-
to="https://netlify.com"
37-
icon="i-heroicons-outline-external-link"
38-
/>
39-
</div>
40-
<div class="flex items-center">
41-
<UButton
42-
variant="link"
43-
color="gray"
44-
:icon="colorModeIcon"
45-
@click="toggleDark"
46-
/>
47-
<UButton
48-
v-if="user"
49-
variant="link"
50-
color="gray"
51-
@click="logout"
52-
>
53-
Logout
54-
</UButton>
55-
</div>
56-
</div>
57-
</div>
12+
<UHeader>
13+
<template #left>
14+
<UButton
15+
label="Source"
16+
target="_blank"
17+
variant="link"
18+
color="neutral"
19+
to="https://github.com/nuxt-modules/supabase/tree/main/demo"
20+
icon="i-lucide-external-link"
21+
/>
22+
<UButton
23+
label="Hosted on Vercel"
24+
target="_blank"
25+
variant="link"
26+
color="neutral"
27+
to="https://vercel.com"
28+
icon="i-lucide-external-link"
29+
class="hidden sm:flex"
30+
/>
31+
</template>
32+
33+
<template #right>
34+
<UColorModeButton variant="link" />
35+
36+
<UButton
37+
v-if="user"
38+
variant="link"
39+
color="gray"
40+
@click="logout"
41+
>
42+
Logout
43+
</UButton>
44+
</template>
45+
</UHeader>
5846
</template>

demo/components/LoginCard.vue

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)