diff --git a/.DS_Store b/.DS_Store index 6af0f90..0988cbc 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/README.md b/README.md index 6c7b31f..5d47458 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/supabase/README.md b/supabase/README.md new file mode 100644 index 0000000..eb7327c --- /dev/null +++ b/supabase/README.md @@ -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) + +Supabase Tables Chart + + +## 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 ` +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). \ No newline at end of file diff --git a/supabase/tables.png b/supabase/tables.png new file mode 100644 index 0000000..ffe96bc Binary files /dev/null and b/supabase/tables.png differ