pnpm install
pnpm dev
Install the supabase CLI & docker.
supabase login
supabase start
Create a .env.local
file with the generated API URL and anon key.
NEXT_PUBLIC_SUPABASE_URL=the-generated-API-URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=the-generated-anon-key
See https://supabase.com/docs/guides/cli/local-development#database-migrations
See https://supabase.com/docs/guides/cli/local-development#database-seeds
After a change in the database schema, run the following command to regenerate the typescript types.
pnpm db:types
More info: https://supabase.com/docs/reference/javascript/typescript-support
Generate the seed file by running the script and then reset the database.
The script will automatically install dependencies and pipe the results into supabase/seed.sql
.
pnpm db:seed
pnpm db:reset
Sync the database schema with the seed file.
pnpm seed:sync
This project uses the pg_cron
extension within Supabase to automate important database maintenance tasks.
You must ensure that the Cron extension is installed and enabled in your Supabase project for these jobs to run correctly.
-
Install the pg_cron extension
Follow the Supabase pg_cron documentation to enable the extension in your project. -
Schedule the required jobs
Use the SQL commands below to schedule each job in your Supabase database.
- Update cluster active status daily
Updates theis_active
status of clusters every day at midnight:select cron.schedule( 'update-cluster-active-status', '0 0 * * *', 'select update_cluster_active_status();' );
More info: https://supabase.com/docs/guides/cron