initial commit
This commit is contained in:
24
web/.gitignore
vendored
Normal file
24
web/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Nuxt dev/build outputs
|
||||
.output
|
||||
.data
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
dist
|
||||
|
||||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.fleet
|
||||
.idea
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
75
web/README.md
Normal file
75
web/README.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Nuxt Minimal Starter
|
||||
|
||||
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
||||
|
||||
## Setup
|
||||
|
||||
Make sure to install dependencies:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# bun
|
||||
bun install
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# bun
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# bun
|
||||
bun run build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run preview
|
||||
|
||||
# pnpm
|
||||
pnpm preview
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
|
||||
# bun
|
||||
bun run preview
|
||||
```
|
||||
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
12
web/app.vue
Normal file
12
web/app.vue
Normal file
@@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<NuxtPage />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import axios from 'axios';
|
||||
|
||||
axios.defaults.baseURL = 'http://localhost:8080/'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
1
web/assets/css/main.css
Normal file
1
web/assets/css/main.css
Normal file
@@ -0,0 +1 @@
|
||||
@import "tailwindcss"
|
||||
1832
web/bun.lock
Normal file
1832
web/bun.lock
Normal file
File diff suppressed because it is too large
Load Diff
23
web/composables/useGet.ts
Normal file
23
web/composables/useGet.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import axios, { type AxiosRequestConfig } from "axios"
|
||||
|
||||
export function useGet<T>(path: string, options: AxiosRequestConfig = {}) {
|
||||
console.log('useGet')
|
||||
return useAsyncData(path, async () => {
|
||||
if (import.meta.client) {
|
||||
const auth = useAuth()
|
||||
const getToken = auth.getToken.value
|
||||
const token = await getToken()
|
||||
|
||||
options.headers = {
|
||||
'Authorization': `Bearer ${token}`
|
||||
}
|
||||
const result = await axios.get<T>(path, options)
|
||||
return result.data
|
||||
} else {
|
||||
const headers = useRequestHeaders(['cookie'])
|
||||
options.headers = headers
|
||||
const result = await axios.get<T>(path, options)
|
||||
return result.data
|
||||
}
|
||||
})
|
||||
}
|
||||
14
web/nuxt.config.ts
Normal file
14
web/nuxt.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
import tailwindcss from "@tailwindcss/vite"
|
||||
|
||||
export default defineNuxtConfig({
|
||||
modules: ['@clerk/nuxt'],
|
||||
compatibilityDate: '2025-05-15',
|
||||
devtools: { enabled: true },
|
||||
css: ['@/assets/css/main.css'],
|
||||
vite: {
|
||||
plugins: [
|
||||
tailwindcss()
|
||||
]
|
||||
}
|
||||
})
|
||||
21
web/package.json
Normal file
21
web/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "nuxt-app",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
"@clerk/nuxt": "^1.6.9",
|
||||
"@tailwindcss/vite": "^4.1.8",
|
||||
"axios": "^1.10.0",
|
||||
"nuxt": "^3.17.5",
|
||||
"tailwindcss": "^4.1.8",
|
||||
"vue": "^3.5.16",
|
||||
"vue-router": "^4.5.1"
|
||||
}
|
||||
}
|
||||
34
web/pages/index.vue
Normal file
34
web/pages/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { useGet } from "~/composables/useGet";
|
||||
|
||||
const identifiedResult = await useGet('/identify-yourself')
|
||||
const allowedResult = await useGet('/do-you-have-permission')
|
||||
const thingsResult = await useGet('/things')
|
||||
console.log('something')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<header>
|
||||
<SignedIn>
|
||||
<UserButton />
|
||||
</SignedIn>
|
||||
<SignedOut>
|
||||
<SignInButton />
|
||||
</SignedOut>
|
||||
</header>
|
||||
<main>
|
||||
<div>
|
||||
identified: {{ identifiedResult.data }}
|
||||
</div>
|
||||
<div>
|
||||
allowed: {{ allowedResult.data }}
|
||||
</div>
|
||||
<div>
|
||||
things: {{ thingsResult.data }}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
BIN
web/public/favicon.ico
Normal file
BIN
web/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
2
web/public/robots.txt
Normal file
2
web/public/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-Agent: *
|
||||
Disallow:
|
||||
3
web/server/tsconfig.json
Normal file
3
web/server/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
}
|
||||
4
web/tsconfig.json
Normal file
4
web/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
// https://nuxt.com/docs/guide/concepts/typescript
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
Reference in New Issue
Block a user