- Navigate to
rjecnik-weband/orrjecnik-admin:
cd rjecnik-webcd rjecnik-admin- Install npm packages:
npm install- Configure the application:
cp .env.example .env- Run the application:
npm run devOpen http://localhost:3000 with your browser to see the result. Make sure to configure a different port for one of the apps if running both.
-
Set up a Google Cloud Console app to get a client id and secret.
-
If you are using supabase via docker, follow the steps for setting the environment variables correctly, and if you are using a hosted instance of supabase follow the official supabase docs for setting up auth providers
2.1. Depending which method of running supabase you choose don't forget to add a correct Authorized redirect URI in your Google Console
-
Try signing in via google, this will add your email to the database but fail
-
In the table
user_permissionsmanually assign theapp_permissionDictionary.ReadWriteto your user and try signing in again
-
Start docker desktop
-
Export google cloud console secrets:
export AUTH_GOOGLE_CLIENT_ID=
export AUTH_GOOGLE_CLIENT_SECRET=
- Start the supabase container:
supabase start-
From the console output copy the values of
API URLandanon keyforNEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEY -
Stop the container
supabase stopsupabase stop --no-backup- To create a new migration for the supabase database run:
supabase migration new <migration_name>-
Navigate to
supabase/migrations, find your new migration file and write you SQL. -
Apply the new migration by restarting the supabase container