adding supabase readme

This commit is contained in:
akdeb 2025-04-21 13:19:13 +01:00
parent 306d89f30c
commit 48e728121a
4 changed files with 69 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -101,6 +101,7 @@ ElatoAI consists of three main components:
11. **User Authentication**: Secure user authentication and authorization.
12. **Conversations with WebRTC and Websockets**: Talk to your AI with WebRTC on the NextJS webapp and with websockets on the ESP32.
13. **Volume Control**: Control the volume of the ESP32 speaker from the NextJS webapp.
14. **Realtime Transcripts**: The realtime transcripts of your conversations are stored in the Supabase DB.
## 🛠 Tech Stack
@ -172,12 +173,12 @@ lib_deps =
- ⏳ **Uninterrupted Conversations**: Up to 10 minutes continuous conversations
- 🌎 **Global Availability**: Optimized with edge computing with Deno
## 🛡 Security
- Secure WebSockets (WSS) for encrypted data transfers
- Optional: API Key encryption with 256-bit AES
- Supabase DB for secure authentication
- Supabase RLS for all tables
## 🚫 Limitations

67
supabase/README.md Normal file
View file

@ -0,0 +1,67 @@
# Supabase Setup and Usage Guide
## Installation
1. **Install Supabase CLI**
```bash
# Using NPM
npm install -g supabase
# Using Homebrew (macOS)
brew install supabase/tap/supabase
```
2. **Start Supabase locally**
```bash
# Navigate to your project
cd ElatoAI
# Start Supabase local development
supabase start
```
3. **Verify installation**
The output should show local endpoints including:
- API URL: http://127.0.0.1:54321
- Studio URL: http://127.0.0.1:54323
- JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
## Configuration
1. **Environment variables**
Add these to your `.env.local` and `.env` file in `frontend-nextjs` and `server-deno` respectively:
```
SUPABASE_URL=http://127.0.0.1:54321
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
```
## Tables chart
View a live chart of the tables and their relationships [here](http://localhost:54323/project/default/database/schemas)
<img src="tables.png" alt="Supabase Tables Chart" width="100%">
## Tables
1. `users` - user details are stored here
2. `devices` - device details (mac address, device name, etc) are stored here
3. `conversations` - conversation details (start time, end time, etc) are stored here
4. `messages` - all conversations and transcripts are stored here
5. `api_keys` - api keys are stored here (not used for local development)
6. `languages` - all supported languages are stored here
## Development Workflow
1. Make schema changes in Supabase Studio (http://127.0.0.1:54323)
2. Generate migrations: `supabase db diff -f <migration_name>`
3. Apply to local database: `supabase migration up`
4. Push changes to production when ready
## Stopping Supabase
```bash
supabase stop
```
For more details, visit the [Supabase documentation](https://supabase.com/docs).

BIN
supabase/tables.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB