Files
VoiceVault/README.md

134 lines
3.5 KiB
Markdown
Raw Normal View History

2026-02-15 11:55:06 -07:00
# VoiceVault
2026-02-14 16:23:34 -07:00
2026-02-15 11:55:06 -07:00
VoiceVault is an archival audio app where users upload recordings, get speech-to-text transcripts, and search their archive with RAG-ready chunks.
2026-02-14 16:23:34 -07:00
2026-02-15 11:55:06 -07:00
## What The App Does
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
- User registration and login
- Upload audio/video recordings (private or public)
- Store original media in Supabase Storage bucket (`archives`)
2026-02-15 01:43:43 -07:00
- Transcribe media locally with `faster-whisper`
2026-02-15 11:55:06 -07:00
- Save transcript chunks to `rag_chunks`
- Save prompt/context metadata to `archive_metadata`
- View feed/history, open full post detail, play original audio
- Edit and delete your own posts
- Download a post as a ZIP bundle
- Search transcript chunks for RAG use
## Tech Stack
- Backend: Flask (`backend/main.py`, `backend/api_routes.py`)
- Data + storage: Supabase Postgres + Supabase Storage (`backend/db_queries.py`)
- Frontend: React + Vite (`frontend/`)
- Transcription: `faster-whisper` (local inference)
2026-02-15 01:43:43 -07:00
## Project Structure
2026-02-14 16:23:34 -07:00
2026-02-15 11:55:06 -07:00
- `schema.sql`: DB schema
- `backend/main.py`: Flask app entrypoint
- `backend/api_routes.py`: API routes and orchestration
- `backend/db_queries.py`: Supabase table/storage functions
- `frontend/src/App.jsx`: main app shell/navigation
- `frontend/src/pages/`: Feed, Create, History, Search, Post detail, Settings
## Backend Environment
Create `backend/.env`:
```env
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
SUPABASE_BUCKET=archives
# Optional
BACKEND_UPLOAD_DIR=uploads
WHISPER_MODEL=base
WHISPER_DEVICE=cpu
WHISPER_COMPUTE_TYPE=int8
2026-02-15 12:13:33 -07:00
EMBEDDING_PROVIDER=local
OPENAI_EMBEDDING_MODEL=text-embedding-3-small
# OPENAI_API_KEY=... # only needed if EMBEDDING_PROVIDER=openai
2026-02-15 11:55:06 -07:00
```
Notes:
- Use `SUPABASE_SERVICE_ROLE_KEY`, not publishable/anon key.
- Ensure bucket name matches exactly (`archives`).
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
## How To Start
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
### 1. Setup database
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
1. Open Supabase SQL editor.
2. Run `schema.sql`.
3. Confirm tables and storage bucket are created.
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
### 2. Start backend
2026-02-14 16:23:34 -07:00
```bash
2026-02-15 11:55:06 -07:00
cd TitanForge/backend
pip install -r ../requirements.txt
2026-02-15 01:43:43 -07:00
python main.py
2026-02-14 16:23:34 -07:00
```
2026-02-15 11:55:06 -07:00
Backend runs at `http://localhost:5000`.
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
### 3. Start frontend
2026-02-14 16:23:34 -07:00
```bash
2026-02-15 11:55:06 -07:00
cd TitanForge/frontend
2026-02-15 01:43:43 -07:00
npm install
npm run dev
2026-02-14 16:23:34 -07:00
```
2026-02-15 11:55:06 -07:00
Frontend runs at `http://localhost:5173` (default Vite).
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
## How To Use The App
1. Register or log in from the landing screen.
2. Go to `Make an Archive Post`.
3. Fill title/description, choose visibility, upload an audio/video file.
4. Wait for transcription to finish.
5. Open `My Feed` or `History` to view the post.
6. Click `View Post` to:
- Play original audio
- Read full transcript
- See timestamped chunks
- Download ZIP archive
7. In `History`, use edit/delete actions for your own posts.
8. Use `Search Archives` to query transcript chunks.
## Main API Endpoints
2026-02-15 01:43:43 -07:00
Auth:
- `POST /api/auth/register`
- `POST /api/auth/login`
2026-02-15 11:55:06 -07:00
Upload and processing:
- `POST /api/posts/upload`
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
Posts and history:
2026-02-15 01:43:43 -07:00
- `GET /api/posts`
- `GET /api/posts/<post_id>`
2026-02-15 11:55:06 -07:00
- `PUT /api/posts/<post_id>/edit`
- `DELETE /api/posts/<post_id>?user_id=<id>`
- `GET /api/users/<user_id>/history`
2026-02-15 01:43:43 -07:00
2026-02-15 11:55:06 -07:00
Playback and download:
- `GET /api/posts/<post_id>/audio-url?user_id=<id>&expires_in=3600`
- `GET /api/posts/<post_id>/download`
2026-02-14 16:23:34 -07:00
2026-02-15 11:55:06 -07:00
RAG:
- `GET /api/posts/<post_id>/chunks`
- `GET /api/rag/search?user_id=<id>&q=<query>`
## Common Issues
- `403 / RLS` during upload:
- Usually wrong key type. Use service role key in backend `.env`.
- Audio not playing:
- Verify `archive_files.role='original_audio'` exists for that post.
- Verify bucket is `archives`.
- Restart backend after `.env` changes.
- Whisper slow on CPU:
- Use a smaller model or faster machine/GPU settings.