How rlarson20/voicevault works
Project type and purpose
• Full-stack web application:
• Frontend: static HTML/JS (templates/index.html, static/recorder.js)
• Backend/API: FastAPI app (server.py + api/ directory)
• Services: audio file management and speech-to-text engine (services/)
• Clients: browser UI and optional Python client (client.py)
File structure for key architectural components
• Top-level server entrypoint: server.py
• API layer: api/routes.py (endpoints), api/schemas.py (Pydantic models), api/dependencies.py
• Frontend assets:
• templates/index.html (webpage)
• static/recorder.js (JS logic to capture audio and POST to server)
• Services layer:
• services/file_manager.py (save, retrieve audio files)
• services/STT_Engine.py (invoke speech-to-text logic)
• Supporting scripts: client.py (programmatic API consumer), whis_test.py / sr_example.py (experimentations), MVP/main.py (prototype)
Extract architectural insights
• FastAPI application composed of a routing layer that:
a. Accepts multipart file uploads (audio)
b. Delegates to FileManager for persistence
c. Passes file path to STT_Engine for transcription
d. Returns transcript JSON to caller
• Frontend captures audio in browser and invokes the above API endpoints
• No database is present; file system is used for storage
• Prototyping notebooks (Untitled.ipynb) live outside the production path
1) Web Browser (UI):
– index.html + recorder.js
2) FastAPI Server:
– server.py
– api/routes.py
– api/schemas.py
– api/dependencies.py
3) FileManager Service (services/file_manager.py)
4) STT Engine Service (services/STT_Engine.py)
5) Optional Python Client (client.py)
1) Browser → HTTP POST /upload-audio → FastAPI Server
2) Server → FileManager.save(file) → local filesystem
3) Server → STT_Engine.transcribe(filepath) → transcript text
4) Server → HTTP Response (JSON transcript) → Browser
5) (Optional) External Python Client → HTTP API → Server → same flow
c. Architectural patterns & principles:
– Layered architecture: Presentation (UI) → API layer → Services
– Single responsibility: File I/O separated from STT logic
– Dependency injection: FastAPI dependencies.py for service wiring
d. Key technologies & frameworks:
– FastAPI (backend web framework)
– Pydantic schemas for request/response models
– JavaScript Web Audio API (recorder.js)
– Python-based STT engine (could be Whisper, VOSK, etc.)
– [ ] Browser UI (index.html + recorder.js)
– [ ] HTTP endpoint definitions (e.g., POST /transcribe)
– [ ] FileManager service (services/file_manager.py)
– [ ] STT Engine service (services/STT_Engine.py)
– [ ] Optional Python Client (client.py)