chore: update docs of supabase instructions
This commit is contained in:
+4
-2
@@ -9,11 +9,13 @@ tasks:
|
||||
cd ../dashboard &&
|
||||
cp .env.example .env &&
|
||||
cd ../.. &&
|
||||
pnpm supabase:start
|
||||
pnpx supabase start
|
||||
command: |
|
||||
SUPABASE_ANON_KEY=$(pnpm supabase:status | grep "anon key" | awk '{print $3}' | tr -d '\\n') &&
|
||||
SUPABASE_ANON_KEY=$(pnpx supabase status | grep "anon key" | awk '{print $3}' | tr -d '\\n') &&
|
||||
cd apps/dashboard &&
|
||||
sed -i "s/PUBLIC_SUPABASE_ANON_KEY=.*/PUBLIC_SUPABASE_ANON_KEY=$SUPABASE_ANON_KEY/g" .env &&
|
||||
sed -i "s/PRIVATE_SUPABASE_SERVICE_ROLE=.*/PRIVATE_SUPABASE_SERVICE_ROLE=$SUPABASE_SERVICE_ROLE/g" .env &&
|
||||
cd ../classroomio-com &&
|
||||
cd ../.. &&
|
||||
pnpm dev
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
const supabase = createClient(
|
||||
'https://kmpdoztwluxrgnthfkau.supabase.co',
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImttcGRvenR3bHV4cmdudGhma2F1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTc0MTA1NjAsImV4cCI6MjA3Mjk4NjU2MH0.A9pIKBSMNQXgumNYEzhQV6PjBV7iCc1bZ42hYkO0sC8'
|
||||
);
|
||||
|
||||
const localSupabase = createClient(
|
||||
'http://127.0.0.1:54321',
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
|
||||
);
|
||||
|
||||
async function main() {
|
||||
const { data, error } = await supabase.from('profile').select('*');
|
||||
|
||||
console.log(data);
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -52,12 +52,16 @@ Once you have an account just click on the _New Project_ on your dashboard. Afte
|
||||
anywhere in the dashboard for security reasons.
|
||||
</Callout>
|
||||
|
||||
### Setup Supabase CLI
|
||||
|
||||
Follow the instructions [here](https://supabase.com/docs/guides/local-development/cli/getting-started) to setup the Supabase CLI on your computer.
|
||||
|
||||
### Login to Supabase via the CLI
|
||||
|
||||
Open your terminal and go to the root of the project. Run the following:
|
||||
|
||||
```bash copy
|
||||
pnpm supabase:login
|
||||
supabase login
|
||||
```
|
||||
|
||||
Follow the instruction in your terminal to generate your access token. Paste the token in the console and hit **Enter**
|
||||
@@ -74,7 +78,7 @@ Follow the instruction in your terminal to generate your access token. Paste the
|
||||
- Then run in your terminal:
|
||||
|
||||
```bash copy
|
||||
pnpx supabase@1.51.1 db push --db-url "URL HERE"
|
||||
supabase db push --db-url "URL HERE"
|
||||
```
|
||||
|
||||
<Callout>
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@
|
||||
"release": "standard-version",
|
||||
"ci": "cypress run",
|
||||
"dashboard:build": "cd apps/dashboard && pnpm i && PUBLIC_IS_SELFHOSTED=true NODE_OPTIONS='--max-old-space-size=20384' DEPLOYMENT_PROVIDER=docker pnpm build",
|
||||
"dashboard:start": "cd apps/dashboard && node build"
|
||||
"dashboard:start": "cd apps/dashboard && node build",
|
||||
"supabase:push": "pnpx supabase link --project-ref $PROJECT_ID && pnpx supabase db push --include-all"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user