Skip to content

Commit c59890c

Browse files
committed
chore(realtime): add local dev guide
1 parent 285a098 commit c59890c

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

packages/core/realtime-js/example/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,71 @@ const { data } = await supabase
117117
.order('created_at', { ascending: true })
118118
.limit(50)
119119
```
120+
121+
## Local Development (Optional)
122+
123+
You can run Supabase locally using the Supabase CLI and Docker.
124+
125+
### Prerequisites
126+
127+
- [Docker](https://docs.docker.com/get-docker/) installed and running
128+
- [Supabase CLI](https://supabase.com/docs/guides/cli) installed
129+
130+
```bash
131+
npm install -g supabase
132+
```
133+
134+
### 1. Initialize Supabase
135+
136+
```bash
137+
supabase init
138+
```
139+
140+
### 2. Start Supabase
141+
142+
```bash
143+
supabase start
144+
```
145+
146+
This will start all Supabase services locally. Once started, you'll see output with your local credentials:
147+
148+
```
149+
API URL: http://127.0.0.1:54321
150+
publishable key: sb_publishable...
151+
service_role key: eyJhbG...
152+
Studio URL: http://127.0.0.1:54323
153+
```
154+
155+
### 3. Run Migrations
156+
157+
Apply the database migration:
158+
159+
```bash
160+
supabase db reset
161+
```
162+
163+
This will apply all migrations from `supabase/migrations/`.
164+
165+
### 4. Configure Environment
166+
167+
Update `.env.local` with local credentials:
168+
169+
```env
170+
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
171+
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<your-local-publishable-key>
172+
```
173+
174+
### 5. Access Local Dashboard
175+
176+
Open [http://127.0.0.1:54323](http://127.0.0.1:54323) to access Supabase Studio locally. Here you can:
177+
178+
- View and edit data in the Table Editor
179+
- Run SQL queries
180+
- Monitor Realtime connections
181+
- Check logs
182+
183+
### Stopping Supabase
184+
185+
```bash
186+
supabase stop
187+
```

0 commit comments

Comments
 (0)