From 0d4f41eb60164fa801473fd8492382d825b50749 Mon Sep 17 00:00:00 2001 From: clonbg Date: Wed, 29 Jan 2025 13:42:41 +0100 Subject: [PATCH] registra --- .env | 2 ++ .vscode/settings.json | 5 ++++- quasar.config.js | 1 + src/boot/supabase.js | 11 +++++++++++ src/pages/IndexPage.vue | 24 +++++++++++++++++++----- 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .env create mode 100644 src/boot/supabase.js diff --git a/.env b/.env new file mode 100644 index 0000000..2a94291 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_SUPABASE_URL='https://edfzercujausbwfhhzls.supabase.co' +VITE_SUPABASE_ANON_KEY='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVkZnplcmN1amF1c2J3ZmhoemxzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzgxNTM1MzQsImV4cCI6MjA1MzcyOTUzNH0.1J-9b1npDm5pNSMaiLKGVXGsmLEtj9ic4IqS4GEKDm4' \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index fc76e75..64fc3f1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,8 @@ "javascriptreact", "typescript", "vue" - ] + ], + "[vue]": { + "editor.defaultFormatter": "Vue.volar" + } } \ No newline at end of file diff --git a/quasar.config.js b/quasar.config.js index f99f7a3..9f01d51 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -12,6 +12,7 @@ export default defineConfig((/* ctx */) => { // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli-vite/boot-files boot: [ + 'supabase' ], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css diff --git a/src/boot/supabase.js b/src/boot/supabase.js new file mode 100644 index 0000000..a45cdb9 --- /dev/null +++ b/src/boot/supabase.js @@ -0,0 +1,11 @@ +import { createClient } from '@supabase/supabase-js'; + +const supabaseUrl = import.meta.env.VITE_SUPABASE_URL; +const supabaseKey = import.meta.env.VITE_SUPABASE_ANON_KEY; +const supabase = createClient(supabaseUrl, supabaseKey); + +//console.log('Init Supabase: ', supabase); + +export default function useSupabase() { + return { supabase }; +} \ No newline at end of file diff --git a/src/pages/IndexPage.vue b/src/pages/IndexPage.vue index b4d4395..7438a62 100644 --- a/src/pages/IndexPage.vue +++ b/src/pages/IndexPage.vue @@ -1,16 +1,30 @@