SupabaseSupabase
Help CenterDatabase ManagementGetting Started with Your Supabase Database

Getting Started with Your Supabase Database

Last updated February 26, 2024

Introduction

Welcome to Supabase, your open-source Firebase alternative that empowers you to build in a weekend and scale to millions. This guide is designed to help you hit the ground running with Supabase by setting up your first database. Whether you're building a new project from scratch or integrating Supabase into an existing project, you'll find that starting with a robust Postgres database has never been easier. Let's dive in!

Step-by-Step Guide

  1. Sign Up for Supabase
  2. Create a New Project
  • Once logged in, click on the "New Project" button.
  • Fill in the project details, including a unique name for your project and the region that best suits your user base. This will ensure optimal performance for your database.
  1. Configure Your Database
  • After your project is created, navigate to the 'Database' section in your project dashboard.
  • Here, you can create your first table using the Supabase Table Editor. Click on "New Table" and define your table schema, including table name and columns.
  1. Secure Your Database
  • Go to the "Authentication" section to set up Row Level Security (RLS) for your tables. This ensures that only authenticated users can access or modify data according to the policies you define.
  1. Explore the API
  • Supabase automatically generates APIs for your database tables. Navigate to the "API" section to explore the RESTful and Realtime APIs generated for your project.
  • Use the API documentation provided by Supabase to understand how to interact with your database from your application.
  1. Integrate with Your Application
  • Install the Supabase client library in your application. For a JavaScript project, you would run npm install @supabase/supabase-js.
  • Initialize Supabase in your application by providing the Supabase URL and public API key found in your project settings.
  1. Run Your First Query
  2. Next Steps
  • Now that you have your Supabase database up and running, explore adding more tables, setting up complex queries, and integrating more Supabase services like Storage and Auth.

Conclusion

Congratulations! You've successfully set up your first Supabase database. With these foundational steps, you're well on your way to building powerful, scalable applications. Remember, the Supabase community and documentation are great resources as you continue to explore and build. Happy coding!

Was this article helpful?