-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a supabase backend * Add Discord button * Update docs
- Loading branch information
Showing
29 changed files
with
456 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ yarn.lock | |
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
# Env variables | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SUPABASE_API_URL=http://127.0.0.1:54321 | ||
SUPABASE_ANON_KEY= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createClient } from '@supabase/supabase-js'; | ||
|
||
let supabase: ReturnType<typeof createClient> | undefined; | ||
|
||
try { | ||
supabase = createClient(window.env.SUPABASE_API_URL || '', window.env.SUPABASE_ANON_KEY || ''); | ||
} catch (error) { | ||
console.error('Error initializing Supabase:', error); | ||
} | ||
|
||
export default supabase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Why a backend stack? | ||
|
||
This is our server stack built in Supabase which you can also run locally or self-host. | ||
|
||
Used to enable online capabilities such as managing users, collaborating, persisting data, etc. | ||
|
||
We will offer this as a hosted instance at some point. Ideally, the product should still work offline with no backend connection. | ||
|
||
## Usage | ||
|
||
### Running locally | ||
1. Make sure you have [Docker] installed | ||
2. Install necessary packages | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
3. Run the supabase instance locally | ||
|
||
```bash | ||
npm run start | ||
``` | ||
4. Set up the latest snapshot of the database | ||
|
||
```bash | ||
npm run reset | ||
``` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "@onlook/backend", | ||
"module": "index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"start": "supabase start", | ||
"stop": "supabase stop", | ||
"push": "supabase db push", | ||
"reset": "supabase db reset", | ||
"generate-types": "supabase gen types typescript --local > types/supabase.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "latest", | ||
"supabase": "^1.183.5" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Supabase | ||
.branches | ||
.temp | ||
.env |
Oops, something went wrong.