Skip to content

Commit 7cd9bb8

Browse files
committed
Update supabase.md
1 parent e6fbdd6 commit 7cd9bb8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

supabase.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# url-shortening-api-netlify-edge-supabase
2+
3+
## Supabase Setup
4+
5+
Setting up Supabase for your project involves a few key steps, from creating an account to initializing your database and integrating it with your application. Here’s a detailed walkthrough:
6+
7+
**Sign Up and Create a New Project**:
8+
9+
Visit [Supabase](https://supabase.io/) and sign up for a new account if you don't already have one.
10+
11+
Once logged in, create a new project by specifying a project name, database password, and the region closest to your users to minimize latency.
12+
13+
**Project Setup**:
14+
15+
After your project is created, which might take a few minutes, you will be redirected to the project dashboard.
16+
17+
Your project’s URL (`SUPABASE_URL`) and anon key (`SUPABASE_ANON_KEY`), which are required for connecting your application to Supabase, can be found under the `Settings` -> `API` section of your Supabase project dashboard.
18+
19+
## Database Configuration
20+
21+
Create Tables: Use the SQL editor in Supabase to create the necessary tables for your application. For the URL shortener, you’ll need a table to store URLs with columns for the short URL and the original URL.
22+
23+
```sql
24+
CREATE TABLE urls (
25+
id SERIAL PRIMARY KEY,
26+
short_url VARCHAR(255) UNIQUE NOT NULL,
27+
long_url VARCHAR(2048) NOT NULL
28+
);
29+
```
30+
31+
**Row Level Security (RLS)**:
32+
33+
Enable RLS for your tables to ensure that your data is secure and accessible only according to your specified policies.

0 commit comments

Comments
 (0)