Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A boilerplate template demonstrating Supabase integration in an Astro project deployed on Netlify.
Astro Supabase Starter is a boilerplate template from Netlify that shows how to connect an Astro site to a Supabase database and deploy it on Netlify.
Astro Supabase Starter is an open-source boilerplate that demonstrates a working integration between the Astro static-site framework, the Supabase backend-as-a-service, and Netlify hosting. The template takes a new Supabase project as input—including SQL migrations and a seed CSV file—and outputs a deployable Astro site that reads from and writes to that database. It is maintained under the netlify-templates GitHub organization and includes a live demo at https://astro-supabase-starter.netlify.app/.
The starter ships with a deployment pipeline, database setup scripts, and a standard Astro toolchain.
SUPABASE_DATABASE_URL and SUPABASE_ANON_KEY environment variables in your .env file.supabase/migrations directory contains SQL scripts, and supabase/seed.csv provides sample rows to import through the Supabase UI.netlify dev --target-port 4321 to start the Astro dev server with the same runtime as your deployed site.npm install, build to ./dist/ with npm run build, preview with npm run preview, and extend with npm run astro ....This template suits developers and teams who need a working Astro plus Supabase example.
With this starter you can deploy a database-backed Astro site or use it as a learning reference.
To run the template locally or in production, you first create a Supabase project and execute the migration SQL from supabase/migrations in the Supabase console. Next, import the contents of supabase/seed.csv to populate tables. After linking your local repo with netlify link, you start the dev server with netlify dev --target-port 4321, or you deploy by pushing to a Netlify-connected repository.
No. The template was built for the extension, but you can work without it by setting SUPABASE_DATABASE_URL and SUPABASE_ANON_KEY in your .env file.
You need Node.js v18.14 or later. An optional nvm setup helps manage the version.
Use the Deploy to Netlify button in the repository README; it creates a new repo with the same files and configures deployment for you. You can also connect your own copy of the repository to a Netlify site.
The README points to the Netlify Support Forums at https://answers.netlify.com/ for troubleshooting assistance.
